/**
 * WActivity CMS Shell - Navigation Styles
 * Port of D7 responsive-menu.js visual behavior
 */

/* ===== Header Container ===== */
.wactivity-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wactivity-nav {
  width: 100%;
}

/* ===== Al bajar (NavigationConfig.onScroll, PS-CABEC4) =====
   fixed  = siempre visible (lo de arriba).
   static = se va con la página: ocupa su sitio arriba y sube con el contenido.
   reveal = shell.js la esconde al bajar y la enseña al subir moviendo `top`
            (no transform: haría que el menú del móvil, position:fixed, dejara
            de ir pegado a la pantalla). */
.wactivity-header[data-on-scroll="static"] {
  position: absolute;
}
.wactivity-header[data-on-scroll="reveal"] {
  transition: top 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

/* ===== Cabecera sobre la portada (NavigationConfig.overHero) =====
   El render sólo pone .is-over-hero si la página empieza con una portada de
   borde a borde; shell.js añade .is-scrolled al bajar y vuelve opaca. Texto
   claro con un degradado oscuro detrás para que siempre se lea. */
.wactivity-header.is-over-hero {
  transition: background-color 0.25s ease, box-shadow 0.25s ease, top 0.25s ease;
}
.wactivity-header.is-over-hero:not(.is-scrolled) {
  background: transparent !important;
  box-shadow: none;
}
.wactivity-header.is-over-hero:not(.is-scrolled)::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 150%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
  pointer-events: none;
  z-index: -1;
}
.wactivity-header.is-over-hero:not(.is-scrolled) .nav-container .nav-item:not(.nav-item--hl),
.wactivity-header.is-over-hero:not(.is-scrolled) .nav-container .nav-logo-text,
.wactivity-header.is-over-hero:not(.is-scrolled) .nav-container .language-toggle {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.wactivity-header.is-over-hero:not(.is-scrolled) .nav-container .language-toggle {
  border-color: rgba(255, 255, 255, 0.85);
}
.wactivity-header.is-over-hero:not(.is-scrolled) .mobile-menu-toggle span {
  background: #fff;
}
/* Dentro de los desplegables («Más», idiomas) vuelve el color de la cabecera. */
.wactivity-header.is-over-hero:not(.is-scrolled) .more-dropdown-menu .nav-item:not(.nav-item--hl),
.wactivity-header.is-over-hero:not(.is-scrolled) .language-dropdown .language-option {
  color: var(--wa-header-fg, #333);
  text-shadow: none;
}
/* Logo: el de fondo oscuro si lo hay; si no, el normal en una pastilla clara. */
.wactivity-header .nav-logo-ondark {
  display: none;
}
.wactivity-header.is-over-hero.has-logo-ondark:not(.is-scrolled) .nav-container .nav-logo-ondark {
  display: block;
}
.wactivity-header.is-over-hero.has-logo-ondark:not(.is-scrolled) .nav-container .nav-logo-img,
.wactivity-header.is-over-hero.has-logo-ondark:not(.is-scrolled) .nav-container picture {
  display: none;
}
.wactivity-header.is-over-hero:not(.has-logo-ondark):not(.is-scrolled) .nav-container .nav-logo-link:not(.nav-logo-text) {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  /* La pastilla no agranda la cabecera: el margen negativo compensa el relleno. */
  padding: 4px 10px;
  margin: -4px -10px;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

/* ===== Centered Logo Layout ===== */
.wactivity-nav.centered-logo .nav-container {
  position: relative;
}

.wactivity-nav.centered-logo .left-nav {
  flex: 1;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: flex-end;
  padding-right: 2rem;
}

.wactivity-nav.centered-logo .right-nav {
  flex: 1;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: flex-start;
  padding-left: 2rem;
}

.wactivity-nav.centered-logo .logo-center {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* ===== Left Logo Layout ===== */
/* Sin logo: el menú empieza a la izquierda. */
.wactivity-nav.left-logo.no-logo .nav-items-desktop {
  margin-left: 0;
}

.wactivity-nav.left-logo .nav-logo-link {
  display: flex;
  align-items: center;
}

.wactivity-nav.left-logo .nav-items-desktop {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-left: auto;
  margin-right: 2rem;
}

/* ===== Navigation Items ===== */
.nav-item {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--primary-color, #d32f2f);
}

/* Icono o emoji delante del texto (PS-NAVES). */
.nav-item-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.15em;
  margin-right: 0.35em;
  line-height: 1;
}
.nav-item-icon svg { width: 1.1em; height: 1.1em; }
.nav-item-icon .wa-emoji { font-size: 1.05em; }

/* Destacado puntual (Navidad en rojo): color del texto o píldora. Gana al
   color de la cabecera (.wactivity-header .nav-item).
   Sólo color: el peso de la letra no cambia (Pedro 7-oct). */
.wactivity-header .nav-item.nav-item--hl,
.nav-item.nav-item--hl { color: var(--nav-hl); }
.wactivity-header .nav-item.nav-item--hl:hover { color: var(--nav-hl); opacity: 0.85; }
.wactivity-header .nav-item.nav-item--pill {
  background: var(--nav-hl);
  color: var(--nav-hl-ink, #fff);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}
.wactivity-header .nav-item.nav-item--pill:hover { color: var(--nav-hl-ink, #fff); }
/* En el «Más» y en el menú del móvil la píldora queda en color de texto. */
.wactivity-header .more-dropdown-menu .nav-item.nav-item--pill,
.wactivity-header .mobile-menu-items .nav-item.nav-item--pill {
  background: none;
  color: var(--nav-hl);
  border-radius: 0;
}
.wactivity-header .more-dropdown-menu .nav-item.nav-item--pill { padding: 0.75rem 1.5rem; }
.wactivity-header .mobile-menu-items .nav-item.nav-item--pill { padding: 1rem 1.5rem; }
.wactivity-header .mobile-menu-items .nav-item.nav-item--hl { color: var(--nav-hl); }

/* Hidden container (source for responsive script) */
.menu-items-container {
  display: none !important;
}

/* Responsive-hidden items */
.nav-item.responsive-hidden {
  display: none !important;
}

/* ===== More Dropdown ===== */
.responsive-more {
  position: relative;
  display: none;
}

.responsive-more span {
  cursor: pointer;
}

.more-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  min-width: 200px;
  padding: 0.5rem 0;
  display: none;
  z-index: 100;
  /* Clip the full-width hover rows to the rounded corners (first/last item). */
  overflow: hidden;
}

/* Transparent hover bridge. The 0.5rem margin-top above leaves a dead gap
   between the "More" button and the dropdown; moving the cursor across it
   drops :hover and closes the menu before it can be reached. This invisible
   strip spans that gap (right-aligned to match the menu) so hover stays
   continuous from button to menu. */
.responsive-more::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  min-width: 200px;
  height: 0.6rem;
}

.responsive-more:hover .more-dropdown-menu,
.more-dropdown-menu:hover {
  display: block;
}

/* Nav "Mi reserva" CTA — a plain link styled like any nav item that forwards
   to Mirai's booking modal via shell.js (the live Mirai component lives hidden
   in .wa-booking-cta-host; it can't sit in the cloned nav). */
.wa-booking-cta {
  cursor: pointer;
}

.more-dropdown-menu .nav-item {
  display: block;
  padding: 0.75rem 1.5rem;
  width: 100%;
  /* No global border-box reset here — without this, width:100% + horizontal
     padding overflows the panel and the hover row bleeds past the right edge. */
  box-sizing: border-box;
}

.more-dropdown-menu .nav-item:hover {
  background: #f5f5f5;
}

/* ===== Logo Styles ===== */
.nav-logo-video,
.nav-logo-link img,
.logo-center img,
.logo-center video {
  width: auto;
  display: block;
  /* Height controlled by inline style from NavigationConfig.logoHeight */
}

/* Logo por defecto: círculo con las iniciales (web sin logo, PS-SCHEM). */
.nav-logo-monogram {
  display: block;
  flex-shrink: 0;
}

/* ===== Nav Actions (hamburger + language selector group) ===== */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Desktop centered-logo: nav-actions after right-nav */
.wactivity-nav.centered-logo .nav-actions {
  flex: 0 0 auto;
  z-index: 10;
  margin-left: 1rem;
}

/* ===== Mobile Menu Toggle ===== */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

/* forceHamburger: always show hamburger + hide inline nav at any viewport.
   Opt-in per-site via NavigationConfig.forceHamburger → data attribute
   on the header. Used by minimal-header creatives (wedding microsites,
   single-page event landings) where the couple/brand wants a sandwich
   menu regardless of width. */
.wactivity-header[data-force-hamburger="true"] .mobile-menu-toggle {
  display: flex !important;
}
.wactivity-header[data-force-hamburger="true"] .nav-items-desktop,
.wactivity-header[data-force-hamburger="true"] .left-nav,
.wactivity-header[data-force-hamburger="true"] .right-nav,
.wactivity-header[data-force-hamburger="true"] .menu-items-container,
.wactivity-header[data-force-hamburger="true"] .responsive-more {
  display: none !important;
}

/* Disabled nav item — shown in the menu but not clickable. Used for
   "announce-but-not-live" entries (e.g. a wedding's preboda before its
   page is ready). */
.nav-item.nav-item-disabled,
span.nav-item-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: #333;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== Language Selector ===== */
.language-selector {
  position: relative;
}

.language-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #999;
  background: transparent;
  color: #333;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: lowercase;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
}

.language-toggle:hover {
  border-color: var(--primary-color, #d32f2f);
  color: var(--primary-color, #d32f2f);
}

.language-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  /* Right-anchored: the language toggle always sits at the far right of the
     nav, so a left-anchored panel would open off-screen and clip. */
  right: 0;
  left: auto;
  margin-top: 0.5rem;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  min-width: 120px;
  padding: 0.5rem 0;
  z-index: 100;
}

.language-dropdown.open {
  display: block;
}

.language-option {
  display: block;
  padding: 0.5rem 1rem;
  color: #333;
  text-decoration: none;
  font-size: 0.875rem;
}

.language-option:hover {
  background: #f5f5f5;
}

.language-option.active {
  font-weight: 600;
  color: var(--primary-color, #d32f2f);
}

/* ===== Mobile Sidebar (slides from LEFT) ===== */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  right: auto;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  transition: left 0.3s ease;
  z-index: 1002;
  overflow-y: auto;
}

.mobile-menu.open {
  left: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.mobile-logo {
  max-height: 50px;
}

.mobile-logo img,
.mobile-logo video {
  max-height: 50px;
  width: auto;
}

.mobile-menu-close {
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  color: #666;
}

.mobile-menu-items {
  padding: 1rem 0;
}

.mobile-menu-items .nav-item {
  display: block;
  padding: 1rem 1.5rem;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #f5f5f5;
}

.mobile-menu-items .nav-item:hover {
  background: #f9f9f9;
  color: var(--primary-color, #d32f2f);
}

/* Mobile overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1001;
  display: none;
}

.mobile-menu-overlay.active {
  display: block;
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 768px) {
  /* Hide desktop navigation */
  .wactivity-nav.centered-logo .left-nav,
  .wactivity-nav.centered-logo .right-nav,
  .wactivity-nav.left-logo .nav-items-desktop,
  .responsive-more {
    display: none !important;
  }

  /* Show mobile toggle */
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-container {
    justify-content: space-between;
    min-height: 60px;
    padding: 0 1rem;
  }

  /* Mobile centered-logo: hamburger LEFT, logo RIGHT */
  .wactivity-nav.centered-logo .nav-container {
    justify-content: space-between;
  }

  /* Logo en el centro también en el móvil: la hamburguesa (y los idiomas)
     a la izquierda y el logo centrado. Antes se iba a la derecha. */
  .wactivity-nav.centered-logo .nav-container {
    min-height: calc(var(--logo-h-mobile, 40px) + 20px);
  }

  .wactivity-nav.centered-logo .logo-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .wactivity-nav.centered-logo .nav-actions {
    position: static;
    order: 1;
    margin-left: 0;
  }

  /* Altura del logo en el móvil: NavigationConfig.logoMobileHeight
     (--logo-h-mobile, lo pone el render). */
  .logo-center img,
  .logo-center video,
  .nav-logo-link img,
  .nav-logo-link video {
    max-height: var(--logo-h-mobile, 40px);
  }
  .nav-logo-link .nav-logo-monogram {
    width: var(--logo-h-mobile, 40px);
    height: var(--logo-h-mobile, 40px);
  }
}

@media (min-width: 769px) {
  /* Hide mobile menu on desktop */
  .mobile-menu,
  .mobile-menu-overlay {
    display: none !important;
  }

  /* …unless the header is in force-hamburger mode (minimalist creatives
     that want the sandwich at every viewport — wedding microsites etc).
     Higher specificity than the generic rule above so it wins. */
  .wactivity-header[data-force-hamburger="true"] .mobile-menu {
    display: block !important;
  }
}

/* ===== Utility Classes ===== */
.responsive-active .responsive-more {
  display: block !important;
}

/* Push content down to account for the fixed header so it never overlaps
   page content. Padding lives on `#main-content` rather than `body` so
   the offset travels with the actual content area — full-bleed blocks
   that escape the body via `100vw + -50vw` (the FULL_BLEED hack) still
   sit below the fixed nav because they're inside main-content's flow.
   The offset is also exposed as a CSS var so blocks with viewport-height
   sizing (e.g. a 100vh cover) can subtract it from their target height. */
:root {
  --shell-nav-offset: 80px;
}
#main-content {
  padding-top: var(--shell-nav-offset);
}

@media (max-width: 768px) {
  :root {
    --shell-nav-offset: 60px;
  }
}
