/* Estilo moderno y profesional para la vista de detalle de plan GoTravel */

@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Montserrat:wght@400;700&display=swap");

:root {
  --amarillo: #fbde64;
  --verde-claro: #97cbc1;
  --verde-oliva: #667452;
  --verde-oscuro: #1c823e;
  --blanco: #ffffff;
  --gris-suave: #f9f9f9;
  --gris-texto: #333;
  --gris-medio: #e6e6e6;
  --borde-radius: 16px;
  --sombra: 0 6px 32px rgba(28, 130, 62, 0.1);
  --transicion: 0.3s;
}

body {
  font-family: "Montserrat", "Libre Baskerville", serif;
  background: linear-gradient(
    135deg,
    var(--gris-suave) 60%,
    var(--verde-claro) 100%
  );
  color: var(--gris-texto);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header mejorado para compatibilidad */
header {
  background: var(--blanco);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  padding: 0.7rem 0;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .header-fijo {
  background: transparent;
  box-shadow: none;
  position: static;
  margin-bottom: 0;
  padding: 0;
}

.logo-nombre {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo-ficticio {
  height: 48px;
  width: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--verde-oscuro);
  background: var(--gris-medio);
}

.nombre-agencia {
  font-family: "Libre Baskerville", serif;
  font-size: 1.3rem;
  color: var(--verde-oscuro);
  font-weight: bold;
  letter-spacing: 1px;
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}

nav a {
  text-decoration: none;
  color: var(--verde-oscuro);
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.2s;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}

nav a:hover {
  background: var(--amarillo);
  color: var(--gris-texto);
}

main {
  max-width: 800px;
  margin: 2.5rem auto 2rem auto;
  background: var(--blanco);
  border-radius: var(--borde-radius);
  box-shadow: var(--sombra);
  padding: 2.5rem 2rem 2rem 2rem;
  position: relative;
  flex: 1 0 auto;
  text-align: center;
}

/* Ajustar alineación de elementos específicos que deben estar a la izquierda */
.plan-section,
.plan-condiciones {
  text-align: left;
}

h1 {
  color: var(--verde-oscuro);
  font-size: 2.3rem;
  margin-bottom: 1.2rem;
  text-align: center;
  letter-spacing: 1px;
  font-family: "Libre Baskerville", serif;
}

.plan-img-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.plan-img {
  width: 100%;
  max-width: 540px;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--borde-radius);
  margin-bottom: 1.5rem;
  border: 3px solid var(--verde-claro);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  background: var(--gris-medio);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* Optimización para carga: usar atributos HTML loading="lazy" y decoding="async" */
}

.plan-img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(28, 130, 62, 0.2);
}

.plan-info {
  margin-bottom: 2rem;
  font-size: 1.15rem;
  color: var(--gris-texto);
  text-align: center;
}

.plan-info strong {
  color: var(--verde-oscuro);
  font-weight: 700;
}

.plan-section {
  margin-bottom: 2rem;
  background: var(--gris-suave);
  border-radius: 12px;
  padding: 1.2rem 1.2rem 0.7rem 1.2rem;
  box-shadow: 0 2px 8px #0001;
}

.plan-section h2 {
  color: var(--verde-oliva);
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.7rem;
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.5px;
}

/* ===== Galería del Circuito ===== */
.gallery-section {
  background: linear-gradient(180deg, #f7fbfa 0%, #ffffff 100%);
}
.gallery-subtitle {
  margin: 0 0 0.8rem 0;
  color: #5b6b55;
  font-weight: 600;
}
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 90px;
  gap: 6px;
  border-radius: 10px;
  overflow: hidden;
}
.gallery-mosaic .tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}
.gallery-mosaic .tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-mosaic .tile:hover img {
  transform: scale(1.06);
}
.gallery-mosaic .tile.large {
  grid-column: span 3;
  grid-row: span 2;
}
.gallery-mosaic .tile.wide {
  grid-column: span 2;
  grid-row: span 1;
}
.gallery-mosaic .tile.tall {
  grid-column: span 1;
  grid-row: span 2;
}

.gallery-actions {
  text-align: center;
  margin-top: 0.9rem;
}
.btn-galeria {
  background: linear-gradient(135deg, #1c823e 0%, #5a7b3b 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(28, 130, 62, 0.28);
}
.btn-galeria:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* Modal */
.gallery-modal[aria-hidden="true"] {
  display: none;
}
.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 1rem;
}
.gallery-dialog {
  width: min(1024px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.gallery-close {
  position: absolute;
  inset: 12px 12px auto auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 1.2rem;
}
.gallery-header {
  padding: 1rem 1rem 0.5rem 1rem;
  border-bottom: 1px solid #eef2ef;
}
.gallery-header h3 {
  margin: 0;
  color: #1c823e;
}
.gallery-tagline {
  margin: 0.2rem 0 0.8rem 0;
  color: #556;
  font-weight: 500;
}
.gallery-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gallery-tabs .tab {
  background: #f4f7f5;
  border: 1px solid #e3ece8;
  color: #384a36;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}
.gallery-tabs .tab.active {
  background: #1c823e;
  color: #fff;
  border-color: #1c823e;
}
.gallery-content {
  padding: 0.8rem;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gallery-grid figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.gallery-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.gallery-grid figcaption {
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  color: #2a3;
  background: #f7fbfa;
}
.gallery-footer {
  padding: 0.8rem;
  border-top: 1px solid #eef2ef;
  text-align: center;
}
.gallery-cta {
  display: inline-block;
  background: linear-gradient(90deg, #fbde64, #ffd54f);
  color: #2d2d2d;
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(251, 222, 100, 0.5);
}
.gallery-cta::after {
  content: "  →";
  font-weight: 900;
}

@media (max-width: 800px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid img {
    height: 180px;
  }
}
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid img {
    height: 200px;
  }
}

.plan-section ul,
.plan-section ol {
  margin: 0 0 0 1.5rem;
  color: var(--gris-texto);
  font-size: 1rem;
}

.plan-section li {
  margin-bottom: 0.5rem;
}

.plan-section p {
  color: var(--gris-texto);
}

.plan-condiciones {
  background: var(--amarillo);
  border-left: 5px solid var(--verde-oscuro);
  padding: 1rem 1.5rem;
  border-radius: var(--borde-radius);
  margin-bottom: 2rem;
  color: var(--gris-texto);
  font-size: 1rem;
  box-shadow: 0 2px 8px #0001;
  line-height: 1.6;
}

.plan-condiciones strong {
  color: var(--verde-oscuro);
  display: block;
  margin-bottom: 0.5rem;
}

#plan-incluye li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  color: var(--gris-texto);
  font-weight: 500;
}

#plan-incluye li:last-child {
  border-bottom: none;
}

#plan-incluye li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--verde-oscuro);
  border-radius: 50%;
  margin-right: 0.7rem;
  vertical-align: middle;
}

#plan-itinerario li {
  padding: 0.7rem 0;
  border-left: 3px solid var(--verde-claro);
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--gris-suave) 0%, transparent 100%);
  border-radius: 0 8px 8px 0;
}

/* Loading states */
.loading {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

/* FOOTER ESTILO PROFESIONAL */
footer {
  flex-shrink: 0;
  background: var(--verde-oscuro);
  color: #fff;
  padding: 2rem 0 1rem 0;
  margin-top: 3rem;
}

.footer-contenido {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.logo-footer {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--amarillo);
  background: var(--gris-medio);
}

.footer-enlaces a {
  color: #fff;
  margin-right: 1.2rem;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-enlaces a:hover {
  color: var(--amarillo);
  text-decoration: underline;
}

.footer-redes {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-redes a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.7rem;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-redes a:hover .icono-red,
.footer-redes a:focus .icono-red {
  filter: brightness(1.2) drop-shadow(0 2px 6px #1c823e33);
}

.icono-red {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px #0002);
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}

.red-social-label {
  display: none;
}

@media (min-width: 600px) {
  .red-social-label {
    display: inline;
    margin-left: 0.3rem;
    font-size: 1rem;
    color: #fff;
    font-weight: 400;
  }
}

.footer-legales {
  max-width: 1200px;
  margin: 2rem auto 0 auto;
  padding: 0 1rem;
  background: transparent;
}

.footer-legales h4 {
  color: #fff;
  margin-bottom: 0.7rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.footer-legales ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-legales li a {
  color: #fbde64;
  text-decoration: underline;
  font-size: 1rem;
  transition: color 0.2s;
}

.footer-legales li a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-legales p {
  font-size: 0.95rem;
  color: #e6e6e6;
  margin-top: 1.2rem;
}

footer > p {
  margin-top: 2rem;
  text-align: center;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

/* Divider sutil entre acciones y sellos */
.section-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d9e7e3, transparent);
  margin: 1.2rem auto 1.4rem auto;
  width: min(680px, 92%);
}

/* RESPONSIVE FOOTER */
@media (max-width: 900px) {
  main {
    max-width: 98vw;
    padding: 1.2rem 0.5rem;
  }
  .footer-contenido {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .footer-legales {
    padding: 0 0.5rem;
  }
}

@media (max-width: 700px) {
  main {
    padding: 1rem 0.2rem;
  }
  h1 {
    font-size: 1.3rem;
  }
  .plan-img {
    max-height: 180px;
  }
  .footer-contenido {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .footer-legales ul {
    gap: 0.7rem;
    font-size: 0.95rem;
  }
  .footer-legales h4 {
    font-size: 1rem;
  }
}

/* ESTILOS PROFESIONALES PARA BOTONES DE ACCIÓN */

.acciones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  text-align: center;
}

.btn-whatsapp,
.btn-descarga {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1.2rem 2.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 200px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
  outline: none;
}

/* Botón WhatsApp - Verde WhatsApp con gradiente */
.btn-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #1ebe57 100%);
  color: #ffffff;
  border: 2px solid transparent;
}

.btn-whatsapp::before {
  content: "💬";
  font-size: 1.3rem;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus {
  background: linear-gradient(135deg, #1ebe57 0%, #128c42 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

/* Tarjeta de confianza y grilla de sellos */
.trust-card {
  margin: 1.5rem auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--sombra);
  padding: 1.2rem 1rem;
  max-width: 820px;
}

.trust-note {
  background: #f0f7f4;
  border-left: 4px solid var(--verde-oscuro);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.trust-grid img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 0.5rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

@media (max-width: 700px) {
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust-grid img {
    height: 80px;
  }
}

/* Título de sellos */
.trust-title {
  font-size: 1rem;
  color: var(--verde-oliva);
  margin: 0.4rem 0 0.8rem 0.2rem;
  letter-spacing: 0.3px;
  font-weight: 700;
}

/* Barra de acciones sticky (fixed) en móvil */
@media (max-width: 700px) {
  .acciones {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(120%) blur(6px);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.12);
    padding: 0.8rem 0.8rem calc(0.8rem + env(safe-area-inset-bottom));
    margin: 0; /* pegado al borde inferior */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
  }
  /* Evitar que la barra tape el contenido */
  main {
    padding-bottom: 110px; /* altura aprox. de la barra en móvil */
  }
  .acciones .btn-whatsapp,
  .acciones .btn-descarga {
    width: 100%;
    padding: 1rem 1.2rem;
  }
}

/* Botón PDF - Gradiente GoTravel */
.btn-descarga {
  background: linear-gradient(
    135deg,
    var(--verde-oscuro) 0%,
    var(--verde-oliva) 100%
  );
  color: #ffffff;
  border: 2px solid transparent;
}

.btn-descarga::before {
  content: "📄";
  font-size: 1.3rem;
}

.btn-descarga:hover,
.btn-descarga:focus {
  background: linear-gradient(135deg, var(--verde-oliva) 0%, #4a5c3a 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(28, 130, 62, 0.4);
}

.btn-descarga:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(28, 130, 62, 0.3);
}

/* Efectos de brillo y animación */
.btn-whatsapp::after,
.btn-descarga::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.6s;
}

.btn-whatsapp:hover::after,
.btn-descarga:hover::after {
  left: 100%;
}

/* Animación de pulso sutil */
@keyframes pulse-button {
  0% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }
  100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
}

.btn-whatsapp,
.btn-descarga {
  animation: pulse-button 3s ease-in-out infinite;
}

/* Estado disabled para el botón PDF */
.btn-descarga:disabled {
  background: linear-gradient(135deg, #cccccc 0%, #999999 100%) !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  animation: none !important;
}

.btn-descarga:disabled::after {
  display: none;
}

.btn-descarga:disabled::before {
  content: "⏳";
}

/* Efecto de ripple al hacer click */
.btn-whatsapp:not(:disabled):active::before,
.btn-descarga:not(:disabled):active::before {
  animation: ripple 0.6s linear;
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

/* Responsive para botones */
@media (max-width: 600px) {
  .acciones {
    gap: 1rem;
    flex-direction: column;
    width: 100%;
  }

  .btn-whatsapp,
  .btn-descarga {
    width: 100%;
    max-width: 300px;
    font-size: 1rem;
    padding: 1rem 2rem;
    min-width: unset;
  }
}

@media (max-width: 400px) {
  .btn-whatsapp,
  .btn-descarga {
    font-size: 0.95rem;
    padding: 0.9rem 1.5rem;
  }
}

/* Mejoras para la sección de confianza */
.confianza {
  background: linear-gradient(
    135deg,
    var(--gris-suave) 0%,
    var(--verde-claro) 100%
  );
  padding: 2rem;
  border-radius: var(--borde-radius);
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(151, 203, 193, 0.3);
}

.confianza img {
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.confianza img:hover {
  transform: scale(1.1) rotate(2deg);
  filter: brightness(1.1) drop-shadow(0 4px 12px rgba(28, 130, 62, 0.3));
}

/* Estados de carga mejorados */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-size: 1.1rem;
  color: var(--verde-oliva);
}

.error-state {
  text-align: center;
  padding: 2rem;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: var(--borde-radius);
  color: #c62828;
  margin: 1rem 0;
}

/* Estilos de impresión optimizados para A4 */
@media print {
  /* Reset colores de fondo e interacciones */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  body {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  header,
  footer,
  .acciones,
  .confianza {
    display: none !important;
  }

  main {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    text-align: left !important;
  }

  h1 {
    font-size: 18pt !important;
    margin: 0 0 8pt 0 !important;
    color: #1c823e !important;
  }

  .plan-img-container {
    margin: 0 0 8pt 0 !important;
  }

  .plan-img {
    max-width: 100% !important;
    max-height: none !important;
    border: 1px solid #ccc !important;
    margin: 0 0 8pt 0 !important;
  }

  .plan-info {
    font-size: 11pt !important;
    margin-bottom: 10pt !important;
    text-align: left !important;
  }

  .plan-section {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 8pt 0 !important;
  }

  .plan-section h2 {
    font-size: 13pt !important;
    color: #1c823e !important;
    margin: 8pt 0 4pt 0 !important;
  }

  #plan-incluye li,
  #plan-itinerario li {
    border: none !important;
    padding: 2pt 0 !important;
    background: transparent !important;
  }

  .plan-condiciones {
    background: transparent !important;
    border: 1px solid #ddd !important;
    padding: 6pt !important;
    font-size: 10pt !important;
  }
}
