/* ==========================================================
   VARIABLES
========================================================== */
:root {
  --bg: #04060f;
  --bg2: #080d1c;
  --bg3: #0c1225;
  --card: #0e1530;
  --border: #1a2545;
  --cyan: #00e5ff;
  --cyan2: #00b8d9;
  --lime: #a8ff3e;
  --text: #e8edf8;
  --muted: #7a8aaa;
  --accent: #ff4d6d;
  --gold: #ffc947;
  --radius: 12px;
  --radius-lg: 20px;
}

/* ==========================================================
   NAVBAR
========================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.nav.scrolled {
  background: rgba(4, 6, 15, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(0, 229, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 70px;
  /* ✅ Garantiza que el nav siempre ocupe el 100% del ancho */
  width: 100%;
  box-sizing: border-box;
  transition: height 0.3s ease;
}

.nav.scrolled .nav-inner {
  height: 62px;
}

/* ── Logo ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  /* ✅ Evita que el logo crezca y desplace la hamburguesa */
  flex: 0 0 auto;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan2), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nav-logo:hover .logo-icon {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.55);
}

.logo-text {
  font-family: 'Poiret One', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-text span {
  color: var(--cyan);
}

/* ── Links desktop ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links > li {
  position: relative;
}

.nav-links > li::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
}

.nav-links > li > a,
.nav-links > li > button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-links > li > button:hover {
  color: var(--text);
  background: rgba(26, 37, 69, 0.8);
}

.nav-links > li > a.active {
  color: var(--cyan);
}

/* ── Flecha dropdown ── */
.arrow {
  width: 14px;
  height: 14px;
  opacity: 0.55;
  transition: transform 0.25s ease, opacity 0.2s;
  flex-shrink: 0;
}

.nav-links > li.open > button .arrow,
.nav-links > li:hover > button .arrow {
  transform: rotate(180deg);
  opacity: 0.9;
}

/* ── Dropdown ── */
.dropdown {
  position: absolute;
  top: 100%;
  margin-top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 240px;
  background: rgba(0, 3, 60, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 229, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: rgba(0, 3, 60, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  transform: translateX(-50%) rotate(45deg);
}

.nav-links > li:hover .dropdown,
.nav-links > li.open .dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  font-weight: 400;
  transition: background 0.18s, color 0.18s;
}

.dropdown-item:hover {
  background: rgba(0, 229, 255, 0.1);
  color: var(--text);
}

.dropdown-item:hover .di-icon {
  background: rgba(0, 229, 255, 0.25);
}

.di-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(0, 229, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background 0.18s;
}

.di-text strong {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 2px;
}

.di-text span {
  font-size: 0.74rem;
  color: var(--muted);
}

.dropdown-divider {
  height: 1px;
  background: rgba(0, 229, 255, 0.05);
  margin: 6px 8px;
}

/* ── CTA nav ── */
.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-nav-ghost {
  padding: 8px 18px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-nav-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.btn-nav-primary {
  padding: 9px 22px;
  border-radius: 10px;
  font-family: 'Poiret One', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--cyan2));
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.35);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-nav-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
  border-radius: inherit;
}

.btn-nav-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 229, 255, 0.5);
}

/* ── Botón carrito ── */
.nav-cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.18);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
  margin-left: 10px;
}

.nav-cart-btn:hover {
  color: var(--text);
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
}

.nav-cart-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

.cart-text {
  display: inline-block;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan2));
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 229, 255, 0.4);
}

/* ── Hamburguesa ── */
.hamburger {
  /* Por defecto oculto en desktop */
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* Tamaño fijo inamovible */
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  gap: 5px;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
  flex-grow: 0;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  pointer-events: none;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================
   MENÚ MÓVIL (drawer)
========================================================== */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 999;
  padding: 90px 24px 40px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Cuenta + Carrito */
.mobile-user-block {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.mobile-btn-account,
.mobile-btn-cart {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border-radius: 14px;
  font-family: 'Poiret One', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative;
}

.mobile-btn-account {
  background: linear-gradient(135deg, var(--cyan), var(--cyan2));
  color: var(--bg);
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.35);
}

.mobile-btn-account:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 229, 255, 0.5);
}

.mobile-btn-cart {
  background: rgba(0, 229, 255, 0.07);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.25);
}

.mobile-btn-cart:hover {
  background: rgba(0, 229, 255, 0.14);
  border-color: var(--cyan);
}

.mobile-cart-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Links móvil */
.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 229, 255, 0.05);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.mobile-link:hover,
.mobile-link-trigger.active-sub {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.2);
  color: var(--text);
}

.mobile-submenu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 4px 12px;
}

.mobile-submenu.open {
  display: flex;
}

.mobile-submenu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.mobile-submenu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.mobile-divider {
  height: 1px;
  background: rgba(26, 37, 69, 0.8);
  margin: 6px 0;
}

/* ==========================================================
   RESPONSIVE — breakpoint único 980px
   ✅ FIX PRINCIPAL: !important en TODOS los valores críticos
   para blindar contra cualquier CSS de página que cargue después.
========================================================== */
@media (max-width: 1100px) {
  .cart-text { display: none; }
  .nav-cart-btn { padding: 8px 12px; margin-left: 6px; }
}

@media (max-width: 980px) {
  /* Ocultar elementos desktop */
  .nav-links,
  .nav-cta {
    display: none !important;
  }

  /* Carrito visible en navbar móvil — solo ícono */
  .nav-cart-btn {
    display: flex !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    padding: 8px 10px !important;
    margin-left: 0 !important;
  }
  .cart-text {
    display: none !important;
  }

  /* ✅ Hamburguesa: tamaño fijo blindado con !important en cada propiedad
     para que ningún CSS externo pueda colapsarla o expandirla */
  .hamburger {
    display: flex !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }

  /* ✅ Nav-inner ocupa TODO el ancho, logo a la izq, hamburguesa a la der */
  .nav-inner {
    position: relative !important;
    width: 100% !important;
    padding: 0 20px !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  /* ✅ Logo crece para empujar carrito + hamburguesa a la derecha */
  .nav-logo {
    flex: 1 !important;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    padding: 0 16px !important;
  }
  .logo-text {
    font-size: 1rem;
  }
}