/* ===== HEADER, MENÚ Y BARRA DE CATEGORÍAS - ESTILOS COMPARTIDOS ===== */

/* Espaciado general */
body {
  padding-top: 160px; /* 100px header + 60px barra categorías */
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header Fijo */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  transition: all 0.3s ease;
}
#header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Barra de Categorías Fija */
#categorias-bar {
  position: fixed;
  top: 100px;
  left: 0;
  right: 0;
  z-index: 999;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#categorias-bar::-webkit-scrollbar { display: none; }
.categorias-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.categoria-nav-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  text-decoration: none;
  color: #4b5563;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.2s;
  min-width: 70px;
}
.categoria-nav-item:hover,
.categoria-nav-item.active {
  background: #f1f5f9;
  color: #1e40af;
  transform: translateY(-2px);
}
.categoria-nav-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
  line-height: 1;
}

/* Icono de Acceso (Llave/Puerta) */
.icono-acceso-header {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffedd5;
  color: #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  text-decoration: none;
  transition: all 0.3s;
  z-index: 1001;
  box-shadow: 0 2px 6px rgba(234,88,12,0.3);
}
.icono-acceso-header:hover {
  background: #fecdd3;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 10px rgba(234,88,12,0.4);
}
.icono-acceso-header.asociado-activo {
  background: #dbeafe;
  color: #1e40af;
  box-shadow: 0 2px 6px rgba(30,64,175,0.3);
}
.icono-acceso-header.asociado-activo:hover {
  background: #bfdbfe;
  box-shadow: 0 4px 10px rgba(30,64,175,0.4);
}
.tooltip-acceso {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s;
  z-index: 1002;
}
.icono-acceso-header:hover .tooltip-acceso {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Menú Hamburguesa */
.menu-toggle-with-text {
  position: fixed;
  left: 20px;
  top: 50px;
  transform: translateY(-50%);
  background: #1e40af;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(30,64,175,0.3);
  z-index: 1102;
  transition: all 0.2s;
}
.menu-toggle-with-text:hover {
  background: #1d4ed8;
  transform: translateY(-50%) scale(1.05);
}

/* Sidebar y Overlay */
.sidebar-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  z-index: 1050;
  transition: left 0.3s ease;
  padding-top: 20px;
}
.sidebar-menu.active { left: 0; z-index: 1150; }
.sidebar-menu ul { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li { padding: 0 20px; }
.sidebar-menu a {
  display: block;
  padding: 16px 15px;
  color: #1e293b;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 15px;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: #f1f5f9;
  color: #1e40af;
}
.menu-icon { font-size: 1.4rem; width: 24px; }
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  z-index: 1040;
  transition: all 0.3s;
}
.menu-overlay.active { opacity: 1; visibility: visible; z-index: 1140; }

/* ===== SALUDO ASOCIADO (EN HEADER) ===== */
.saludo-asociado {
  position: absolute;
  right: 72px; /* Justo a la izquierda del icono (42px + 26px de espacio) */
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  text-transform: uppercase;
  line-height: 1.1;
  width: max-content;
  z-index: 1001;
}
.saludo-asociado .saludo-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.saludo-asociado .saludo-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e40af;
}

/* Responsive para header, categorías y saludo */
/* Responsive para header, categorías y menú */
@media (max-width: 768px) {
  body { padding-top: 145px; }
  #header { height: 85px; }
  #categorias-bar { top: 85px; }
  .icono-acceso-header { width: 36px; height: 36px; font-size: 1.2rem; right: 12px; }
  


  /* ✅ MENÚ HAMBURGUESA: Posición fija idéntica a Netlify (anclado al viewport) */
  .menu-toggle-with-text {
    position: fixed !important;   /* Relativo a la pantalla, NO al header/body */
    top: 16px !important;         /* Misma distancia vertical que Netlify */
    left: 8px !important;         /* Misma distancia horizontal */
    z-index: 1100 !important;     /* Siempre encima del header y barra */
    flex-direction: column;
    padding: 5px 10px;
    gap: -3px;
    border-radius: 12px;
    min-width: 42px;
    margin: 0 !important;         /* Elimina márgenes heredados que lo desplazan */
    transform: none !important;   /* Evita que animaciones o scroll lo muevan */
  }
  
  .menu-toggle-with-text span:first-child {
    display: block !important;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: -4px;
    padding: 0 1px;
  }
  
  .menu-toggle-with-text span:last-child {
    font-size: 0.95rem;
    line-height: 0.9;
    margin-top: -2px;
  }