/* MotoFlowStudio — STORE CSS
   Store-only styles. This file is never loaded by the Admin.
*/

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  6. NAVEGACIÓN                                                ║
   ╚══════════════════════════════════════════════════════════════════╝ */

/* ── Contenedor nav con WRAP y CENTRADO ── */
#nav-links-container { 
    display: flex; 
    align-items: center; 
    gap: 8px 12px; 
    flex-wrap: wrap; 
    justify-content: center;
}

/* ── Links normales (desktop) ── */
.nav-link {
    font-family: 'Bebas Neue', sans-serif !important;
    letter-spacing: 3px;
    font-size: 1.3rem;
    position: relative;
    color: var(--fg-muted);
    transition: color var(--transition);
    white-space: nowrap;
    padding: 6px 0;
}
.nav-link::after { 
    content: ''; 
    position: absolute; 
    bottom: -4px; 
    left: 0; 
    width: 0; 
    height: 2px; 
    background: var(--accent); 
    transition: width var(--transition); 
}
.nav-link:hover { color: var(--fg-primary); }
.nav-link:hover::after { width: 100%; }

/* ── Dropdown de subcategorías ── */
.nav-item-dropdown { 
    position: relative; 
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 180px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.nav-item-dropdown:hover .nav-dropdown-menu { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}
.dropdown-link { 
    display: block; 
    padding: 8px 16px; 
    color: var(--fg-muted); 
    font-size: 13px; 
    transition: all 0.2s; 
}
.dropdown-link:hover { 
    background: rgba(255,255,255,0.05); 
    color: white; 
}

/* ── Badge de notificación ── */
.notification-badge {
    position: absolute;
    top: 5px;
    right: 10px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    border: 2px solid #1f2937;
}

/* ═══════════════════════════════════════════════════════════════════
   MENÚ MÓVIL - PANEL COMPLETO
   ═══════════════════════════════════════════════════════════════════ */

/* ── Panel trasero ── */
#mobileMenu {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.98);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    overflow-y: auto;
    padding: 100px 30px 40px;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.3s ease, 
                visibility 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
}

#mobileMenu.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* ── Contenedor de links ── */
#mobile-links-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-bottom: 30px;
}

/* ── Links principales (Inicio, Categorías) ── */
.mobile-nav-link {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 4px;
    font-size: 1.8rem;
    color: var(--fg-muted);
    text-decoration: none;
    padding: 18px 24px;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    display: block;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
    color: white;
    background: rgba(255, 77, 0, 0.08);
}

/* ── Link secundario (Ver Todas las Marcas) ── */
.mobile-nav-link-secondary {
    font-size: 1.1rem;
    letter-spacing: 3px;
    color: #555;
    margin-top: 12px;
    border-bottom: none;
}

.mobile-nav-link-secondary:hover {
    color: var(--accent);
}

/* ── Separador visual entre secciones ── */
.mobile-separator {
    width: 50px;
    height: 2px;
    background: var(--accent);
    margin: 8px 0;
    border-radius: 2px;
    opacity: 0.3;
    flex-shrink: 0;
}

/* ── Botón X para cerrar menú móvil ── */
.mobile-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 120;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    font-family: Arial, sans-serif;
}

/* ── Botón X reutilizable (filtros, modales) ── */
.modal-x-btn {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #666;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    font-family: Arial, sans-serif;
    flex-shrink: 0;
}



.modal-x-btn:hover,
.modal-x-btn:active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    transform: rotate(90deg);
}

#mobileMenu.active .mobile-close-btn {
    display: flex;
}

.mobile-close-btn:hover,
.mobile-close-btn:active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    transform: rotate(90deg);
}

/* ── ACORDEÓN DE MARCAS ── */
.mobile-accordion {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-accordion-toggle {
    width: 100%;
    padding: 18px 24px;
    background: none;
    border: none;
    border-bottom: none;
    color: var(--fg-muted);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-accordion-toggle:hover,
.mobile-accordion-toggle:active {
    color: white;
    background: rgba(255, 77, 0, 0.08);
}

/* Flecha del acordeón */
.mobile-accordion-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0.5;
}

.mobile-accordion-arrow.rotated {
    transform: rotate(180deg);
    opacity: 1;
}

/* Contenido colapsable */
.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.25);
}

.mobile-accordion-content.open {
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-accordion-content::-webkit-scrollbar { width: 3px; }
.mobile-accordion-content::-webkit-scrollbar-track { background: transparent; }
.mobile-accordion-content::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

/* ── Cada link de marca dentro del acordeón ── */
.mobile-brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 28px;
    color: #888;
    text-decoration: none;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-brand-link:last-child {
    border-bottom: none;
}

.mobile-brand-link:hover,
.mobile-brand-link:active {
    color: var(--accent);
    background: rgba(255, 77, 0, 0.06);
    padding-left: 36px;
}

/* Logo de marca pequeño */
.mobile-brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.mobile-brand-link:hover .mobile-brand-logo {
    opacity: 1;
}

/* ── Hamburguesa ── */
.hamburger {
    width: 32px;
    height: 32px;
    position: relative;
    cursor: pointer;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 110;
    padding: 0;
    transition: all 0.3s ease;
}
.hamburger:hover {
    border-color: var(--accent);
    background: rgba(255, 77, 0, 0.1);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--fg-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { bottom: 0; }

.hamburger.active {
    border-color: var(--accent);
    background: rgba(255, 77, 0, 0.15);
}
.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    #nav-links-container { display: none; }
    .hamburger { display: flex; }
}


@media (min-width: 769px) {
    .modal-x-btn {
        display: none !important;
    }

    #mobileMenu {
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    .hamburger { display: none !important; }
}

/* ── Pantallas muy pequeñas ── */
@media (max-width: 380px) {
    .mobile-nav-link {
        font-size: 1.5rem;
        padding: 14px 20px;
        letter-spacing: 3px;
    }
    .mobile-accordion-toggle {
        font-size: 1.5rem;
        padding: 14px 20px;
        letter-spacing: 3px;
    }
    .mobile-brand-link {
        font-size: 1rem;
        padding: 12px 20px;
        gap: 10px;
    }
    .mobile-brand-logo {
        width: 22px;
        height: 22px;
    }
}

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  8. HERO SLIDER                                               ║
   ╚══════════════════════════════════════════════════════════════════╝ */

.slideshow-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px 16px;
  background: #000;
  margin-top: 120px;
}
.slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(255, 77, 0, 0.25);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.8),
    0 0 30px rgba(255, 77, 0, 0.08),
    inset 0 0 60px rgba(0,0,0,0.2);
}
.slide.active { opacity: 1; z-index: 2; }
.slide-bg {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.85) contrast(1.05);
  transition: transform 8s ease-out;
}
.slide.active .slide-bg {
  transform: scale(1.05);
}
.slide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0) 40%,
    rgba(0,0,0,0.5) 75%,
    rgba(0,0,0,0.75) 100%
  );
}
.slideshow-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 3;
  text-align: center;
  padding: 60px 24px 40px;
}
.slideshow-caption__heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8), 0 0 40px rgba(0,0,0,0.4);
  opacity: 0; transform: translateY(20px);
  animation: caption-in 0.8s ease forwards; animation-delay: 0.3s;
  letter-spacing: 2px;
}
.slideshow-caption__subheading {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: rgba(255,255,255,0.85);
  margin-bottom: 1.5rem;
  opacity: 0; transform: translateY(20px);
  animation: caption-in 0.8s ease forwards; animation-delay: 0.5s;
  text-shadow: 0 1px 10px rgba(0,0,0,0.6);
}
.slideshow-caption .btn-primary {
  opacity: 0; transform: translateY(20px);
  animation: caption-in 0.8s ease forwards; animation-delay: 0.7s;
  display: inline-block;
  padding: 14px 36px;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(255,77,0,0.4);
}
.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid rgba(255,255,255,0.15);
}
.dot.active {
  background: var(--accent);
  transform: scale(1.3);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(255,77,0,0.5);
}
.slider-close-btn {
  position: absolute; top: 30px; right: 30px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; opacity: 0.7;
}
.slider-close-btn:hover { background: rgba(255,77,0,0.3); opacity: 1; transform: scale(1.1); border-color: rgba(255,77,0,0.5); }
.slideshow-container { transition: max-height 0.4s ease, opacity 0.4s ease, min-height 0.4s ease; max-height: 200vh; min-height: 70vh; opacity: 1; overflow: hidden; }
.slideshow-container.slider-closed { max-height: 0; min-height: 0; opacity: 0; }

/* ✅ Cuando no hay slider, empujar contenido debajo del nav fijo */
body.no-slider #categorias {
  padding-top: 140px;
}
@media (min-width: 768px) {
  body.no-slider #categorias {
    padding-top: 180px;
  }
}

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  9. CATEGORÍAS                                                ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.category-card-large {
  position: relative; height: 400px; border-radius: 18px;
  overflow: hidden; border: 2px solid #fff;
  transition: all 0.4s ease; cursor: pointer;
}
.category-card-large:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.3); }
.category-card-large img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.category-card-large:hover img { transform: scale(1.05); }
.category-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; text-align: center;
}

/* ── Modal categoría: título no se tape con botón Filtros en móvil ── */
@media (max-width: 768px) {
    #category-modal .sticky.top-0 {
        padding-top: 52px !important;
    }
    /* Botón Filtros: fijo al hacer scroll */
    #mobile-filter-toggle {
        position: fixed !important;
        z-index: 65 !important;
    }
}

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  10. MARCAS (CARRUSEL)                                        ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.brands-track {
  display: flex;
  animation: scroll-brands 30s linear infinite;
  animation-play-state: paused;
}
.brands-track.visible { animation-play-state: running; }

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  11. TARJETA DE PRODUCTO (.card)                              ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.card {
  width: 100%;
  background: linear-gradient(180deg, #111, #080808);
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .7);
  position: relative; font-family: 'Poppins', sans-serif;
  transition: transform 0.25s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255, 120, 0, .45); box-shadow: 0 16px 50px rgba(0, 0, 0, .8), 0 0 25px rgba(255, 120, 0, .12), 0 0 60px rgba(255, 120, 0, .06); }

/* Imagen */
.top {
  position: relative; height: 220px; margin: 10px;
  border-radius: 12px; overflow: hidden; background: #0a0a0a;
  display: flex; justify-content: center; align-items: center;
}
.top::before { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 120, 0, .25), transparent 70%); right: -40px; top: -20px; pointer-events: none; }
.top::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 140, 255, .12), transparent 70%); left: -30px; bottom: -20px; pointer-events: none; }
.product {
  width: 100%; height: 100%; max-width: 180px; max-height: 180px;
  object-fit: contain; position: relative; z-index: 2; cursor: pointer;
  transition: transform 0.3s ease, opacity 0.2s ease;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, .7)); padding: 10px; box-sizing: border-box;
}
.card:hover .product { transform: scale(1.06); }

/* Labels */
.label { position: absolute; z-index: 5; color: white; font-weight: 700; font-size: 10px; padding: 5px 12px; letter-spacing: 0.3px; }
.best { top: 8px; left: 0; border-radius: 0 8px 8px 0; background: linear-gradient(90deg, #ff7a00, #b44b00); }
.hot { right: 0; top: 8px; border-radius: 8px 0 0 8px; background: linear-gradient(90deg, #ff3300, #d60000); }

/* Contenido */
.content { padding: 0 12px 14px; text-align: center; }
.brand { color: #ff7a00; font-size: 11px; font-weight: 700; margin-bottom: 2px; letter-spacing: 1.5px; text-transform: uppercase; }
.title { color: white; font-size: 15px; line-height: 1.2; font-weight: 700; margin-top: 4px; text-transform: uppercase; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }

/* Precio */
.price-box { margin-top: 5px; display: flex; align-items: center; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255, 120, 0, .2); background: rgba(255, 120, 0, .03); padding: 8px 5px; gap: 0px; }
.old { flex: 1; color: #555; text-decoration: line-through; font-size: 12px; font-weight: 600; padding: 8px 6px; }
.discount { background: #0d0d0d; padding: 6px 10px; border-radius: 8px; box-shadow: 0 0 12px rgba(255, 120, 0, .3); flex-shrink: 0; }
.discount .num { color: #ff7a00; font-size: 15px; line-height: 1; font-weight: 800; }
.discount .txt { color: white; font-size: 9px; font-weight: 700; }
.new { flex: 1; padding: 6px 6px; }
.new .ahora { color: #ff7a00; font-size: 9px; font-weight: 700; }
.new .value { color: white; font-size: 13px; line-height: 1; font-weight: 800; }

/* Colores */
.color-circles-row { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.color-circle {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2.5px solid rgba(255, 255, 255, .12); transition: all 0.2s ease; flex-shrink: 0;
}
.color-circle:hover { transform: scale(1.2); border-color: rgba(255, 255, 255, .5); }
.color-circle.active { border-color: #ff7a00; box-shadow: 0 0 12px rgba(255, 120, 0, .5); transform: scale(1.15); }
.color { color: #666; font-size: 11px; font-weight: 600; min-height: 16px; transition: color 0.2s ease; }
.color.active-label { color: #ccc; }

/* Tallas */
.sizes { display: flex; justify-content: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.size {
  width: 36px; height: 28px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .1);
  background: #101827; color: white; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; font-family: 'Poppins', sans-serif;
}
.size:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 120, 0, .4); }
.size.active { background: white; color: black; box-shadow: 0 0 8px rgba(255, 120, 0, .3); }
/* ✅ Talla sin stock — tachada y no seleccionable */
.size.sin-stock {
  text-decoration: line-through;
  color: #555 !important;
  border-color: rgba(255, 255, 255, .05) !important;
  background: #0a0a0a !important;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}
.talla-btn.sin-stock {
  text-decoration: line-through;
  color: #555 !important;
  border-color: rgba(255, 255, 255, .05) !important;
  background: #0a0a0a !important;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

/* Info */
.info {
  margin-top: 8px; border-radius: 10px; padding: 10px 12px;
  border: 1px solid rgba(255, 120, 0, .15);
  background: linear-gradient(90deg, rgba(255, 120, 0, .08), rgba(255, 120, 0, .02));
  display: flex; align-items: center; gap: 10px; text-align: left;
}
.info .icon { font-size: 22px; flex-shrink: 0; }
.info h3 { color: white; font-size: 11px; font-weight: 700; }
.info p { color: #777; margin-top: 1px; font-size: 10px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* Botón agregar */
.btn-add-card {
  width: 100%; margin-top: 10px; padding: 10px;
  background: linear-gradient(135deg, #ff7a00, #e06500); color: white;
  border: none; border-radius: 10px; font-family: 'Poppins', sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.2s ease; letter-spacing: 0.5px; text-transform: uppercase;
}
.btn-add-card:hover { background: linear-gradient(135deg, #ff8c1a, #ff7a00); box-shadow: 0 4px 20px rgba(255, 122, 0, .35); }
.btn-add-card:active { transform: scale(0.97); }

/* Precio PC - sin corte ni desborde */
@media (min-width: 769px) {
  .price-box { max-width: 100%; box-sizing: border-box; flex-wrap: nowrap; justify-content: center; }
  .old { flex: 0 0 auto; white-space: nowrap; padding: 8px 8px; min-width: 0; }
  .discount { flex: 0 0 auto; margin: 0 4px; padding: 6px 10px; min-width: 0; }
  .new { flex: 0 0 auto; white-space: nowrap; padding: 6px 8px; min-width: 0; }
  .old, .new .value { overflow: hidden; text-overflow: ellipsis; }
}

/* ✅ GRIDS AUTOMÁTICOS - Se adaptan solos al ancho disponible */
#category-products-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
#top-ventas-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}
#categoriesGrid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  justify-content: center;
}
.category-card-large {
  width: 100%;
}

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  13. FILTROS LATERALES                                        ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.filter-sidebar {
  background: linear-gradient(180deg, #0f0f0f, #0a0a0a);
  border-right: 1px solid rgba(255, 255, 255, .06);
  padding: 20px 16px; width: 240px; flex-shrink: 0; overflow-y: auto;
}
.filter-sidebar::-webkit-scrollbar { width: 3px; }
.filter-sidebar::-webkit-scrollbar-track { background: transparent; }
.filter-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 120, 0, .3); border-radius: 10px; }
.filter-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.filter-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filter-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 13px; color: #ff7a00;
  letter-spacing: 3px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.filter-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 120, 0, .3), transparent); }
.filter-checkbox { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; margin-bottom: 2px; }
.filter-checkbox:hover { background: rgba(255, 255, 255, .04); }
.filter-checkbox input[type="checkbox"] { display: none; }
.filter-checkbox .check-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid rgba(255, 255, 255, .15); background: #0d0d0d; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.filter-checkbox .check-box svg { width: 10px; height: 10px; opacity: 0; transform: scale(0.5); transition: all 0.15s ease; }
.filter-checkbox input:checked + .check-box { background: #ff7a00; border-color: #ff7a00; box-shadow: 0 0 10px rgba(255, 120, 0, .3); }
.filter-checkbox input:checked + .check-box svg { opacity: 1; transform: scale(1); }
.filter-checkbox .check-label { font-size: 13px; color: #999; font-weight: 500; transition: color 0.2s ease; }
.filter-checkbox:hover .check-label { color: #ccc; }
.filter-checkbox input:checked ~ .check-label { color: #fff; font-weight: 600; }

/* Select */
.filter-sidebar select.form-input {
  background: #0d0d0d; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px;
  color: #ccc; font-size: 13px; padding: 10px 12px; cursor: pointer; transition: border-color 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filter-sidebar select.form-input:hover { border-color: rgba(255, 120, 0, .3); }
.filter-sidebar select.form-input:focus { border-color: rgba(255, 120, 0, .5); outline: none; box-shadow: 0 0 0 2px rgba(255, 120, 0, .1); }

/* Range slider */
.range-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #ff7a00, #333); outline: none; cursor: pointer; }
.range-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #ff7a00; border: 3px solid #0a0a0a; box-shadow: 0 0 10px rgba(255, 120, 0, .4); cursor: pointer; transition: transform 0.15s ease; }
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.range-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #ff7a00; border: 3px solid #0a0a0a; box-shadow: 0 0 10px rgba(255, 120, 0, .4); cursor: pointer; }
.price-filter-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 6px 0; }
.price-filter-label span { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 1px; }
.price-filter-label .price-value { font-size: 14px; color: #ff7a00; font-weight: 700; font-family: 'Poppins', sans-serif; }
#mobile-filter-toggle { background: linear-gradient(135deg, #ff7a00, #e06500); border: none; border-radius: 10px; box-shadow: 0 4px 15px rgba(255, 120, 0, .3); }

/* Botón cerrar filtros mobile */
.mobile-filter-close-btn { position: sticky; bottom: 0; left: 0; right: 0; z-index: 5; padding: 0 4px; }

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  14. CARRITO                                                   ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.cart-item { display: flex; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 60px; height: 60px; object-fit: contain; border-radius: 6px; background: #111; padding: 4px; }
.qty-control { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.qty-btn { width: 24px; height: 24px; border-radius: 4px; background: rgba(255,255,255,0.1); border: none; color: white; cursor: pointer; }
.qty-btn:hover { background: var(--accent); }

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  15. CHECKOUT                                                  ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.split-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: 30px; align-items: flex-start; }
.summary-container-checkout { margin-top: 20px; }
.option-card {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 15px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s ease; display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.option-card:hover { border-color: rgba(255, 77, 0, 0.5); }
.option-card.selected { border-color: var(--accent); background: rgba(255, 77, 0, 0.1); }

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  22. WHATSAPP FLOTANTE                                         ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.whatsapp-float {
  position: fixed; width: 60px; height: 60px; bottom: 25px; right: 25px;
  background-color: #25D366; border-radius: 50%; text-align: center;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.4); z-index: 150;
  display: flex; align-items: center; justify-content: center;
  animation: whatsapp-pulse 2.5s infinite; transition: transform 0.3s ease;
}
.whatsapp-float:hover { transform: scale(1.1); animation: none; }

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  23. CHAT FLOW STUDIO - WIDGET FLOTANTE                       ║
   ╚══════════════════════════════════════════════════════════════════╝ */
/* Botón flotante */
.chat-float-btn {
  position: fixed; bottom: 105px; right: 24px; z-index: 150;
  width: 70px; height: 70px; border-radius: 50%;
  box-shadow: 0 1px 1px rgba(255, 77, 0, 0.4), 0 0 0 0 rgba(255, 77, 0, 0.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: chatPulse 3s ease-in-out infinite;
}
.chat-float-btn:hover { transform: scale(1.1); box-shadow: 0 6px 30px rgba(255, 77, 0, 0.6); }
.chat-float-btn:active { transform: scale(0.95); }
.chat-badge {
  position: absolute; top: -4px; right: -4px;
  width: 22px; height: 22px; background: #ff0000; color: white;
  font-size: 11px; font-weight: 700; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #0f0f0f; animation: chatBadgePop 0.3s ease-out;
}

/* Widget contenedor */
.chat-widget {
  position: fixed; bottom: 170px; right: 24px; z-index: 150;
  width: 380px; max-width: calc(100vw - 48px); height: 520px; max-height: calc(100vh - 200px);
  background: #141414; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 77, 0, 0.1);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chat-widget.hidden { opacity: 0; transform: scale(0.5) translateY(20px); pointer-events: none; }
.chat-widget:not(.hidden) { opacity: 1; transform: scale(1) translateY(0); pointer-events: all; }

/* Header */
.chat-header {
  background: linear-gradient(135deg, #ff4d00 0%, #cc3d00 100%);
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 12px; }
.chat-header-title { margin: 0; font-size: 16px; font-weight: 700; color: white; letter-spacing: 0.5px; }
.chat-header-sub { margin: 2px 0 0; font-size: 11px; color: rgba(255, 255, 255, 0.8); display: flex; align-items: center; gap: 5px; }
.chat-header-sub::before { content: ''; width: 6px; height: 6px; background: #4ade80; border-radius: 50%; display: inline-block; }
.chat-close-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.15); color: white; font-size: 20px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.chat-close-btn:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); }

/* Body */
.chat-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #0f0f0f; }
.chat-screen { flex: 1; display: flex; flex-direction: column; padding: 24px; overflow-y: auto; }
.chat-screen.hidden { display: none !important; }

/* Welcome */
.chat-welcome { text-align: center; padding: 20px 0; }
.chat-welcome-icon { margin: 0 auto 16px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 77, 0, 0.1); display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255, 77, 0, 0.2); }
.chat-welcome-title { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: white; }
.chat-welcome-text { margin: 0; font-size: 13px; color: #888; line-height: 1.5; }

/* Form */
.chat-form-group { display: flex; gap: 10px; margin-top: 20px; }
.chat-input {
  flex: 1; padding: 14px 18px; background: #1a1a1a;
  border: 1px solid #333; border-radius: 12px; color: white; font-size: 14px; outline: none; transition: border-color 0.2s;
}
.chat-input::placeholder { color: #555; }
.chat-input:focus { border-color: #ff4d00; box-shadow: 0 0 0 3px rgba(255, 77, 0, 0.1); }
.chat-send-btn {
  width: 48px; height: 48px; border-radius: 12px; border: none;
  background: #ff4d00; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0;
}
.chat-send-btn:hover { background: #ff6a2a; transform: scale(1.05); }
.chat-send-btn:active { transform: scale(0.95); }
.chat-send-btn:disabled { background: #333; cursor: not-allowed; transform: none; }
.chat-disclaimer { text-align: center; font-size: 11px; color: #555; margin-top: 16px; padding-top: 16px; border-top: 1px solid #222; }

/* Mensajes */
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.chat-bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 13px; line-height: 1.5; word-wrap: break-word; animation: chatBubbleIn 0.3s ease-out; }
.chat-bubble-user { align-self: flex-end; background: linear-gradient(135deg, #ff4d00, #ff6a2a); color: white; border-bottom-right-radius: 4px; }
.chat-bubble-asesor { align-self: flex-start; background: #1e1e1e; color: #e0e0e0; border: 1px solid #2a2a2a; border-bottom-left-radius: 4px; }
.chat-bubble-time { font-size: 10px; color: rgba(255, 255, 255, 0.5); margin-top: 4px; text-align: right; }
.chat-bubble-asesor .chat-bubble-time { color: #666; }

/* Typing */
.chat-typing { align-self: flex-start; padding: 12px 18px; background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 16px; border-bottom-left-radius: 4px; display: none; }
.chat-typing.active { display: flex; gap: 4px; align-items: center; }
.chat-typing-dot { width: 7px; height: 7px; background: #666; border-radius: 50%; animation: chatTypingDot 1.4s ease-in-out infinite; }
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* System msg */
.chat-system-msg { align-self: center; font-size: 11px; color: #555; background: rgba(255, 255, 255, 0.03); padding: 6px 14px; border-radius: 20px; margin: 8px 0; }

/* Input area (chat activo) */
.chat-input-area { padding: 12px 16px; background: #141414; border-top: 1px solid #222; display: flex; gap: 10px; flex-shrink: 0; }

/* Loading */
.chat-loading { display: flex; align-items: center; justify-content: center; padding: 20px; gap: 8px; }
.chat-loading-dot { width: 8px; height: 8px; background: #ff4d00; border-radius: 50%; animation: chatLoadDot 1s ease-in-out infinite; }
.chat-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.chat-loading-dot:nth-child(3) { animation-delay: 0.3s; }

/* Flash */
.chat-flash { animation: chatFlash 0.5s ease-in-out 3; }

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  29. USER UI                                                   ║
   ╚══════════════════════════════════════════════════════════════════╝ */
.user-icon-btn { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.user-icon-btn:hover { background: rgba(255,255,255,0.1); }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; color: white; }
.user-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 10px; width: 200px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 300;
  opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s ease;
}
.user-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: block; width: 100%; padding: 12px 16px; text-align: left; background: none; border: none; color: var(--fg-primary); cursor: pointer; transition: background 0.2s; font-size: 14px; }
/* FIX: las opciones ocultas del menú de usuario deben seguir ocultas aunque sean .dropdown-item */
#user-dropdown .dropdown-item.hidden { display: none !important; }
.dropdown-item:hover { background: rgba(255,255,255,0.05); }
.dropdown-item.logout { color: #ef4444; border-top: 1px solid var(--border); }

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  38. APP CLIENTE (Panel del cliente)                           ║
   ╚══════════════════════════════════════════════════════════════════╝ */
#app-cliente { display: none; height: 100vh; overflow: hidden; }
#app-cliente .admin-layout { height: 100%; }
#app-cliente .admin-main { height: 100%; overflow-y: auto; overflow-x: hidden; }
.cliente-profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cliente-profile-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff6a2c);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-family: 'Bebas Neue', sans-serif; color: white;
  margin-bottom: 1rem; box-shadow: 0 10px 25px rgba(255, 77, 0, 0.2);
}
.cliente-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.cliente-info-item { background: rgba(255,255,255,0.03); padding: 12px 16px; border-radius: 6px; border: 1px solid var(--border); }
.cliente-info-label { display: block; font-size: 11px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; letter-spacing: 1px; }
.cliente-info-value { color: white; font-weight: 500; }

/* Customer portal layout (store side only). */
#app-cliente .admin-layout { display:flex; height:100%; position:relative; }
#app-cliente .admin-sidebar { width:var(--sidebar-width); background:var(--bg-secondary); border-right:1px solid var(--border); padding:24px; display:flex; flex-direction:column; overflow-y:auto; transition:transform .3s ease; z-index:50; }
#app-cliente .admin-main { flex:1; padding:40px; overflow-y:auto; background:var(--bg-primary); transition:filter .3s; position:relative; height:100%; overflow-x:hidden; }
#app-cliente .admin-nav-item { position:relative; display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:6px; color:#9ca3af; cursor:pointer; transition:all .2s; font-size:14px; margin-bottom:4px; }
#app-cliente .admin-nav-item:hover { background:rgba(255,255,255,.05); color:white; }
#app-cliente .admin-nav-item.active-tab { background:rgb(255 255 255 / 15%); color:#fff; font-weight:600; }
#app-cliente .admin-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-md); padding:24px; margin-bottom:20px; }
/* Store responsive */
@media (min-width:1441px){.slideshow-container{margin-top:130px}.slideshow-caption{padding:70px 40px 50px}}
@media (min-width:769px){.slideshow-container{margin-top:130px}}
@media (max-width:1024px){.category-modal-container{grid-template-columns:240px 1fr}.filter-sidebar{width:240px;padding:16px 12px}}
@media (max-width:768px){
.py-24{padding-top:2rem;padding-bottom:2rem} section .max-w-7xl{padding-left:1rem;padding-right:1rem}.hamburger{display:flex}#nav-links-container{display:none}.slideshow-container{padding:0 10px 10px;margin-top:120px}.slide{top:0;left:0;right:0;bottom:0;border-radius:var(--radius-md)}.slideshow-caption{padding:40px 16px 32px}.slider-dots{bottom:12px;gap:6px}.dot{width:8px;height:8px}.slider-close-btn{top:20px;right:20px;width:34px;height:34px;font-size:18px}.category-modal-container{grid-template-columns:1fr}.filter-sidebar{position:fixed;left:0;top:0;height:100%;z-index:60;transform:translateX(-100%);box-shadow:0 0 30px rgba(0,0,0,.5);width:280px;padding-top:60px}.filter-sidebar.active{transform:translateX(0)}.split-layout{grid-template-columns:1fr;gap:20px}.summary-container-checkout{margin-top:20px}.category-card-large{height:280px}.btn-add-card{opacity:1;transform:translateY(0);pointer-events:all}.card:hover{border-color:rgba(255,255,255,.06);box-shadow:0 10px 40px rgba(0,0,0,.7)}.price-box{flex-direction:column;align-items:center;text-align:center;gap:1px;padding:8px 6px}.old{order:1;padding:2px 6px;width:100%;text-align:center;border-bottom:1px solid rgba(255,255,255,.06);margin-bottom:4px}.discount{order:2;margin:4px 0;padding:6px 16px;width:auto;display:inline-flex}.new{order:3;padding:4px 6px;width:100%;text-align:center;border-top:1px solid rgba(255,255,255,.06);padding-top:6px;margin-top:2px}.new .ahora{font-size:8px;letter-spacing:2px;margin-bottom:0}.new .value{font-size:18px;line-height:1.1}footer .grid{grid-template-columns:1fr!important}.chat-widget{bottom:0;right:0;width:100%;max-width:100%;height:100%;max-height:100%;border-radius:0}.chat-float-btn{bottom:90px;right:16px;width:52px;height:52px}.qty-btn{width:32px;height:32px}
#app-cliente .admin-layout{flex-direction:column}#app-cliente .admin-sidebar{position:fixed;left:0;top:0;height:100%;transform:translateX(-100%);box-shadow:none;width:280px;z-index:100}#app-cliente .admin-sidebar.active{transform:translateX(0);box-shadow:0 0 30px rgba(0,0,0,.5)}#app-cliente .admin-main{width:100%;padding:20px;padding-top:60px;margin-left:0}
}
@media (max-width:480px){.whatsapp-float{width:50px;height:50px;bottom:15px;right:15px}.whatsapp-float svg{width:28px;height:28px}.slideshow-caption{padding:30px 14px 28px}.slideshow-caption__heading{font-size:clamp(1.6rem,9vw,2.8rem)}.slideshow-caption__subheading{font-size:clamp(.8rem,2.5vw,.95rem)}.slideshow-caption .btn-primary{padding:11px 22px;font-size:12px}.category-card-large{height:200px}.category-card-overlay h3{font-size:clamp(1.5rem,6vw,2.5rem)}.category-card-overlay p{font-size:12px}.category-card-overlay .btn-primary{padding:8px 20px;font-size:12px}.top{height:180px;margin:8px;border-radius:10px}.product{max-height:150px}.title{font-size:13px;min-height:32px}.new .value{font-size:16px}.discount .num{font-size:15px}.size{width:30px;height:24px;font-size:10px}.brand,.color{font-size:10px}.info{padding:8px 10px;gap:8px}.info .icon{font-size:18px}.info h3{font-size:10px}.info p{font-size:9px}.btn-add-card{padding:8px;font-size:11px}.color-circle{width:24px;height:24px}.color-circles-row{gap:6px}.discount{padding:5px 14px}.discount .num{font-size:14px}.brands-track>div{padding-left:24px;padding-right:24px}.qty-btn{width:28px;height:28px}.filter-checkbox{padding:6px 8px}.filter-checkbox .check-box{width:16px;height:16px}.filter-checkbox .check-label{font-size:12px}.historial-producto-card{padding:12px}.chat-float-btn{bottom:80px}}


/* ================================================================
   FIX MOBILE — MODAL DE CATEGORÍAS Y FILTROS
   ================================================================ */
@media (max-width: 768px) {
    /* El modal de categoría debe ocupar una altura controlada.
       Evitamos el height:100vh heredado del modal base. */
    #category-modal {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    #category-modal .category-modal-container {
        width: 100% !important;
        height: 92dvh !important;
        max-height: 92dvh !important;
        min-height: 0 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr !important;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
        overflow: hidden !important;
        transform: translateY(100%);
    }

    #category-modal.active .category-modal-container {
        transform: translateY(0) !important;
    }

    /* El main no debe heredar el flex:1/overflow del modal genérico. */
    #category-modal .category-modal-container > main.modal-body {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
    }

    /* Cabecera fija y compacta. */
    #category-modal .category-modal-container > main.modal-body > .sticky {
        position: relative !important;
        top: auto !important;
        flex: 0 0 72px !important;
        height: 72px !important;
        min-height: 72px !important;
        width: 100% !important;
        padding: 10px 12px !important;
        box-sizing: border-box !important;
        z-index: 20 !important;
    }

    #category-modal-title {
        font-size: 22px !important;
        line-height: 1 !important;
        padding-left: 72px !important;
        padding-right: 40px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #category-modal #product-count {
        padding-left: 72px !important;
        font-size: 11px !important;
    }

    /* Un solo contenedor con scroll para los productos. */
    #category-modal .category-modal-container > main.modal-body > .p-6 {
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #category-modal #category-products-grid {
        width: 100% !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Botón Filtros. */
    #mobile-filter-toggle {
        position: absolute !important;
        top: 12px !important;
        left: 12px !important;
        z-index: 50 !important;
        padding: 8px 11px !important;
        font-size: 11px !important;
        line-height: 1 !important;
        min-height: 32px !important;
        width: auto !important;
        border-radius: 9px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    #mobile-filter-toggle svg {
        width: 13px !important;
        height: 13px !important;
        flex: 0 0 auto !important;
    }

    /* Panel lateral de filtros móvil. */
    #category-modal #filter-panel {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: min(86vw, 330px) !important;
        height: 100dvh !important;
        max-height: none !important;
        padding: 16px !important;
        padding-top: 16px !important;
        margin: 0 !important;
        z-index: 1000 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transform: translateX(-105%) !important;
        transition: transform .25s ease !important;
        box-shadow: 12px 0 35px rgba(0,0,0,.55) !important;
    }

    #category-modal #filter-panel.active {
        transform: translateX(0) !important;
    }

    #category-modal #filter-panel .modal-x-btn {
        display: flex !important;
        width: 36px !important;
        height: 36px !important;
    }

    /* Evitar que el body se mueva detrás del panel. */
    body.filter-mobile-open {
        overflow: hidden !important;
        touch-action: none !important;
    }

    /* Tarjetas en pantallas pequeñas. */
    #category-modal .card {
        width: 100% !important;
        min-width: 0 !important;
    }

    #category-modal .top {
        height: 180px !important;
        margin: 8px !important;
    }

    #category-modal .product {
        width: auto !important;
        height: auto !important;
        max-width: 165px !important;
        max-height: 165px !important;
        object-fit: contain !important;
    }
}

@media (max-width: 480px) {
    #category-modal .category-modal-container {
        height: 94dvh !important;
        max-height: 94dvh !important;
    }

    #category-modal .category-modal-container > main.modal-body > .sticky {
        flex-basis: 68px !important;
        height: 68px !important;
        min-height: 68px !important;
    }

    #category-modal-title {
        font-size: 20px !important;
    }

    #category-modal .top {
        height: 165px !important;
    }

    #category-modal .product {
        max-width: 150px !important;
        max-height: 150px !important;
    }
}


/* ============================================================
   MOBILE HAMBURGER — BUSCADOR PRIMERO
   El buscador real se mueve al slot del menú móvil. No se duplica
   el input, por lo que conserva toda la lógica de búsqueda existente.
   ============================================================ */
.mobile-search-slot {
    width: min(520px, 100%);
    flex: 0 0 auto;
    margin: 0 auto 18px;
    display: flex;
    justify-content: center;
    order: -1;
}

#mobileMenu .mobile-search-slot .store-search-wrap {
    width: 100%;
    display: block;
    z-index: 130;
}

#mobileMenu .mobile-search-slot .store-search-toggle {
    display: none;
}

#mobileMenu .mobile-search-slot .store-search-panel {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

#mobileMenu .mobile-search-slot .store-search-input-shell {
    height: 52px;
    width: 100%;
    border-radius: 14px;
    background: rgba(9,14,20,.94);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 12px 30px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.04);
}

#mobileMenu .mobile-search-slot #store-search-input {
    font-size: 14px;
}

#mobileMenu .mobile-search-slot .store-search-kbd {
    display: none;
}

#mobileMenu .mobile-search-slot .store-search-status {
    padding: 9px 4px 4px;
    text-align: left;
}

#mobileMenu .mobile-search-slot .store-search-results {
    max-height: 42vh;
    margin-top: 8px;
    border-radius: 12px;
}

#mobileMenu .mobile-search-slot .store-search-result {
    grid-template-columns: 48px minmax(0,1fr) auto;
    padding: 9px;
}

@media (min-width: 769px) {
    #mobile-search-slot {
        display: none !important;
    }
}

@media (max-width: 768px) {
    #mobileMenu {
        justify-content: flex-start;
        align-items: stretch;
        padding: calc(82px + env(safe-area-inset-top)) 20px 34px;
    }

    #mobile-links-container {
        align-items: stretch;
        gap: 0;
        width: 100%;
    }
}
