/* ===========================
   NAVBAR — LABRIEGO
   =========================== */

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 68px;
  background: rgba(6, 6, 6, 0.62);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.042);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  z-index: 1000;
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

#navbar.scrolled {
  background: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(32px) saturate(1.6);
  -webkit-backdrop-filter: blur(32px) saturate(1.6);
  border-bottom-color: rgba(255, 255, 255, 0.032);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 6px 28px rgba(0, 0, 0, 0.22);
}

/* ── Layout: 3 columnas ─────────────────────────────────── */
.nav-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  gap: 20px;
}

/* ── Separador vertical ─────────────────────────────────── */
.nav-sep {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.065);
  flex-shrink: 0;
  margin: 0 10px;
  align-self: center;
}

/* ═══════════════════════════════════════
   LEFT — Logo + redes sociales
════════════════════════════════════════ */
.nav-left {
  display: flex;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 5px;
  color: #e0e0e0;
  text-decoration: none;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.nav-logo:hover {
  opacity: 0.55;
}

.nav-logo-img {
  height: 26px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.48);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  border-radius: 7px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-icon:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.12);
}

/* ═══════════════════════════════════════
   CENTER — Tienda + buscador
════════════════════════════════════════ */
.nav-center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--coral);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  color: var(--white);
}

.nav-link:hover::after {
  width: 100%;
}

/* Barra de búsqueda */
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f5f3;
  border: 1px solid rgba(0, 0, 0, 0.065);
  border-radius: 8px;
  padding: 7px 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
  max-width: 210px;
  min-width: 120px;
}

.nav-search:focus-within {
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.038), 0 1px 3px rgba(0, 0, 0, 0.055);
}

.nav-search-icon {
  color: rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
  display: block;
  transition: color 0.2s ease;
}

.nav-search:focus-within .nav-search-icon {
  color: rgba(0, 0, 0, 0.72);
}

.nav-search-input {
  background: none;
  border: none;
  outline: none;
  color: rgba(0, 0, 0, 0.85);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  width: 100%;
  min-width: 0;
  font-family: inherit;
}

.nav-search-input::placeholder {
  color: rgba(0, 0, 0, 0.52);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.8px;
}

/* Ocultar el botón X nativo de input[type=search] */
.nav-search-input::-webkit-search-cancel-button {
  display: none;
}

/* ═══════════════════════════════════════
   RIGHT — Mayoreo + carrito
════════════════════════════════════════ */
.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

/* Bloque "Ventas al por mayor" */
.nav-mayoreo {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid rgba(0, 0, 0, 0.065);
  border-radius: 8px;
  text-decoration: none;
  background: #f7f5f3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-mayoreo:hover {
  background: #f1efec;
  border-color: rgba(0, 0, 0, 0.11);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}

.nav-mayoreo-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.42);
  line-height: 1;
  margin-bottom: 4px;
  white-space: nowrap;
}

.nav-mayoreo-number {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.88);
  letter-spacing: 0.3px;
  line-height: 1;
  white-space: nowrap;
}

/* Carrito */
.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-cart:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.nav-cart svg {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.nav-cart:hover svg {
  transform: rotate(-8deg) translateY(-1px) scale(1.05);
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--coral);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ── Hamburguesa (solo mobile) ──────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.nav-hamburger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--white);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ═══════════════════════════════════════
   MENÚ MOBILE
════════════════════════════════════════ */
.nav-mobile-menu {
  position: fixed;
  top: 68px;
  left: 0;
  width: 100%;
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  max-height: 0;
  overflow: hidden;
  z-index: 999;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-mobile-menu.open {
  max-height: 440px;
}

.nav-mobile-links {
  list-style: none;
  padding: 8px 0 0;
}

.nav-mobile-link {
  display: block;
  padding: 15px 24px;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.58);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.2s ease, padding-left 0.2s ease, background 0.2s ease;
}

.nav-mobile-link:hover {
  color: var(--white);
  padding-left: 32px;
  background: rgba(255, 255, 255, 0.03);
}

/* Zona inferior del menú mobile: buscador + redes */
.nav-mobile-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px 20px;
}

.nav-mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 9px 13px;
  color: rgba(255, 255, 255, 0.28);
}

.nav-mobile-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

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

/* Tablet: ocultar bloque mayoreo para ganar espacio */
@media (max-width: 960px) {
  .nav-mayoreo {
    display: none;
  }

  .nav-sep--right {
    display: none;
  }

  .nav-search {
    max-width: 160px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-container {
    grid-template-columns: 1fr auto;
    padding: 0 20px;
    gap: 0;
  }

  .nav-center {
    display: none;
  }

  .nav-social {
    display: none;
  }

  .nav-sep {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-logo {
    font-size: 12px;
    letter-spacing: 4px;
    gap: 7px;
  }

  .nav-logo-img {
    height: 22px;
  }

  .nav-mobile-link {
    padding: 15px 20px;
  }

  .nav-mobile-link:hover {
    padding-left: 28px;
  }

  .nav-mobile-bottom {
    padding: 14px 20px 20px;
  }
}

/* ═══════════════════════════════════════
   SEARCH DROPDOWN
════════════════════════════════════════ */

.nav-search,
.nav-mobile-search {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  background: rgba(9, 9, 9, 0.97);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.45);
  z-index: 1100;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.18s ease;
}

.search-dropdown.open {
  max-height: 420px;
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: alinear al borde izquierdo del wrapper */
.nav-mobile-search .search-dropdown {
  left: 0;
  right: 0;
  transform: none;
  width: auto;
  min-width: 0;
}

/* ── Sugerencia individual ── */
.sd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.13s ease;
  text-decoration: none;
}

.sd-item:last-of-type {
  border-bottom: none;
}

.sd-item.active,
.sd-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Miniatura */
.sd-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background-color: #111116;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Info del producto */
.sd-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sd-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

.sd-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  letter-spacing: 0.6px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

.sd-cat {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
}

.sd-dot {
  color: rgba(255, 255, 255, 0.18);
}

.sd-tipo {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.30);
  text-transform: capitalize;
}

/* Precio */
.sd-price {
  font-size: 11.5px;
  font-weight: 700;
  color: #E8593C;
  letter-spacing: -0.2px;
  flex-shrink: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

/* Footer "Ver todos los resultados" */
.sd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.3px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  transition: color 0.15s ease, background 0.15s ease;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

.sd-footer:hover {
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.04);
}

.sd-footer em {
  font-style: normal;
  color: #E8593C;
}

/* ── Highlight de término buscado ── */
.search-hl {
  background: none;
  color: #E8593C;
  font-weight: 700;
  padding: 0;
  font-style: normal;
}
