/* ============================================================
   motion.css — Capa de animación e interacción 3D
   Aditiva: NO modifica reglas existentes de styles.css.
   Fase 1 — Menú 3D + navegación.
   Fase 2 — Hero parallax + entrada cinematográfica de texto.
   Autor: rediseño Descubre Berlín · 2026-05-20
   ============================================================ */

:root {
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --menu-bg: rgba(18, 18, 18, 0.97);
}

/* Agrupa las acciones (WhatsApp + Menú) a la derecha */
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- Header: estado al hacer scroll ---------- */
.site-header {
  transition: padding .4s var(--motion-ease),
              background .4s var(--motion-ease),
              box-shadow .4s var(--motion-ease);
}
.site-header.is-scrolled {
  padding-top: 8px;
  padding-bottom: 8px;
  background: rgba(24, 24, 24, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
/* Header por encima del overlay para que la "X" siga siendo clicable */
body.menu-open .site-header { z-index: 70; }

/* ---------- Hero principal: tipografía calcada del logo, izquierda ---------- */
.hero-logo-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 20px;
  line-height: 0.9;
  font-family: Roboto, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6.1rem);
  text-transform: uppercase;
  letter-spacing: -.02em;
}
.hl-descubre {
  color: var(--white);
  text-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.hl-berlin {
  color: var(--accent);
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}

/* CTA único: Reservar tour */
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 13px 32px;
  background: var(--accent);
  color: #111;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 8px;      /* cuadrado como las tarjetas */
  border: none;
  box-shadow: 0 4px 16px rgba(242, 211, 0, .22), 0 2px 6px rgba(0,0,0,.25);
  transition: transform .3s var(--motion-ease),
              box-shadow .3s var(--motion-ease);
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(242, 211, 0, .32), 0 3px 10px rgba(0,0,0,.3);
}

/* ---------- Brand: logo imagen ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo {
  display: block;
  height: clamp(20px, 2.8vw, 26px);  /* compacto: no tapa el overlay */
  width: auto;
  transition: opacity .3s var(--motion-ease), filter .3s var(--motion-ease);
}
.brand:hover .brand-logo {
  opacity: .82;
  filter: brightness(1.15);
}

/* ---------- Botón de WhatsApp directo ---------- */
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  color: var(--ink);
  background: rgba(37, 211, 102, .12);
  border: 1px solid rgba(37, 211, 102, .5);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .02em;
  text-decoration: none;
  transition: background .3s var(--motion-ease),
              color .3s var(--motion-ease),
              transform .3s var(--motion-ease),
              box-shadow .3s var(--motion-ease);
}
.wa-btn .wa-ico { display: block; color: #25d366; transition: color .3s var(--motion-ease); }
.wa-btn:hover {
  color: #0b2b1f;
  background: #25d366;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 211, 102, .3);
}
.wa-btn:hover .wa-ico { color: #0b2b1f; }
.wa-btn:focus-visible { outline: 2px solid #25d366; outline-offset: 3px; }

/* ---------- Botón de menú (hamburguesa -> X) ---------- */
.menu-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 16px 8px 14px;
  color: var(--ink);
  background: rgba(234, 234, 234, .05);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .3s var(--motion-ease),
              color .3s var(--motion-ease),
              transform .3s var(--motion-ease);
}
.menu-toggle:hover { background: rgba(242, 211, 0, .16); transform: translateY(-1px); }
.menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.menu-toggle__box { position: relative; width: 22px; height: 14px; }
.menu-toggle__box span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform .4s var(--motion-ease), opacity .25s var(--motion-ease);
}
.menu-toggle__box span:nth-child(1) { top: 0; }
.menu-toggle__box span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-toggle__box span:nth-child(3) { bottom: 0; }
body.menu-open .menu-toggle__box span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
body.menu-open .menu-toggle__box span:nth-child(2) { opacity: 0; }
body.menu-open .menu-toggle__box span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* ---------- Overlay del menú 3D ---------- */
body.menu-open { overflow: hidden; }

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 24px;
  padding: clamp(90px, 15vh, 170px) clamp(20px, 8vw, 120px) clamp(28px, 6vh, 60px);
  background: var(--menu-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity .5s var(--motion-ease), visibility .5s var(--motion-ease);
}
body.menu-open .menu-overlay { opacity: 1; visibility: visible; pointer-events: auto; }

.menu-3d {
  list-style: none;
  margin: 0;
  padding: 0;
  align-self: center;
  perspective: 1100px;
}
.menu-3d__item {
  transform-style: preserve-3d;
  transform-origin: top center;
  transform: rotateX(-92deg) translateY(28px);
  opacity: 0;
  transition: transform .6s var(--motion-ease), opacity .6s var(--motion-ease);
}
/* Fallback CSS escalonado por si GSAP no cargara (modo offline) */
body.menu-open .menu-overlay .menu-3d__item { transform: rotateX(0) translateY(0); opacity: 1; }
body.menu-open .menu-3d__item:nth-child(1) { transition-delay: .05s; }
body.menu-open .menu-3d__item:nth-child(2) { transition-delay: .11s; }
body.menu-open .menu-3d__item:nth-child(3) { transition-delay: .17s; }
body.menu-open .menu-3d__item:nth-child(4) { transition-delay: .23s; }
body.menu-open .menu-3d__item:nth-child(5) { transition-delay: .29s; }
body.menu-open .menu-3d__item:nth-child(6) { transition-delay: .35s; }
body.menu-open .menu-3d__item:nth-child(7) { transition-delay: .41s; }

.menu-3d__link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--ink);
  font-family: Roboto, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  text-transform: uppercase;
  transition: color .3s var(--motion-ease), transform .35s var(--motion-ease);
}
.menu-3d__num {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  align-self: center;
  font-size: 0;
  line-height: 0;
}
.menu-3d__link:hover,
.menu-3d__link:focus-visible { color: var(--accent); transform: translateX(18px); outline: none; }
.menu-3d__link--cta:hover { color: var(--accent); }

/* ── Móvil: forzar header siempre en una fila ──────────────────────────
   styles.css colapsa el header a columna en ≤680px (diseño antiguo con nav).
   Ahora solo tenemos logo + botón menú, caben siempre en una línea.        */
@media (max-width: 680px) {
  .site-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px clamp(14px, 4vw, 24px) !important;
    gap: 12px !important;
  }
  .brand {
    width: auto !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }
  .brand-logo {
    height: clamp(18px, 5vw, 24px) !important;
  }
}

/* ── Hero logo: alineación izquierda en móvil ──────────────────────── */
@media (max-width: 680px) {
  .hero-logo-img {
    width: clamp(200px, 80vw, 380px);
    margin-left: 0;
  }
}

/* En pantallas pequeñas, las etiquetas de texto colapsan a iconos */
@media (max-width: 560px) {
  .wa-btn__label { display: none; }
  .wa-btn { padding: 8px 11px; }
}
@media (max-width: 380px) {
  .menu-toggle__label { display: none; }
  .menu-toggle { padding: 8px 11px; }
}

/* ---------- Accesibilidad: respeta el movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
  .brand-mark, .brand:hover .brand-mark { transform: none; transition: none; }
  .nav a[data-tilt] { transform: none !important; }
  .menu-3d__item { transform: none !important; transition: opacity .25s linear; }
  .menu-overlay { transition: opacity .2s linear; }
  .menu-3d__link:hover { transform: none; }
}

/* ============================================================
   Fase 2 — Hero: parallax + entrada cinematográfica del texto
   Fase 3 — Tarjetas: reveal al scroll + tilt 3D con cursor.
   ============================================================ */

/*
   Extiende .hero-media verticalmente para dar margen al desplazamiento.
   .hero ya tiene overflow: hidden en styles.css → el exceso queda oculto.
   El efecto: la imagen se mueve más lento que el scroll (GSAP en motion.js).
*/
.hero-media {
  background-image: url("assets/hero-parallax.jpg");
  top: -22%;
  bottom: -22%;
  will-change: transform;
}

/* Grain sutil sobre el hero para textura teatral */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .035;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

/* Texto del hero: oculto antes de que GSAP lo anime.
   Solo cuando el navegador admite movimiento.
   La clase .js-hero-ready la añade motion.js antes de animar,
   así que si GSAP falla el texto es inmediatamente visible. */
@media (prefers-reduced-motion: no-preference) {
  .hero-content:not(.js-hero-ready) .eyebrow,
  .hero-content:not(.js-hero-ready) h1,
  .hero-content:not(.js-hero-ready) p:not(.eyebrow),
  .hero-content:not(.js-hero-ready) .hero-actions {
    opacity: 0;
  }
}

/* ============================================================
   Tarjetas: sin barra amarilla + sombra volumétrica consistente
   Fuente de luz: arriba-izquierda → sombra abajo-derecha.
   ============================================================ */

/* Neutraliza el ::before amarillo de styles.css */
.tour-card::before,
.combo-card::before,
.info-grid article::before,
.detail-panel::before {
  display: none;
}

/* Quita border-top amarillo de tarjetas de la Guía Insider */
.guide-advice-card,
.culture-grid article,
.book-grid article {
  border-top: 1px solid var(--line);
}

/* Sombra volumétrica base — ángulo 45° constante en toda la página */
.tour-card,
.combo-card,
.info-grid article,
.detail-panel,
.guide-advice-card,
.culture-grid article,
.book-grid article {
  box-shadow:
    5px 7px 0 rgba(0, 0, 0, 0.50),    /* borde físico: da el volumen */
    5px 7px 28px rgba(0, 0, 0, 0.38); /* penumbra suave detrás */
}

/* ============================================================
   Fase 3 — Tarjetas: tilt 3D con cursor (solo desktop)
   ============================================================ */

/*
   El atributo [data-tilt] lo añade motion.js solo en dispositivos
   con puntero fino (ratón). Se aplica DESPUÉS del reveal para que
   la animación de entrada (GSAP translateY) no conflicte con el tilt.
*/
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .tour-card[data-tilt],
  .combo-card[data-tilt] {
    transform: perspective(640px)
               rotateX(var(--ry, 0deg))
               rotateY(var(--rx, 0deg));
    transition: transform 0.18s ease-out,
                box-shadow 0.32s ease-out;
    will-change: transform;
  }
  .tour-card[data-tilt]:hover,
  .combo-card[data-tilt]:hover {
    box-shadow:
      7px 10px 0 rgba(0, 0, 0, 0.55),
      7px 10px 36px rgba(0, 0, 0, 0.45);
  }
}

/* ============================================================
   Fase 4 — Transiciones entre páginas (cortina cinematográfica)
   ============================================================ */

/*
   #page-curtain arranca oculto (display:none).
   motion.js lo hace visible SOLO cuando GSAP está listo y lo anima.
   Así, si GSAP no carga o tarda, la página nunca queda negra.
*/
#page-curtain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #111;
  display: none;             /* JS lo activa solo si GSAP está disponible */
  pointer-events: none;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  #page-curtain { display: none; }
}

/* ============================================================
   Guía Insider — Hero dossier
   ============================================================ */
.guide-dossier-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: #0d0d0d;
  padding: clamp(100px, 14vh, 160px) clamp(24px, 10vw, 160px) clamp(60px, 8vh, 100px);
  position: relative;
  overflow: hidden;
}

/* Ruido de fondo sutil */
.guide-dossier-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

.dossier-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.dossier-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-family: "Courier New", Courier, monospace;
  font-size: .78rem;
  letter-spacing: .12em;
}

.dossier-tag {
  color: var(--accent);
  font-weight: 700;
}

.dossier-sep {
  color: rgba(255,255,255,.25);
}

.dossier-date {
  color: rgba(255,255,255,.4);
}

.dossier-title {
  margin: 0 0 22px;
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--white);
  text-transform: uppercase;
}

.dossier-title em {
  font-style: normal;
  color: var(--accent);
  display: block;
  font-size: .72em;
  letter-spacing: -.02em;
  text-transform: none;
}

.dossier-desc {
  max-width: 560px;
  margin: 0 0 40px;
  color: rgba(255,255,255,.55);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.6;
}

.dossier-stats {
  display: flex;
  gap: clamp(28px, 5vw, 60px);
  margin-bottom: 40px;
}

.dossier-stat strong {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -.03em;
}

.dossier-stat span {
  display: block;
  margin-top: 4px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  font-family: "Courier New", Courier, monospace;
}

.dossier-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ============================================================
   Guía Insider — Barra de filtros de categoría
   ============================================================ */
.guide-filter-bar {
  position: sticky;
  top: 62px;         /* justo bajo el header */
  z-index: 50;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(14, 14, 14, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: 0 clamp(16px, 6vw, 80px);
}

.guide-filter-bar::-webkit-scrollbar { display: none; }

.guide-filter-link {
  flex-shrink: 0;
  padding: 14px 18px;
  color: rgba(255,255,255,.45);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .25s var(--motion-ease), border-color .25s var(--motion-ease);
  white-space: nowrap;
}

.guide-filter-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   Guía Insider — Meta en tarjetas de mapa (pins + barrios)
   ============================================================ */
.guide-map-card::before { display: none; }  /* elimina barra amarilla */

.guide-map-card {
  box-shadow: 5px 7px 0 rgba(0,0,0,.50), 5px 7px 28px rgba(0,0,0,.38);
}

.map-card-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  width: 100%;
}

.map-pins {
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent) !important;
}

.map-barrios {
  font-size: .68rem;
  color: rgba(255,255,255,.32) !important;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.4;
  text-align: center;
}

/* ============================================================
   Botón WhatsApp flotante — siempre visible al hacer scroll
   ============================================================ */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9000;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 22px rgba(37, 211, 102, .45), 0 2px 8px rgba(0,0,0,.25);
  transition: transform .3s var(--motion-ease),
              box-shadow .3s var(--motion-ease),
              opacity .3s var(--motion-ease);
  will-change: transform;
}
.wa-float:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 8px 36px rgba(37, 211, 102, .6), 0 4px 12px rgba(0,0,0,.3);
}
.wa-float:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.wa-float svg { display: block; }

/* Se oculta cuando el menú está abierto */
body.menu-open .wa-float { opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  .wa-float { width: 52px; height: 52px; bottom: 20px; right: 16px; }
}
nt-weight: 600;
  letter-spacing: .03em;
  line-height: 1.4;
  text-align: center;
}

/* ============================================================
   Botón WhatsApp flotante — siempre visible al hacer scroll
   ============================================================ */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9000;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 22px rgba(37, 211, 102, .45), 0 2px 8px rgba(0,0,0,.25);
  transition: transform .3s var(--motion-ease),
              box-shadow .3s var(--motion-ease),
              opacity .3s var(--motion-ease);
  will-change: transform;
}
.wa-float:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 8px 36px rgba(37, 211, 102, .6), 0 4px 12px rgba(0,0,0,.3);
}
.wa-float:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.wa-float svg { display: block; }

/* Se oculta cuando el menú está abierto */
body.menu-open .wa-float { opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  .wa-float { width: 52px; height: 52px; bottom: 20px; right: 16px; }
}
 24px;
  z-index: 9000;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 22px rgba(37, 211, 102, .45), 0 2px 8px rgba(0,0,0,.25);
  transition: transform .3s var(--motion-ease),
              box-shadow .3s var(--motion-ease),
              opacity .3s var(--motion-ease);
  will-change: transform;
}
.wa-float:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 8px 36px rgba(37, 211, 102, .6), 0 4px 12px rgba(0,0,0,.3);
}
.wa-float:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.wa-float svg { display: block; }
body.menu-open .wa-float { opacity: 0; pointer-events: none; }
@media (max-width: 560px) {
  .wa-float { width: 52px; height: 52px; bottom: 20px; right: 16px; }
}
  .wa-float { width: 52px; height: 52px; bottom: 20px; right: 16px; }
}
