/* ═══════════════════════════════════════════════════════════
   CAPO'S LUXURY — HEADER CSS
   Versión Premium 2025
   Diseño: Elegancia atemporal inspirado en maison de lujo
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  /* Paleta de lujo */
  --gold: #c9a84c;
  --gold-light: #d4b76a;
  --gold-dark: #a88a3a;
  --gold-muted: rgba(201, 168, 76, 0.15);
  --gold-line: rgba(201, 168, 76, 0.25);

  /* Fondos */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-elevated: #1a1a1a;
  --bg-overlay: rgba(10, 10, 10, 0.95);

  /* Texto */
  --text-primary: #f5f0e8;
  --text-secondary: #9a9590;
  --text-muted: #6b6560;

  /* Bordes */
  --border-subtle: rgba(245, 240, 232, 0.06);
  --border-gold: rgba(201, 168, 76, 0.3);

  /* Tipografía */
  --font-display: var(--font-heading);
  --font-body-css: var(--font-body);
  --font-nav: var(--font-body);

  /* Espaciado */
  --header-height: 80px;
  --topbar-height: 36px;
  --nav-height: 52px;

  /* Transiciones */
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-luxury: cubic-bezier(0.23, 1, 0.32, 1);

  /* Z-index */
  --z-topbar: 1001;
  --z-header: 1000;
  --z-mobile-nav: 999;
  --z-search: 998;
  --z-overlay: 997;
}

/* ── Reset específico para header ── */
.site-header,
.site-header *,
.header-topbar,
.header-topbar * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════
   BARRA SUPERIOR (Topbar) - SIN ESPACIOS
   ═══════════════════════════════════════════════ */
.header-topbar {
  position: relative;
  z-index: var(--z-topbar);
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.topbar-track {
  display: flex;
  align-items: center;
  gap: 48px; /* ← Espacio entre items */
  animation: topbar-scroll 30s linear infinite;
  white-space: nowrap;
  will-change: transform;
}

/* Asegurar que los items no se encojan */
.topbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0; /* ← IMPORTANTE: no encoger */
  white-space: nowrap;
}

.topbar-item span {
  font-family: var(--font-body);
  font-size: var(--fs-tiny);
  font-weight: 400;
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.topbar-item .separator {
  color: var(--gold);
  font-size: 8px;
  opacity: 0.5;
}

/* Animación - Mover 50% porque el contenido está duplicado */
@keyframes topbar-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Pausar al hover */
.header-topbar:hover .topbar-track {
  animation-play-state: paused;
  
}/* ═══════════════════════════════════════════════
   HEADER PRINCIPAL
   ═══════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.4s var(--transition-smooth),
              border-color 0.4s var(--transition-smooth),
              box-shadow 0.4s var(--transition-smooth);
}

/* Header con efecto glass al scroll */
.site-header.is-scrolled {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom-color: var(--border-gold);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

/* ── Header Inner (Logo + Iconos) ── */
.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 32px;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

/* ── Iconos laterales ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-actions--left {
  min-width: 120px;
}

.header-actions--right {
  min-width: 120px;
  justify-content: flex-end;
}

/* Botón de icono */
.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s var(--transition-luxury);
}

.icon-btn:hover {
  background: var(--gold-muted);
  color: var(--gold);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
  transition: stroke 0.3s ease;
}

/* Badge del carrito */
.cart-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--gold);
  color: var(--bg-primary);
  font-family: var(--font-nav);
  font-size: 10px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--transition-luxury),
              background 0.3s ease;
}

.icon-btn:hover .cart-badge {
  transform: scale(1.1);
  background: var(--gold-light);
}

/* ── Logo ── */
.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: opacity 0.3s ease;
}

.brand:hover {
  opacity: 0.85;
}

.brand-logo {
  max-height: 48px;
  width: auto;
  display: block;
  transition: transform 0.4s var(--transition-luxury);
}

.brand:hover .brand-logo {
  transform: scale(1.02);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 6px;
  color: var(--text-primary);
  text-transform: uppercase;
  line-height: 1;
}

.brand-subtitle {
  font-family: var(--font-nav);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
}

/* ═══════════════════════════════════════════════
   NAVEGACIÓN PRINCIPAL (Desktop)
   ═══════════════════════════════════════════════ */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--nav-height);
  border-top: 1px solid var(--border-subtle);
  position: relative;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}

.primary-nav a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 24px;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  white-space: nowrap;
}

/* Línea dorada inferior animada */
.primary-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.4s var(--transition-luxury),
              left 0.4s var(--transition-luxury);
}

.primary-nav a:hover {
  color: var(--text-primary);
}

.primary-nav a:hover::after {
  width: 100%;
  left: 0;
}

/* Link activo */
.primary-nav a.is-active {
  color: var(--gold);
}

.primary-nav a.is-active::after {
  width: 100%;
  left: 0;
  background: var(--gold);
}

/* ── Búsqueda inline (desktop) ── */
.search-inline {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.search-inline input {
  width: 200px;
  height: 36px;
  padding: 0 36px 0 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-family: var(--font-nav);
  font-size: 12px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  transition: all 0.3s var(--transition-luxury);
  outline: none;
}

.search-inline input::placeholder {
  color: var(--text-muted);
}

.search-inline input:focus {
  width: 280px;
  border-color: var(--gold);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px var(--gold-muted);
}

.search-inline .btn-search-inline {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.search-inline .btn-search-inline:hover {
  color: var(--gold);
}

.search-inline .btn-search-inline svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════
   PANEL DE BÚSQUEDA (Overlay) - CORREGIDO
   ═══════════════════════════════════════════════ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999; /* ← CAMBIADO: más alto que el header */
  background: var(--bg-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--transition-smooth),
              visibility 0.4s var(--transition-smooth);
}

.search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Cuando está abierto, forzar display flex */
.search-overlay:not([hidden]) {
  opacity: 1;
  visibility: visible;
  display: flex;
}

.search-overlay-form {
  width: 90%;
  max-width: 700px;
  position: relative;
}

.search-overlay-form input {
  width: 100%;
  height: 60px;
  padding: 0 60px 0 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-gold);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-overlay-form input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.search-overlay-form input:focus {
  border-bottom-color: var(--gold);
}

.search-overlay-form .btn-search-submit {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, color 0.3s ease;
}

.search-overlay-form .btn-search-submit:hover {
  transform: translateY(-50%) scale(1.1);
  color: var(--gold-light);
}

.search-overlay-form .btn-search-submit svg {
  width: 24px;
  height: 24px;
}

.search-overlay-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--transition-luxury);
}

.search-overlay-close:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════
   NAVEGACIÓN MÓVIL (Full-screen)
   ═══════════════════════════════════════════════ */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-mobile-nav);
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  padding: 100px 40px 40px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: opacity 0.5s var(--transition-luxury),
              visibility 0.5s var(--transition-luxury),
              transform 0.5s var(--transition-luxury);
}

.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Botón cerrar menú móvil */
.mobile-nav-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--transition-luxury);
}

.mobile-nav-close:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(90deg);
}

.mobile-nav-close svg {
  width: 20px;
  height: 20px;
}

/* Links del menú móvil */
.mobile-nav a {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  color: var(--text-primary);
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.4s var(--transition-luxury),
              transform 0.4s var(--transition-luxury),
              color 0.3s ease;
}

.mobile-nav.is-open a {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger animation para links */
.mobile-nav.is-open a:nth-child(1) { transition-delay: 0.08s; }
.mobile-nav.is-open a:nth-child(2) { transition-delay: 0.14s; }
.mobile-nav.is-open a:nth-child(3) { transition-delay: 0.20s; }
.mobile-nav.is-open a:nth-child(4) { transition-delay: 0.26s; }
.mobile-nav.is-open a:nth-child(5) { transition-delay: 0.32s; }
.mobile-nav.is-open a:nth-child(6) { transition-delay: 0.38s; }
.mobile-nav.is-open a:nth-child(7) { transition-delay: 0.44s; }

.mobile-nav a:hover {
  color: var(--gold);
  padding-left: 12px;
}

.mobile-nav a svg {
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s var(--transition-luxury);
}

.mobile-nav a:hover svg {
  opacity: 1;
  transform: translateX(0);
}

/* Info extra en menú móvil */
.mobile-nav-footer {
  margin-top: auto;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s 0.5s var(--transition-luxury),
              transform 0.5s 0.5s var(--transition-luxury);
}

.mobile-nav.is-open .mobile-nav-footer {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-footer p {
  font-family: var(--font-nav);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mobile-nav-footer .gold-line {
  width: 40px;
  height: 1px;
  background: var(--gold);
}

/* ═══════════════════════════════════════════════
   UTILIDADES
   ═══════════════════════════════════════════════ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Prevenir scroll cuando overlays están abiertos */
body.is-nav-open,
body.is-search-open {
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   AGREGA ESTO AL FINAL DE TU CSS (antes de responsive)
   ═══════════════════════════════════════════════ */

/* Ocultar hamburguesa en desktop (PC) */
@media (min-width: 769px) {
  #menu-toggle {
    display: none !important;
  }
}

/* Mostrar hamburguesa solo en móvil */
@media (max-width: 768px) {
  #menu-toggle {
    display: flex !important;
  }
  
  .header-actions--left {
    min-width: 80px;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

/* ── Desktop grande ── */
@media (min-width: 1400px) {
  .header-main {
    padding: 0 48px;
  }

  .primary-nav a {
    padding: 0 32px;
    font-size: 12px;
  }
}

/* ── Tablet ── */
@media (max-width: 1024px) {
  :root {
    --header-height: 68px;
  }

  .header-main {
    padding: 0 20px;
  }

  .brand-text {
    font-size: 24px;
    letter-spacing: 4px;
  }

  .primary-nav a {
    padding: 0 16px;
    font-size: 11px;
  }

  .search-inline {
    display: none;
  }
}

/* ── Móvil ── */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --topbar-height: 32px;
  }

  .header-topbar {
    display: none;
  }

  .header-main {
    padding: 0 16px;
    height: var(--header-height);
  }

  /* Logo más pequeño en móvil */
  .brand-logo {
    max-height: 36px;
  }

  .brand-text {
    font-size: 20px;
    letter-spacing: 4px;
  }

  .brand-subtitle {
    font-size: 7px;
    letter-spacing: 2px;
  }

  /* Ocultar navegación desktop */
  .nav-row {
    display: none;
  }

  /* Header sin borde inferior en móvil */
  .site-header {
    border-bottom: 1px solid var(--border-subtle);
  }

  /* Iconos más compactos */
  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .icon-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Ajustar menú móvil */
  .mobile-nav {
    padding: 80px 24px 32px;
  }

  .mobile-nav a {
    font-size: 22px;
    padding: 14px 0;
  }

  /* Badge más pequeño */
  .cart-badge {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    top: 2px;
    right: 0;
  }
}

/* ── Móvil pequeño ── */
@media (max-width: 380px) {
  .brand-text {
    font-size: 18px;
    letter-spacing: 3px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }
}

/* ═══════════════════════════════════════════════
   ANIMACIONES ADICIONALES
   ═══════════════════════════════════════════════ */

/* Efecto shimmer en topbar */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Entrada suave del header al cargar */
@keyframes header-enter {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header {
  animation: header-enter 0.6s var(--transition-luxury) forwards;
}

/* Pulse sutil en el badge cuando hay items */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.cart-badge.has-items {
  animation: badge-pulse 2s ease-in-out infinite;
}

/* Hover effect para botón menú (líneas animadas) */
#menu-toggle .menu-line {
  transition: all 0.3s var(--transition-luxury);
  transform-origin: center;
}

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

#menu-toggle.is-active .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#menu-toggle.is-active .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.header-topbar {
  position: relative;
  z-index: var(--z-topbar);
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden; /* ← ESTO ES IMPORTANTE */
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-track {
  display: flex;
  align-items: center;
  gap: 32px;
  animation: topbar-scroll 24s linear infinite;
  white-space: nowrap; /* ← ESTO TAMBIÉN */
  will-change: transform; /* ← Y ESTO */
}

@keyframes topbar-scroll {
  0% { 
    transform: translateX(0); 
  }
  100% { 
    transform: translateX(-50%); 
  }
}

/* Pausar animación al hover */
.header-topbar:hover .topbar-track {
  animation-play-state: paused;
}

