/* ==========================================================================
   Estilos escritos a mano (no los genera Tailwind).
   Aquí están: hero con logo animado, submenú de tours, tarjetas con foto,
   ventana de detalles con galería y animaciones al hacer scroll.
   ========================================================================== */

:root {
  --agave: #2c526b;
  --agave-dark: #1f3b4e;
  --beige: #f5f5dc;
  --babilonia: #e0a72e;
  --oxido: #a63d24;
  --gris: #eef0f1;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Botones reutilizables ---------- */
.btn-solid,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 9999px;
  padding: .7rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.25rem;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease-out), box-shadow .2s;
}
.btn-solid { background: var(--agave); color: var(--beige); }
.btn-solid:hover { background: var(--agave-dark); transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(31, 59, 78, .6); }
.btn-outline { border: 2px solid var(--agave); color: var(--agave); background: transparent; padding: calc(.7rem - 2px) 1.25rem; }
.btn-outline:hover { background: var(--agave); color: var(--beige); }
.btn-solid .icon, .btn-outline .icon { width: 1rem; height: 1rem; transition: transform .2s var(--ease-out); }
.btn-solid:hover .icon, .btn-outline:hover .icon { transform: translateX(3px); }

/* ==========================================================================
   NAVEGACIÓN: submenú de Experiencias
   ========================================================================== */
.nav-dropdown { position: relative; }
.nav-dropdown__btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-weight: 600;
  padding: .5rem 0;
}
.nav-dropdown__btn .icon { width: 1rem; height: 1rem; transition: transform .25s var(--ease-out); }
.nav-dropdown__panel {
  position: absolute;
  top: calc(100% + .6rem);
  left: 50%;
  width: 22rem;
  padding: .6rem;
  border-radius: 1.1rem;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 24px 50px -12px rgba(15, 30, 40, .45);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px) scale(.98);
  transform-origin: top center;
  transition: opacity .2s, transform .25s var(--ease-out), visibility .2s;
}
/* Puente invisible para que el menú no se cierre al bajar el mouse */
.nav-dropdown__panel::before { content: ""; position: absolute; inset: -.8rem 0 auto; height: .8rem; }
.nav-dropdown__panel::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
.nav-dropdown:hover .nav-dropdown__panel,
.nav-dropdown:focus-within .nav-dropdown__panel,
.nav-dropdown.is-open .nav-dropdown__panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}
.nav-dropdown:hover .nav-dropdown__btn .icon,
.nav-dropdown.is-open .nav-dropdown__btn .icon { transform: rotate(180deg); }

.nav-tour {
  position: relative;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .55rem;
  border-radius: .8rem;
  transition: background-color .15s;
}
.nav-tour:hover, .nav-tour:focus-visible { background: var(--gris); }
.nav-tour img {
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
  border-radius: .65rem;
  object-fit: cover;
}
.nav-tour strong { display: block; font-size: .875rem; color: var(--agave); line-height: 1.25; }
.nav-tour small { display: block; margin-top: .15rem; font-size: .75rem; color: #4b5563; font-weight: 500; }
.nav-tour__tag {
  margin-left: auto;
  align-self: flex-start;
  border-radius: 9999px;
  background: var(--babilonia);
  color: var(--agave-dark);
  padding: .1rem .5rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.nav-dropdown__all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-top: .35rem;
  padding: .65rem;
  border-top: 1px solid #e5e7eb;
  font-size: .8rem;
  font-weight: 700;
  color: var(--agave);
}
.nav-dropdown__all:hover { color: var(--oxido); }
.nav-dropdown__all .icon { width: .9rem; height: .9rem; }

/* Menú móvil */
.mobile-label {
  padding: .75rem .5rem .25rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--babilonia);
}
.mobile-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-left: .5rem;
  padding: .6rem .75rem;
  border-left: 2px solid rgba(245, 245, 220, .25);
  font-size: .95rem;
}
.mobile-sub:hover { background: rgba(255, 255, 255, .1); border-left-color: var(--babilonia); }
.mobile-sub span { font-size: .8rem; opacity: .8; }

/* ==========================================================================
   HERO con logo a la derecha
   ========================================================================== */
.hero { position: relative; overflow: hidden; isolation: isolate; }
/* Viñeta dorada muy sutil que se mueve lento */
.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(40% 35% at 75% 45%, rgba(224, 167, 46, .22), transparent 70%),
    radial-gradient(35% 30% at 15% 80%, rgba(166, 61, 36, .18), transparent 70%);
  animation: hero-drift 18s ease-in-out infinite alternate;
}
.hero__inner {
  display: grid;
  align-items: center;
  gap: 2.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3.5rem 1rem 5rem;
  text-align: center;
}
.hero__text p.hero__lead { margin-left: auto; margin-right: auto; }
.hero__ctas { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }

@media (min-width: 640px) {
  .hero__inner { padding-left: 1.5rem; padding-right: 1.5rem; }
  .hero__ctas { flex-direction: row; }
}
@media (min-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1.1fr .9fr;
    gap: 3rem;
    min-height: min(calc(100vh - 4rem), 48rem);
    padding: 5rem 2rem 6rem;
    text-align: left;
  }
  .hero__text p.hero__lead { margin-left: 0; }
  .hero__ctas { justify-content: flex-start; }
}

/* Logo */
.hero__logo {
  position: relative;
  display: grid;
  place-items: center;
  width: min(17rem, 72vw);
  aspect-ratio: 1;
  margin: 0 auto;
  order: -1; /* en celular va arriba del texto */
}
@media (min-width: 1024px) {
  .hero__logo { order: 0; width: min(30rem, 100%); }
}
.hero__halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 167, 46, .45) 0%, rgba(224, 167, 46, .12) 45%, transparent 70%);
  filter: blur(8px);
  animation: halo-pulse 5s ease-in-out infinite;
}
.hero__ring {
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  border: 1.5px dashed rgba(245, 245, 220, .35);
  animation: ring-spin 60s linear infinite;
}
.hero__ring--2 {
  inset: 12%;
  border: 1px solid rgba(224, 167, 46, .45);
  border-top-color: transparent;
  border-bottom-color: transparent;
  animation-duration: 22s;
  animation-direction: reverse;
}
/* Puntito que orbita sobre el anillo exterior */
.hero__ring::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--babilonia);
  box-shadow: 0 0 14px 3px rgba(224, 167, 46, .8);
}
.hero__ring--2::after { display: none; }

.hero__tilt {
  position: relative;
  width: 82%;
  transition: transform .4s var(--ease-out);
  will-change: transform;
}
.hero__logo-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35));
  animation: logo-in 1.4s var(--ease-out) .3s both, logo-float 6s ease-in-out 1.7s infinite;
}

/* Indicador para bajar */
.hero__scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  transform: translateX(-50%);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(245, 245, 220, .75);
  animation: fade-up .8s var(--ease-out) 1.6s both;
}
.hero__scroll:hover { color: #fff; }
.hero__mouse {
  width: 22px;
  height: 34px;
  border: 2px solid currentColor;
  border-radius: 12px;
  position: relative;
}
.hero__mouse::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: currentColor;
  animation: scroll-wheel 1.8s ease-in-out infinite;
}
@media (min-width: 1024px) { .hero__scroll { display: flex; } }

/* Entrada escalonada del texto del hero */
.hero-in { animation: fade-up .9s var(--ease-out) both; animation-delay: var(--d, 0s); }

/* ==========================================================================
   TARJETAS DE TOURS
   ========================================================================== */
.tour-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s;
}
.tour-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 40px -18px rgba(31, 59, 78, .45);
  border-color: transparent;
}
.tour-card--featured { border: 2px solid var(--babilonia); }
.tour-card__ribbon {
  position: absolute;
  top: .9rem;
  left: .9rem;
  z-index: 2;
  border-radius: 9999px;
  background: var(--babilonia);
  color: var(--agave-dark);
  padding: .25rem .7rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
}
.tour-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--agave-dark);
}
.tour-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-out);
}
.tour-card:hover .tour-card__media img { transform: scale(1.07); }
.tour-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 38, 50, .55), transparent 55%);
}
.tour-card__photos {
  position: absolute;
  right: .8rem;
  bottom: .8rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .92);
  padding: .25rem .65rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--agave-dark);
}
.tour-card__photos .icon { width: .85rem; height: .85rem; }
.tour-card__icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-top: -1.5rem;
  border-radius: .85rem;
  background: var(--beige);
  color: var(--agave);
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .25);
}
.tour-card__icon .icon { width: 1.5rem; height: 1.5rem; }
.tour-card__body { display: flex; flex: 1; flex-direction: column; padding: 0 1.4rem 1.4rem; }
.tour-card__actions { display: grid; gap: .6rem; margin-top: 1.1rem; }

/* ==========================================================================
   VENTANA DE DETALLES DEL TOUR
   ========================================================================== */
html:has(dialog[open]) { overflow: hidden; }

.tour-dialog {
  width: min(64rem, calc(100% - 1.5rem));
  max-width: none;
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 1.5rem;
  background: #fff;
  color: #1f2937;
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .55);
}
.tour-dialog[open] { animation: dialog-in .45s var(--ease-out); }
.tour-dialog::backdrop {
  background: rgba(15, 30, 40, .72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.tour-dialog[open]::backdrop { animation: fade-in .3s ease both; }

.tour-dialog__grid {
  display: grid;
  max-height: calc(100dvh - 1.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 900px) {
  .tour-dialog__grid { grid-template-columns: 1.05fr 1fr; overflow: hidden; }
  .tour-dialog__content { overflow-y: auto; max-height: calc(100dvh - 1.5rem); }
}
.tour-dialog__content { position: relative; padding: 2rem 1.5rem 1.75rem; }
@media (min-width: 640px) { .tour-dialog__content { padding: 2.5rem 2.25rem 2rem; } }

.tour-dialog__close {
  position: absolute;
  top: .9rem;
  right: .9rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--gris);
  color: var(--agave-dark);
  transition: background-color .2s, transform .3s var(--ease-out);
}
.tour-dialog__close:hover { background: #e5e7eb; transform: rotate(90deg); }
.tour-dialog__close .icon { width: 1.25rem; height: 1.25rem; }

.tour-dialog__eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--oxido);
}
.tour-dialog__title {
  margin-top: .4rem;
  padding-right: 2.5rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--agave);
}
.tour-dialog__meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 9999px;
  background: var(--gris);
  padding: .3rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: #374151;
}
.chip .icon { width: .9rem; height: .9rem; color: var(--agave); }
.chip--price { background: var(--agave); color: var(--beige); }
.chip--price strong { font-family: "Playfair Display", Georgia, serif; font-size: 1rem; }

.tour-dialog__desc { margin-top: 1.25rem; font-size: .95rem; line-height: 1.7; color: #4b5563; }
.tour-dialog__h { margin-top: 1.5rem; margin-bottom: .75rem; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #1f2937; }

/* Itinerario tipo línea de tiempo */
.steps { position: relative; counter-reset: paso; }
.steps li {
  position: relative;
  padding: 0 0 1rem 2.6rem;
  font-size: .9rem;
  line-height: 1.55;
  color: #4b5563;
  counter-increment: paso;
}
.steps li::before {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: -.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: var(--beige);
  color: var(--agave);
  font-size: .8rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--agave);
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(.875rem - 1px);
  top: 1.75rem;
  bottom: .1rem;
  width: 2px;
  background: #d1d5db;
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::before { background: var(--babilonia); color: var(--agave-dark); box-shadow: none; }
.steps strong { display: block; color: #1f2937; }

.included {
  display: flex;
  gap: .9rem;
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #fbf3df, #f5f5dc);
  border: 1px solid rgba(224, 167, 46, .45);
  font-size: .85rem;
  line-height: 1.55;
  color: #4b3a14;
}
.included .icon { width: 1.6rem; height: 1.6rem; flex-shrink: 0; color: var(--oxido); }
.included strong { display: block; margin-bottom: .15rem; color: var(--oxido); font-size: .9rem; }

.tour-dialog__actions { display: grid; gap: .6rem; margin-top: 1.5rem; }
@media (min-width: 480px) { .tour-dialog__actions { grid-template-columns: 1fr 1fr; } }
.tour-dialog__actions .btn-solid,
.tour-dialog__actions .btn-outline { padding-top: .85rem; padding-bottom: .85rem; }
.btn-wa { background: #15803d; }
.btn-wa:hover { background: #166534; }

/* ---------- Galería ---------- */
.gallery { display: flex; flex-direction: column; background: var(--agave-dark); min-width: 0; }
.gallery__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #102430;
}
@media (min-width: 900px) {
  .gallery { max-height: calc(100dvh - 1.5rem); }
  .gallery__stage { aspect-ratio: auto; flex: 1; min-height: 22rem; }
}
/* Fondo desenfocado con la misma foto, para fotos verticales u horizontales */
.gallery__stage::before {
  content: "";
  position: absolute;
  inset: -30px;
  background: var(--bg) center / cover no-repeat;
  filter: blur(24px) brightness(.55);
  transition: background-image .4s;
}
.gallery__main {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .45s ease, transform .7s var(--ease-out);
}
.gallery__main.is-in { opacity: 1; transform: scale(1); }
.gallery__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-top: -1.3rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .9);
  color: var(--agave-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  transition: transform .2s var(--ease-out), background-color .2s;
}
.gallery__nav:hover { background: #fff; transform: scale(1.08); }
.gallery__nav .icon { width: 1.25rem; height: 1.25rem; }
.gallery__nav--prev { left: .8rem; }
.gallery__nav--next { right: .8rem; }
.gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem 1rem .85rem;
  background: linear-gradient(to top, rgba(10, 22, 30, .85), transparent);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
}
.gallery__count { flex-shrink: 0; font-size: .75rem; font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }
.gallery__thumbs {
  display: flex;
  gap: .5rem;
  padding: .75rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.gallery__thumbs button {
  flex: 0 0 auto;
  width: 4rem;
  height: 3.1rem;
  overflow: hidden;
  border-radius: .5rem;
  opacity: .55;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px transparent;
  transition: opacity .2s, box-shadow .2s;
}
.gallery__thumbs button:hover { opacity: .9; }
.gallery__thumbs button[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--babilonia); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   APARICIÓN AL HACER SCROLL
   JavaScript marca con .reveal-pending solo lo que está más abajo de la
   pantalla al cargar; sin JavaScript todo se ve normal.
   ========================================================================== */
.reveal-pending {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal-pending.is-visible { opacity: 1; transform: none; }
/* Las tarjetas de tours conservan su efecto hover después de aparecer */
.tour-card.reveal-pending.is-visible { transition: opacity .8s var(--ease-out) var(--d, 0s), transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s; }
.tour-card.reveal-pending.is-visible:hover { transform: translateY(-6px); }

/* Línea decorativa bajo los títulos de sección */
.title-line::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin: .9rem auto 0;
  border-radius: 3px;
  background: var(--babilonia);
  transform-origin: center;
  transform: scaleX(0);
  transition: transform .9s var(--ease-out) .25s;
}
.title-line.is-visible::after, .title-line:not(.reveal-pending)::after { transform: scaleX(1); }

/* ---------- Keyframes ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes logo-in {
  from { opacity: 0; transform: scale(.7) rotate(-8deg); filter: blur(10px) drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
  to { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
}
@keyframes logo-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(-1.5deg); } }
@keyframes halo-pulse { 0%, 100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes hero-drift { from { transform: translate3d(-2%, -1%, 0) scale(1); } to { transform: translate3d(2%, 2%, 0) scale(1.08); } }
@keyframes scroll-wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Movimiento reducido: todo quieto y visible ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero__halo, .hero__ring, .hero__logo-img, .hero__mouse::after, .hero-in, .hero__scroll { animation: none !important; }
  .reveal-pending { opacity: 1; transform: none; }
  .title-line::after { transform: scaleX(1); }
  .tour-card:hover, .tour-card:hover .tour-card__media img { transform: none; }
}
