/**
 * templates/child-theme-base/css/header-style.css — Wizard-System v0.7.0
 *
 * Estilos del header wizard. Scope contextual: body .wizard-site-header.
 * Carga después de style.css (depende de wizard-child-css).
 *
 * Clases emitidas por inc/partials/header.php:
 *   .wizard-site-header, .wizard-site-header-inner
 *   .wizard-site-logo-link, .wizard-logo, .wizard-logo-text
 *   .wizard-site-nav, .wizard-nav-items, .wizard-nav-item
 *   .wizard-nav-has-submenu, .wizard-nav-submenu-toggle, .wizard-nav-submenu
 *   .wizard-nav-extra, .wizard-nav-cart, .wizard-cart-label, .wizard-cart-count
 *   .wizard-nav-account
 */


/* ===========================================================================
   HEADER CONTENEDOR
   =========================================================================== */

body .wizard-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg, #FFFFFF);
  border-bottom: 1px solid var(--color-border, #E5E5E5);
  padding: 0;
}

body .wizard-site-header-inner {
  max-width: var(--container-max-width, var(--layout-max-width, 1280px));
  margin: 0 auto;
  padding: 16px clamp(1rem, 3vw, var(--section-px, 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-height, 64px);
}


/* ===========================================================================
   LOGO
   =========================================================================== */

body .wizard-site-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  flex-shrink: 0;
  line-height: 1;
  color: var(--color-ink, #0D1B2A) !important;
}

body .wizard-site-logo-link:hover {
  opacity: 0.85;
}

body .wizard-site-header .wizard-logo {
  display: block;
  height: var(--logo-header-height, 36px);
  max-height: 36px;
  width: auto;
}

@media (min-width: 1024px) {
  body .wizard-site-header .wizard-logo {
    height: 56px;
    max-height: 56px;
  }
}

body .wizard-logo-text {
  font-family: var(--font-headings, serif) !important;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-ink, #0D1B2A);
}


/* ===========================================================================
   NAVEGACIÓN DESKTOP
   =========================================================================== */

body .wizard-site-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

body .wizard-nav-items {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

body .wizard-nav-item {
  position: relative;
  margin: 0;
  list-style: none;
}

body .wizard-nav-item > a,
body .wizard-nav-item > button,
body .wizard-nav-submenu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 8px 0;
  margin: 0 calc(var(--space-sm, 16px) / 2);
  color: var(--color-ink, #1A1A1A) !important;
  text-decoration: none;
  font-weight: var(--font-weight-heading-light, 500);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0;
  transition: color 0.2s ease;
  font-family: var(--font-headings, system-ui) !important;
  position: relative;
}

body .wizard-nav-item > a:hover,
body .wizard-nav-item > a:focus-visible,
body .wizard-nav-submenu-toggle:hover,
body .wizard-nav-submenu-toggle:focus-visible {
  color: var(--color-accent, #E94B3C) !important;
  background: transparent;
}

/* Subrayado coral en hover */
body .wizard-nav-item > a::after,
body .wizard-nav-submenu-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent, #E94B3C);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
body .wizard-nav-item > a:hover::after,
body .wizard-nav-item > a:focus-visible::after,
body .wizard-nav-submenu-toggle:hover::after {
  transform: scaleX(1);
}

/* Indicador de item activo */
body .wizard-nav-item.current-menu-item > a,
body .wizard-nav-item.current-page-ancestor > a {
  color: var(--color-accent, #E94B3C) !important;
}
body .wizard-nav-item.current-menu-item > a::after,
body .wizard-nav-item.current-page-ancestor > a::after {
  transform: scaleX(1);
}


/* ===========================================================================
   SUBMENÚ
   =========================================================================== */

body .wizard-nav-submenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.09);
  border-radius: var(--card-radius, 10px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.09);
  padding: 0.4rem;
  min-width: 190px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 110;
}

body .wizard-nav-has-submenu:hover > .wizard-nav-submenu,
body .wizard-nav-has-submenu:focus-within > .wizard-nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body .wizard-nav-submenu li {
  list-style: none;
  margin: 0;
}

body .wizard-nav-submenu li a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--color-ink, #0D1B2A) !important;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: calc(var(--card-radius, 10px) - 4px);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

body .wizard-nav-submenu li a:hover {
  background: rgba(0,0,0,0.04);
  color: var(--color-accent, #E94B3C) !important;
}


/* ===========================================================================
   EXTRAS (cart, account)
   =========================================================================== */

body .wizard-nav-extra {
  list-style: none;
  margin: 0;
}

body .wizard-nav-cart > a,
body .wizard-nav-account > a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: rgba(0,0,0,0.04);
  color: var(--color-ink, #0D1B2A) !important;
  border-radius: var(--input-radius, 6px);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease;
}

body .wizard-nav-cart > a:hover,
body .wizard-nav-account > a:hover {
  background: var(--color-accent, #E94B3C);
  color: #fff !important;
}

body .wizard-cart-count {
  font-weight: 700;
  font-size: 0.8rem;
}


/* ===========================================================================
   STICKY (preparado para JS — clase .is-sticky vía JS futuro)
   =========================================================================== */

body .wizard-site-header.is-sticky {
  position: fixed;
  top: 0; left: 0; right: 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}


/* ===========================================================================
   RESPONSIVO MÓVIL (<1024px) — nav oculta, hamburguesa visible
   =========================================================================== */

@media (max-width: 1023px) {
  body .wizard-site-nav {
    display: none;
  }
}


/* ===========================================================================
   HAMBURGUESA
   =========================================================================== */

body .wizard-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  gap: 5px;
  flex-shrink: 0;
}

@media (max-width: 1023px) {
  body .wizard-mobile-toggle {
    display: flex;
  }
}

body .wizard-mobile-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-primary, #1A1A1A);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}


/* ===========================================================================
   OVERLAY + MENÚ DESLIZANTE MOBILE
   =========================================================================== */

body .wizard-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 998;
}

body .wizard-mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

body .wizard-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background: var(--color-bg, #FFFFFF);
  padding: calc(var(--space-xl, 64px) + 12px) var(--space-md, 24px) var(--space-md, 24px);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 999;
  overflow-y: auto;
}

body .wizard-mobile-menu.is-open {
  transform: translateX(0);
}

body .wizard-mobile-menu__close {
  position: absolute;
  top: var(--space-md, 24px);
  right: var(--space-md, 24px);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  color: var(--color-primary, #1A1A1A);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body .wizard-mobile-menu__close svg {
  width: 100%;
  height: 100%;
}

body .wizard-mobile-menu__nav .wizard-nav-items {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0;
}

body .wizard-mobile-menu__nav .wizard-nav-item {
  border-bottom: 1px solid var(--color-border, #E5E5E5);
  margin: 0;
}

body .wizard-mobile-menu__nav .wizard-nav-item > a {
  display: block;
  padding: var(--space-sm, 16px) 0;
  color: var(--color-ink, #1A1A1A) !important;
  font-family: var(--font-headings, system-ui) !important;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}

body .wizard-mobile-menu__nav .wizard-nav-item > a:hover,
body .wizard-mobile-menu__nav .current-menu-item > a {
  color: var(--color-accent, #E94B3C) !important;
}

body.has-mobile-menu-open {
  overflow: hidden;
}
