/* ==========================================================================
   HEADER CSS - MÁS VENDING (CORPORATE FOOD BUSINESS SOLUTIONS)
   Diseño Limpio, Elegante, Uniforme, Sin Subrayados y Tipografía Unificada
   (Montserrat para Títulos/Categorías, Inter para Navegación/UI)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Montserrat:wght@500;600;700;800;900&display=swap');

:root {
  --font-heading: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --topbar-height: 42px;
  --main-header-height: 78px;
  --total-header-height: 120px;
}

/* Reset Universal para Header y Elementos de Navegación */
.site-header,
.site-header * {
  box-sizing: border-box;
  font-family: var(--font-body) !important;
}

.site-header h1,
.site-header h2,
.site-header h3,
.site-header h4,
.site-header .mega-category-title,
.site-header .mega-offers-title,
.site-header .search-results-header {
  font-family: var(--font-heading) !important;
}

header ul,
header ol,
header li,
.site-header ul,
.site-header ol,
.site-header li,
.nav-list,
.nav-item,
.dropdown-menu,
.mega-subcategory-list {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
}

/* Regla Estricta: Eliminar cualquier subrayado de enlaces en la cabecera */
.site-header a,
.site-header a:link,
.site-header a:visited,
.site-header a:hover,
.site-header a:active,
.site-header a:focus,
.nav-link,
.nav-link:link,
.nav-link:visited,
.nav-link:hover,
.nav-link:active,
.nav-link:focus,
.dropdown-menu a,
.mega-category-title,
.mega-subcategory-list a,
.header-logo,
.login-link,
.admin-panel-link,
.btn-logout,
.cart-btn,
.search-result-item,
.btn-header-cotizar {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: none !important;
  outline: none;
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background-color: transparent;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   BARRA SUPERIOR INSTITUCIONAL (TOPBAR)
   Presencia Sólida, Color Deep Slate (#0F172A), Altura Ampliada (42px) y Fija
   ========================================================================== */
.header-topbar {
  background-color: #0F172A;
  color: #E2E8F0;
  height: var(--topbar-height, 42px);
  min-height: 42px;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1010;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.header-topbar-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #CBD5E1 !important;
  text-decoration: none !important;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-item strong {
  font-weight: 700;
  color: #F8FAFC;
}

.topbar-link:hover {
  color: #FFFFFF !important;
  transform: translateY(-0.5px);
}

.topbar-link:hover .topbar-icon {
  color: #F58220;
  transform: scale(1.1);
}

.topbar-icon {
  color: #F58220;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.topbar-divider {
  width: 1px;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.topbar-badge-despacho {
  color: #CBD5E1 !important;
  font-weight: 500;
  cursor: default;
}

.topbar-badge-despacho .topbar-icon {
  color: #38BDF8;
}

/* Redes Sociales en Barra Superior */
.topbar-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-social-label {
  font-size: 0.74rem;
  color: #94A3B8;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-right: 2px;
}

.topbar-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #CBD5E1 !important;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-social-link svg {
  transition: transform 0.2s ease;
}

.topbar-social-link:hover {
  background: linear-gradient(135deg, #ED1C24 0%, #F58220 100%);
  border-color: transparent;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(245, 130, 32, 0.4);
}

.topbar-social-link:hover svg {
  transform: scale(1.12);
}

.topbar-whatsapp {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #F8FAFC !important;
  padding: 4px 12px;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar-whatsapp:hover {
  background: rgba(34, 197, 94, 0.28);
  border-color: #22C55E;
  color: #FFFFFF !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.28);
  transform: translateY(-0.5px);
}

.topbar-icon-whatsapp {
  color: #22C55E !important;
}

.whatsapp-live-dot {
  width: 7px;
  height: 7px;
  background-color: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
  display: inline-block;
  animation: pulseGreenLive 2s infinite ease-in-out;
}

@keyframes pulseGreenLive {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* ==========================================================================
   BARRA PRINCIPAL DE NAVEGACIÓN (MAIN HEADER BAR)
   ========================================================================== */
.header-main-bar {
  background-color: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  width: 100%;
  height: var(--main-header-height, 78px);
  min-height: 78px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1000;
}

.header-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Grupo Izquierdo: Botón Menú Lateral + Logo */
.header-left-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Botón Disparador del Menú Lateral (Desktop & Móvil) */
.btn-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  color: #1E293B;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-sidebar-toggle:hover {
  background-color: #F1F5F9;
  border-color: #CBD5E1;
  color: #F58220;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(245, 130, 32, 0.12);
}

.btn-sidebar-toggle .hamburger-icon {
  color: #F58220;
  transition: transform 0.2s ease;
}

.btn-sidebar-toggle:hover .hamburger-icon {
  transform: scale(1.08);
}

/* Logo Oficial */
.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  flex-shrink: 0;
  max-width: 210px;
  transition: opacity 0.2s ease;
}

.header-logo:hover {
  opacity: 0.92;
}

.logo-img {
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* Navegación Principal */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

/* Enlaces del Menú: Uniformes, Estilizados y Profesionales */
.nav-link {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: -0.01em;
  color: #334155 !important;
  padding: 8px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  white-space: nowrap;
  background-color: transparent;
  border: none !important;
  text-decoration: none !important;
}

.nav-link:hover {
  color: #ED1C24 !important;
  background-color: #F8FAFC;
  text-decoration: none !important;
}

/* Estado Activo: Píldora suave y texto rojo, sin barras ni subrayados */
.nav-link.active {
  color: #ED1C24 !important;
  font-weight: 700 !important;
  background-color: #FFF1F2;
  text-decoration: none !important;
  border: none !important;
  box-shadow: 0 1px 2px rgba(237, 28, 36, 0.06);
}

/* Ícono de Despliegue */
.dropdown-icon {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  color: #64748B;
  flex-shrink: 0;
}

.nav-link:hover .dropdown-icon,
.nav-link.active .dropdown-icon {
  color: #ED1C24;
}

.has-dropdown:hover .dropdown-icon {
  transform: rotate(180deg);
  color: #ED1C24;
}

/* Dropdown Menú Clásico */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background-color: #FFFFFF;
  min-width: 230px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.8);
  border: 1px solid #E2E8F0;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1050;
  list-style: none !important;
}

.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155 !important;
  border-radius: 8px;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

.dropdown-menu a:hover {
  background-color: #FFF1F2;
  color: #ED1C24 !important;
  text-decoration: none !important;
  transform: translateX(3px);
}

/* ==========================================================================
   Mega Menu Premium & Corporativo - Tienda Virtual (4 Columnas & NN/g UX)
   ========================================================================== */
.mega-dropdown-item {
  position: relative;
}

.dropdown-menu.mega-menu {
  min-width: 920px;
  max-width: 980px;
  left: 50%;
  transform: translate(-50%, 8px);
  padding: 30px 34px;
  background-color: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 18px 40px -8px rgba(15, 23, 42, 0.09), 0 4px 14px -2px rgba(15, 23, 42, 0.03);
  border: 1px solid #E2E8F0;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s ease;
}

.has-dropdown:hover .dropdown-menu.mega-menu,
.has-dropdown:focus-within .dropdown-menu.mega-menu {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}

.mega-menu-col {
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
  border-radius: 8px;
}

/* Encabezado de Categoría */
.mega-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #F1F5F9;
  transition: border-color 0.2s ease;
}

/* Ícono lineal corporativo uniforme */
.mega-category-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1E3A8A;
  flex-shrink: 0;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mega-cat-icon-svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  display: block;
}

/* Título de Categoría: Azul Corporativo, Semibold y Jerarquía Diferenciada */
.mega-category-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0F2444 !important;
  text-decoration: none !important;
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color 0.18s ease;
  padding: 0 !important;
  display: inline-block;
  background: transparent !important;
}

.mega-category-title:hover {
  color: #ED1C24 !important;
  background-color: transparent !important;
  text-decoration: none !important;
}

.mega-category-header:hover .mega-category-icon-wrap {
  background-color: #FFF1F2;
  border-color: #FECDD3;
  color: #ED1C24;
  transform: translateY(-1px);
}

/* Lista de Productos / Subcategorías */
.mega-subcategory-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mega-subcategory-list li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* Enlaces de Producto: Gris Azulado Oscuro con Hover Sutil */
.mega-subcategory-list a {
  display: block;
  padding: 7px 10px !important;
  font-size: 0.86rem !important;
  font-weight: 500;
  color: #334155 !important;
  border-radius: 6px;
  text-decoration: none !important;
  line-height: 1.35;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: transparent;
}

.mega-subcategory-list a:hover {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
  text-decoration: none !important;
  transform: translateX(4px);
}

.mega-subcategory-list a:focus-visible {
  outline: 2px solid #1E3A8A;
  outline-offset: 2px;
}

/* Estado Activo para la Categoría Actualmente Seleccionada */
.mega-menu-col.is-active .mega-category-icon-wrap {
  background-color: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E3A8A;
  box-shadow: 0 1px 3px rgba(30, 58, 138, 0.08);
}

.mega-menu-col.is-active .mega-category-title {
  color: #1E3A8A !important;
  font-weight: 700;
}

.mega-menu-col.is-active .mega-category-header {
  border-bottom-color: #BFDBFE;
}

/* ==========================================================================
   GRUPO CENTRAL: BUSCADOR PROTAGONISTA Y CARRITO INMEDIATAMENTE ADYACENTE
   ========================================================================== */
.header-center-search-cart {
  flex: 1 1 620px;
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 16px;
  min-width: 0;
}

/* Buscador Central Grande y Visible */
.header-search-wrapper {
  flex: 1 1 auto;
  position: relative;
  width: 100%;
  min-width: 0;
}

.header-search-form {
  width: 100%;
  margin: 0;
}

.search-input-box {
  display: flex;
  align-items: center;
  background-color: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  height: 46px;
  padding: 0 6px 0 14px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.search-input-box:hover {
  background-color: #FFFFFF;
  border-color: #CBD5E1;
}

.search-input-box:focus-within {
  background-color: #FFFFFF;
  border-color: #ED1C24;
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12), 0 4px 14px rgba(15, 23, 42, 0.05);
}

.search-input-box.search-empty-shake {
  animation: searchEmptyShake 0.45s ease-in-out;
  border-color: #F58220;
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.2);
}

@keyframes searchEmptyShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.search-box-icon {
  color: #94A3B8;
  flex-shrink: 0;
  margin-right: 10px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.search-input-box:focus-within .search-box-icon {
  color: #ED1C24;
  transform: scale(1.05);
}

.header-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  color: #0F172A;
  font-weight: 500;
  padding: 8px 4px;
  line-height: 1.4;
}

.header-search-input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.search-clear-btn {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-right: 4px;
}

.search-clear-btn:hover {
  background-color: #E2E8F0;
  color: #0F172A;
}

.search-submit-btn {
  background: linear-gradient(135deg, #F58220 0%, #ED1C24 100%);
  color: #FFFFFF !important;
  border: none;
  border-radius: 9px;
  height: 34px;
  padding: 0 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(237, 28, 36, 0.25);
}

.search-submit-btn:hover {
  background: linear-gradient(135deg, #d96d11 0%, #c9141b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(237, 28, 36, 0.35);
  color: #FFFFFF !important;
}

.search-submit-btn:active {
  transform: translateY(0);
}

.search-btn-icon {
  flex-shrink: 0;
}

/* Resultados y Sugerencias en Vivo */
.header-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background-color: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 18px 40px -6px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(226, 232, 240, 0.9);
  padding: 12px 14px;
  z-index: 1150;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 #F8FAFC;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-search-results::-webkit-scrollbar {
  width: 6px;
}
.header-search-results::-webkit-scrollbar-thumb {
  background-color: #CBD5E1;
  border-radius: 4px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 6px;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none !important;
  color: inherit;
  transition: all 0.15s ease;
  cursor: pointer;
}

.search-result-item:hover {
  background-color: #F8FAFC;
  transform: translateX(2px);
}

.search-result-img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #F1F5F9;
  border: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item:hover .search-result-title {
  color: #ED1C24;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #64748B;
}

.search-result-category {
  background-color: #EFF6FF;
  color: #2563EB;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.search-result-price {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ED1C24;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

.search-no-results {
  text-align: center;
  padding: 24px 16px;
  color: #64748B;
}

.search-no-results span {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
}

.search-view-all-btn {
  display: block;
  text-align: center;
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  background: #FFF1F2;
  color: #ED1C24 !important;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  border: 1px dashed rgba(237, 28, 36, 0.3);
}

.search-view-all-btn:hover {
  background: #ED1C24;
  color: #FFFFFF !important;
  border-style: solid;
}

/* Resaltado del término buscado en los resultados dinámicos */
.search-highlight {
  background-color: rgba(237, 28, 36, 0.14);
  color: #ED1C24;
  font-weight: 800;
  border-radius: 2px;
  padding: 0 2px;
}

.search-result-badge-promo {
  font-size: 0.70rem;
  font-weight: 700;
  background-color: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  padding: 1px 6px;
  border-radius: 4px;
}

.search-result-stock {
  font-size: 0.70rem;
  font-weight: 600;
  color: #16A34A;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ==========================================================================
   BOTÓN DE CARRITO INMEDIATAMENTE JUNTO AL BUSCADOR (PILL STYLE)
   ========================================================================== */
.header-cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px 0 12px;
  background-color: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  color: #0F172A !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 0.90rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
  cursor: pointer;
  white-space: nowrap;
}

.header-cart-pill:hover {
  background-color: #FFF1F2;
  border-color: #ED1C24;
  color: #ED1C24 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(237, 28, 36, 0.16);
}

.header-cart-pill:hover .cart-icon-svg {
  color: #ED1C24;
  transform: scale(1.06);
}

.cart-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.cart-icon-svg {
  color: #334155;
  transition: transform 0.2s ease, color 0.2s ease;
}

.cart-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  background-color: #ED1C24;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 5px rgba(237, 28, 36, 0.35);
  line-height: 1;
}

.cart-label-text {
  font-weight: 700;
  font-size: 0.90rem;
  color: inherit;
  line-height: 1;
}

/* Header Actions Right */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
}

/* Enlace Login / Iniciar Sesión */
.login-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: normal;
  color: #334155 !important;
  padding: 8px 14px;
  white-space: nowrap;
  border-radius: 9999px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  border: 1px solid #E2E8F0;
  background-color: #FFFFFF;
}

.login-link:hover {
  color: #ED1C24 !important;
  border-color: rgba(237, 28, 36, 0.3);
  background-color: #FFF1F2;
  text-decoration: none !important;
}

/* Botón Solicitar Cotización */
.btn-header-cotizar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #ED1C24 0%, #F58220 100%);
  color: #FFFFFF !important;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(237, 28, 36, 0.25);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-header-cotizar:hover {
  background: linear-gradient(135deg, #c9141b 0%, #d96d11 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(237, 28, 36, 0.35);
  color: #FFFFFF !important;
  text-decoration: none !important;
}

.mobile-menu-toggle {
  display: none;
}

/* Responsive Navbar */
@media (max-width: 1240px) {
  .nav-list {
    gap: 4px;
  }
  .nav-link {
    font-size: 0.86rem;
    padding: 7px 10px;
  }
  .header-actions {
    gap: 8px;
  }
}

@media (max-width: 1100px) {
  .topbar-item-email,
  .topbar-divider-email {
    display: none !important;
  }
  .nav-list {
    gap: 2px;
  }
  .nav-link {
    font-size: 0.82rem;
    padding: 6px 8px;
  }
  .login-link span {
    font-size: 0.8rem;
  }
  .header-logo {
    max-width: 170px;
  }
}

@media (max-width: 992px) {
  .header-container {
    padding: 0 16px;
    gap: 12px;
  }

  .header-center-search-cart {
    margin: 0 8px;
    gap: 10px;
  }

  .topbar-badge-despacho {
    display: none !important;
  }

  .btn-header-cotizar span {
    display: none;
  }

  .btn-header-cotizar {
    padding: 8px;
    border-radius: 50%;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1A1A1A;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #F8F9FA;
    border: none;
    cursor: pointer;
  }

  .main-nav {
    position: fixed;
    top: 120px;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background-color: #FFFFFF;
    box-shadow: 0 20px 25px -5px rgba(26, 26, 26, 0.15), 0 8px 10px -6px rgba(26, 26, 26, 0.05);
    border-bottom: 2px solid #ED1C24;
    flex-direction: column;
    padding: 20px;
    display: none;
    z-index: 1050;
  }

  .main-nav.active {
    display: flex;
    animation: slideDownNav 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideDownNav {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    gap: 6px;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid #F1F5F9;
    padding-bottom: 6px;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    font-size: 0.95rem;
    padding: 10px 12px;
  }

  .dropdown-menu,
  .dropdown-menu.mega-menu {
    position: static !important;
    min-width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    border-left: 3px solid #ED1C24 !important;
    border-radius: 0 10px 10px 0 !important;
    background-color: #F8FAFC !important;
    padding: 14px 14px 14px 16px !important;
    margin-top: 8px !important;
    display: none;
  }

  .nav-item.mobile-open .dropdown-menu,
  .has-dropdown.active .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .mega-menu-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .mega-menu-col {
    padding-bottom: 12px;
    border-bottom: 1px solid #E2E8F0;
  }

  .mega-menu-col:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .mega-category-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: none;
  }

  .mega-subcategory-list {
    margin-left: 4px;
    gap: 3px;
  }

  .mega-subcategory-list a {
    padding: 8px 10px !important;
    font-size: 0.88rem !important;
    min-height: 40px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 991px) {
  .topbar-social-label {
    display: none;
  }
}

@media (max-width: 768px) {
  .topbar-badge-despacho {
    display: none;
  }

  .header-main-bar {
    height: auto;
    min-height: auto;
    padding: 10px 0 12px;
  }

  .header-container {
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .header-left-group {
    order: 1;
  }

  .header-actions {
    order: 2;
    margin-left: auto;
  }

  .header-center-search-cart {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 0;
    flex: 1 1 100%;
    gap: 8px;
  }

  .header-cart-pill .cart-label-text {
    display: none;
  }

  .header-cart-pill {
    padding: 0 12px;
    height: 42px;
  }

  .search-input-box {
    height: 42px;
    padding: 0 4px 0 10px;
  }

  .header-search-input {
    font-size: 0.88rem;
  }

  .search-submit-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 0.82rem;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 38px;
    --main-header-height: auto;
    --total-header-height: 110px;
  }

  .header-topbar {
    height: 38px;
    min-height: 38px;
  }

  .header-topbar-container {
    padding: 0 12px;
    gap: 6px;
  }

  .topbar-left {
    gap: 6px;
  }

  .topbar-right {
    gap: 6px;
  }

  .topbar-item {
    font-size: 0.74rem;
    gap: 4px;
  }

  .topbar-whatsapp {
    padding: 3px 8px;
    font-size: 0.74rem;
    gap: 5px;
  }

  .main-nav {
    top: 110px;
    max-height: calc(100vh - 110px);
    padding: 16px;
  }

  .header-logo {
    max-width: 150px;
  }

  .logo-img {
    height: 32px;
  }

  .header-actions {
    gap: 6px;
  }

  .login-link span {
    display: none;
  }

  .login-link {
    padding: 6px;
    border-radius: 50%;
  }

  .btn-sidebar-toggle .sidebar-toggle-text {
    display: none;
  }

  .btn-sidebar-toggle {
    padding: 6px 10px;
  }
}

/* ==========================================================================
   MENÚ LATERAL IZQUIERDO (OFFCANVAS SIDEBAR DRAWER)
   Diseño con Íconos por Categoría, Acordeones y Opciones Desplegables
   ========================================================================== */

/* Bloqueo de scroll cuando el drawer está activo */
body.drawer-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Fondo Oscuro / Overlay */
.sidebar-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.sidebar-drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Contenedor Principal del Menú Lateral */
.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background-color: #FFFFFF;
  z-index: 99999;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.sidebar-drawer.is-open {
  transform: translateX(0);
}

/* Encabezado del Drawer */
.sidebar-drawer-header {
  padding: 16px 18px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  flex-shrink: 0;
  gap: 12px;
}

.sidebar-drawer-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drawer-logo-link {
  display: inline-block;
  text-decoration: none !important;
}

.drawer-logo-img {
  height: 32px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  display: block;
}

.drawer-brand-tagline {
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #F58220;
  letter-spacing: 0.05em;
  margin-left: 2px;
  line-height: 1;
}

.sidebar-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.sidebar-drawer-close:hover {
  background-color: #FEE2E2;
  border-color: #FCA5A5;
  color: #ED1C24;
  transform: rotate(90deg);
}

/* Cuerpo del Drawer */
.sidebar-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 18px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Lista de Navegación */
.drawer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-nav-item {
  width: 100%;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

/* Enlaces y Botones de Acordeón del Drawer */
.drawer-nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #1E293B;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none !important;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #1E293B;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none !important;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-nav-link:hover,
.drawer-accordion-btn:hover {
  background-color: #F8FAFC;
  color: #F58220;
}

.drawer-nav-link.is-active,
.drawer-accordion-btn.is-active {
  background-color: rgba(245, 130, 32, 0.08);
  color: #F58220;
  font-weight: 700;
}

.drawer-btn-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

/* Caja de Ícono por Categoría */
.drawer-nav-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background-color: #F1F5F9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-nav-link:hover .drawer-nav-icon-box,
.drawer-accordion-btn:hover .drawer-nav-icon-box {
  background-color: rgba(245, 130, 32, 0.15);
  color: #F58220;
}

.drawer-nav-link.is-active .drawer-nav-icon-box,
.drawer-accordion-btn.is-active .drawer-nav-icon-box {
  background-color: #F58220;
  color: #FFFFFF;
}

.drawer-nav-label {
  font-size: 0.94rem;
  font-weight: 600;
  color: inherit;
}

/* Chevron Rotatorio del Acordeón */
.drawer-chevron-icon {
  color: #94A3B8;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  flex-shrink: 0;
}

.drawer-nav-item.is-open .drawer-chevron-icon {
  transform: rotate(180deg);
  color: #F58220;
}

/* Contenedor del Submenú Desplegable con Animación Suave */
.drawer-submenu-wrapper {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.drawer-nav-item.is-open .drawer-submenu-wrapper {
  max-height: 600px;
  opacity: 1;
}

.drawer-submenu {
  list-style: none;
  margin: 4px 0 8px 16px;
  padding: 6px 0 6px 12px;
  border-left: 2px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Enlaces Internos del Submenú */
.drawer-sublink {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-sublink:hover {
  background-color: #F8FAFC;
  color: #ED1C24;
  transform: translateX(3px);
}

.drawer-sublink.is-active {
  background-color: rgba(237, 28, 36, 0.08);
  color: #ED1C24;
  font-weight: 700;
}

.drawer-subicon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background-color: #F1F5F9;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s ease;
}

.drawer-sublink:hover .drawer-subicon {
  background-color: #FEE2E2;
  color: #ED1C24;
}

.drawer-subinfo {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.drawer-subtitle {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
}

.drawer-subdesc {
  font-size: 0.74rem;
  color: #64748B;
  line-height: 1.3;
  margin-top: 2px;
}

.drawer-sublink-all-wrap {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #E2E8F0;
}

.drawer-sublink-all {
  color: #F58220 !important;
}

.drawer-sublink-all .drawer-subicon {
  background-color: rgba(245, 130, 32, 0.12);
  color: #F58220;
}

/* Caja de Acciones en el Drawer */
.drawer-actions-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #F1F5F9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-btn-cotizar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ED1C24 0%, #F58220 100%);
  color: #FFFFFF !important;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(237, 28, 36, 0.28);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none !important;
}

.drawer-btn-cotizar:hover {
  background: linear-gradient(135deg, #c9141b 0%, #d96d11 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(237, 28, 36, 0.38);
}

.drawer-cart-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  text-decoration: none !important;
  color: #1E293B;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.drawer-cart-link:hover {
  background-color: #F1F5F9;
  border-color: #CBD5E1;
  color: #F58220;
}

.drawer-cart-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-cart-badge {
  background-color: #ED1C24;
  color: #FFFFFF;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.drawer-user-auth {
  display: flex;
  gap: 8px;
}

.drawer-admin-btn {
  flex: 1;
  background-color: #0F172A;
  color: #FFFFFF !important;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none !important;
  text-align: center;
}

.drawer-logout-btn {
  background-color: transparent;
  color: #ED1C24 !important;
  border: 1px solid rgba(237, 28, 36, 0.3);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none !important;
  text-align: center;
}

.drawer-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.drawer-login-btn:hover {
  background-color: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

/* Pie del Drawer */
.sidebar-drawer-footer {
  padding: 16px 18px;
  background-color: #0F172A;
  color: #E2E8F0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.drawer-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #94A3B8;
}

.drawer-contact-item svg {
  color: #F58220;
  flex-shrink: 0;
}

.drawer-whatsapp-btn {
  margin-top: 4px;
  background-color: #22C55E;
  color: #FFFFFF !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-whatsapp-btn:hover {
  background-color: #16A34A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

