/* ========================================================= */
/* --- CONFIGURACIÓN BASE: TEMA GITHUB DARK (GLASSMORPHISM) --- */
/* ========================================================= */
:root {
    --bg-base: #0d1117; 
    --bg-surface: #161b22; 
    --bg-glass: rgba(22, 27, 34, 0.7); 
    
    --text-primary: #f0f6fc; 
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --brand-blue: #1f6feb; 
    --brand-blue-light: #58a6ff; 
    --brand-blue-hover: #388bfd;
    --glow-color: rgba(31, 111, 235, 0.15); 
    
    --border-light: rgba(240, 246, 252, 0.1);
    --border-strong: rgba(240, 246, 252, 0.2);
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.8);
    --shadow-blue: 0 0 20px rgba(88, 166, 255, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        linear-gradient(rgba(240, 246, 252, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 246, 252, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; color: var(--text-primary); }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ========================================================= */
/* --- HEADER FLOTANTE --- */
/* ========================================================= */
.floating-header {
    margin: 20px auto; width: 95%; max-width: 1400px; padding: 12px 24px;
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light); border-radius: 40px;
    position: sticky; top: 20px; z-index: 2000;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1); box-shadow: var(--shadow-sm);
}
.floating-header.scrolled {
    width: 100%; max-width: 100%; margin: 0; top: 0; border-radius: 0;
    background: rgba(13, 17, 23, 0.95); box-shadow: var(--shadow-md); border-bottom: 1px solid var(--border-light);
}
.logo img { height: 45px; width: auto; transition: transform 0.3s; filter: drop-shadow(0 0 8px rgba(255,255,255,0.2)); }
.logo:hover img { transform: scale(1.05); }

/* Buscador Central */
.search-wrapper { flex: 1; display: flex; justify-content: center; padding: 0 24px; }
.search-container {
    position: relative; display: flex; align-items: center; background: var(--bg-surface);
    border-radius: 20px; padding: 8px 24px; border: 1px solid var(--border-light); transition: all 0.3s; width: 100%; max-width: 450px;
}
.search-container:focus-within { background: var(--bg-base); border-color: var(--brand-blue-light); box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15); max-width: 550px; }
.search-container input { border: none; outline: none; background: transparent; font-family: 'Inter', sans-serif; padding: 4px 8px; width: 100%; color: var(--text-primary); font-size: 0.95rem; }
.search-container input::placeholder { color: var(--text-muted); }
.search-container button { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: color 0.2s; }
.search-container:focus-within button, .search-container button:hover { color: var(--brand-blue-light); }

.autocomplete-results {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); margin-top: 12px; max-height: 350px; overflow-y: auto; box-shadow: var(--shadow-lg); z-index: 1000;
}
.autocomplete-results div { padding: 14px 20px; cursor: pointer; border-bottom: 1px solid var(--border-light); font-size: 0.9rem; transition: background 0.2s; color: var(--text-primary); }
.autocomplete-results div:hover { background: var(--bg-base); color: var(--brand-blue-light); }

nav ul { display: flex; gap: 32px; }
nav a { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); transition: all 0.2s; position: relative; }
nav a:hover { color: var(--text-primary); }
nav a::after { content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 2px; background: var(--brand-blue-light); transition: width 0.3s ease; }
nav a:hover::after { width: 100%; }

/* ========================================================= */
/* --- HERO SECTION --- */
/* ========================================================= */
.bg-hero-text {
    position: absolute; top: 15vh; left: 50%; transform: translateX(-50%); font-size: 15vw; font-weight: 900;
    color: rgba(255, 255, 255, 0.02); z-index: 0; pointer-events: none; letter-spacing: -0.05em; font-family: 'Outfit', sans-serif; transition: opacity 0.1s linear;
}
.hero-glow {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 80vw; height: 70vh;
    background: radial-gradient(circle at top, var(--glow-color) 0%, transparent 60%); z-index: 0; pointer-events: none;
}
.hero-github-style { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 80px 20px 40px; max-width: 900px; margin: 0 auto; }
.hero-badge-glass {
    display: inline-flex; align-items: center; background: rgba(255,255,255,0.05); border: 1px solid var(--border-light);
    color: var(--text-secondary); padding: 8px 16px; border-radius: 30px; font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 600; margin-bottom: 24px; backdrop-filter: blur(10px);
}
.pulse-dot { width: 8px; height: 8px; background-color: #3fb950; border-radius: 50%; margin-right: 8px; animation: pulse 2s infinite; }
@keyframes pulse {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.7); }
    70% { opacity: 0.3; box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}
.hero-github-style h1 { font-size: 4.5rem; line-height: 1.1; font-weight: 800; margin: 10px 0 20px; letter-spacing: -2px; }
.text-gradient-blue { background: linear-gradient(to right, #ffffff, var(--brand-blue-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-github-style p { font-size: 1.25rem; color: var(--text-secondary); max-width: 650px; margin-bottom: 40px; }

.btn-primary-glow {
    background: var(--text-primary); color: var(--bg-base); font-weight: 700; padding: 16px 36px; border-radius: 8px;
    border: none; font-size: 1.1rem; cursor: pointer; transition: all 0.3s; box-shadow: 0 0 20px rgba(255, 255, 255, 0.15); font-family: 'Outfit', sans-serif; letter-spacing: 0.5px;
}
.btn-primary-glow:hover { box-shadow: 0 0 30px rgba(255, 255, 255, 0.3); transform: translateY(-2px); background: #ffffff; }

.glass-window-container {
    width: 100%; max-width: 900px; background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light); border-radius: 12px; margin-top: 60px; box-shadow: var(--shadow-md), 0 0 40px var(--glow-color); overflow: hidden; position: relative;
}
.glass-window-header { background: rgba(255, 255, 255, 0.05); padding: 12px 20px; display: flex; align-items: center; border-bottom: 1px solid var(--border-light); }
.window-dots { display: flex; gap: 8px; position: absolute; }
.window-dots span { width: 12px; height: 12px; border-radius: 50%; background: #484f58; }
.window-dots span:nth-child(1) { background: #ff5f56; } 
.window-dots span:nth-child(2) { background: #ffbd2e; } 
.window-dots span:nth-child(3) { background: #27c93f; } 
.window-title { margin-left: auto; margin-right: auto; font-family: monospace; font-size: 0.85rem; color: var(--text-muted); }
.hero-video-glass { width: 100%; display: block; opacity: 0.85; mix-blend-mode: screen; }

/* ========================================================= */
/* --- 🟢 CORRECCIÓN 1: SLIDER INFINITO --- */
/* ========================================================= */
.brands-marquee { padding: 60px 0; text-align: center; border-bottom: 1px solid var(--border-light); overflow: hidden; position: relative; z-index: 2; }
.marquee-title { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; letter-spacing: 1px; text-transform: uppercase; }
.marquee-track {
    width: 100%; 
    overflow: hidden; 
    position: relative;
    /* Reducimos el mask a 2% para que no corte los logos abruptamente */
    mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}
.marquee-content { display: flex; gap: 60px; width: max-content; animation: scroll 30s linear infinite; align-items: center; }
.brand-logo { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--text-muted); transition: color 0.3s; }
.brand-logo:hover { color: var(--text-primary); }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ========================================================= */
/* --- LAYOUT TIENDA --- */
/* ========================================================= */
.shop-container { max-width: 1600px; margin: 60px auto 100px; padding: 0 2%; display: grid; grid-template-columns: 240px 1fr 340px; gap: 30px; align-items: start; position: relative; z-index: 2; }
.shop-sidebar, .cart-sidebar {
    position: sticky; top: 100px; height: calc(100vh - 120px); background: var(--bg-surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; z-index: 10; overflow: hidden; 
}
.shop-sidebar { padding: 32px 24px; overflow-y: auto; }
.filters-toggle { display: none; }
.filters-panel { display: block !important; }
.filter-section h3 { font-size: 1.1rem; margin-bottom: 20px; color: var(--text-primary); font-weight: 700; }
.filters { display: flex; flex-direction: column; gap: 8px; }
.filter-btn {
    background: transparent; border: 1px solid transparent; padding: 12px 16px; border-radius: 12px; cursor: pointer;
    font-family: 'Inter', sans-serif; font-weight: 500; font-size: 0.95rem; color: var(--text-secondary); text-align: left; transition: all 0.2s ease;
}
.filter-btn:hover { background: var(--bg-base); color: var(--brand-blue-light); transform: translateX(4px); }
.filter-btn.active { background: var(--glow-color); color: var(--brand-blue-light); font-weight: 700; border-color: rgba(88, 166, 255, 0.2); }

.shop-main { min-height: 500px; }
.shop-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border-strong); }
.productos-contador { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

/* ========================================================= */
/* --- TARJETAS DE PRODUCTO (PC) --- */
/* ========================================================= */
.productos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

.product-card {
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(13, 17, 23, 0.5) 100%);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md); padding: 24px; display: flex; flex-direction: column;
    border: 1px solid var(--border-light); position: relative; transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.product-card:hover {
    transform: translateY(-8px); border-color: var(--brand-blue-light); box-shadow: var(--shadow-lg), 0 0 30px var(--glow-color);
}
.product-image {
    width: 100%; height: 200px; object-fit: contain; background: #ffffff; border-radius: 8px;
    padding: 16px; margin-bottom: 24px; transition: transform 0.5s ease;
}
.product-card:hover .product-image { transform: scale(1.05); }

.product-card .codigo { font-family: 'Courier New', Courier, monospace; font-size: 0.8rem; color: var(--text-muted); background: var(--bg-base); border: 1px solid var(--border-light); padding: 4px 8px; border-radius: 4px; margin-bottom: 12px; width: max-content; }
.product-card h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 12px; color: var(--text-primary); line-height: 1.4; flex-grow: 1; }
.product-card .precio { font-family: 'Outfit', sans-serif; font-size: 1.8rem; font-weight: 800; color: var(--brand-blue-light); margin: 0 0 16px; }
.product-card .stock { font-size: 0.85rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; margin-bottom: 24px; font-weight: 500; }
.product-card .stock.sin-stock { color: #f85149; }

.product-card button {
    background: var(--bg-base); color: var(--brand-blue-light); border: 1px solid var(--border-strong); border-radius: 6px;
    padding: 14px 24px; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: all 0.3s; width: 100%;
}
.product-card:hover button { background: var(--brand-blue-hover); color: #fff; border-color: transparent; }
.product-card button:hover { filter: brightness(1.1); }
.product-card button:disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg-base); color: var(--text-muted); }

.badge-low-stock, .badge-new { position: absolute; top: 16px; left: 16px; color: white; padding: 6px 14px; border-radius: 30px; font-size: 0.75rem; font-weight: 700; z-index: 2; box-shadow: var(--shadow-sm); }
.badge-low-stock { background: #d1242f; }
.badge-new { background: #238636; }

/* REGLAS GLOBALES REUBICADAS AQUÍ (Antes estaban al final) */
.product-stock-detail { display: flex; gap: 6px; margin: 8px 0; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; flex-wrap: nowrap; }
.product-stock-detail::-webkit-scrollbar { height: 4px; }
.product-stock-detail::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.sede-badge { background: var(--bg-base); color: var(--text-muted); font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border-strong); white-space: nowrap; flex-shrink: 0; }

/* ========================================================= */
/* --- PRESUPUESTO Y BOTÓN FLOTANTE --- */
/* ========================================================= */
.cart-float {
    display: none; position: fixed; bottom: 40px; right: 40px;
    background: radial-gradient(circle at center, var(--brand-blue-light) 0%, var(--brand-blue) 100%);
    color: white; width: 68px; height: 68px; border-radius: 50%; justify-content: center; align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: var(--shadow-lg), 0 0 15px rgba(88, 166, 255, 0.3); 
    z-index: 1000; cursor: pointer; transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}
.cart-float:hover { transform: scale(1.1) translateY(-5px); box-shadow: var(--shadow-lg), 0 0 30px rgba(88, 166, 255, 0.6); background: radial-gradient(circle at center, #78b8ff 0%, var(--brand-blue-hover) 100%); }
.cart-float svg { filter: drop-shadow(0 0 4px rgba(255,255,255,0.4)); }

.cart-badge {
    position: absolute; top: -5px; right: -5px;
    background: linear-gradient(135deg, #ff7b72 0%, #d1242f 100%); color: #fff;
    font-size: 0.75rem; font-weight: 800; width: 28px; height: 28px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.3); 
}

.cart-header { background: var(--bg-surface); border-bottom: 1px solid var(--border-strong); padding: 24px; display: flex; justify-content: space-between; align-items: center; }
.cart-header h3 { font-size: 1.2rem; margin: 0; color: var(--text-primary); }
.cart-close { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.cart-body { padding: 20px; flex: 1; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); margin-bottom: 12px; transition: all 0.2s; background: var(--bg-base); }
.cart-item:hover { border-color: var(--brand-blue-light); }
.cart-item-info h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.cart-item-info .codigo { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; }
.cart-item-info .precio { font-size: 0.95rem; font-weight: 700; color: var(--brand-blue-light); margin-top: 4px; }
.btn-eliminar { background: rgba(209, 36, 47, 0.1); color: #ff7b72; border: none; font-size: 0.8rem; cursor: pointer; padding: 6px 12px; border-radius: 20px; font-weight: 600; transition: all 0.2s; }
.btn-eliminar:hover { background: #d1242f; color: white; }
.cart-footer { padding: 24px; background: var(--bg-surface); border-top: 1px solid var(--border-strong); }
.presupuesto-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.presupuesto-total span { color: var(--text-secondary); font-weight: 600; font-size: 0.9rem; }
.presupuesto-total h2 { color: var(--brand-blue-light); font-size: 1.5rem; margin: 0; font-family: 'Outfit', sans-serif; }

/* ========================================================= */
/* --- BOTONES Y UTILIDADES --- */
/* ========================================================= */
.btn-primary { background: var(--brand-blue); color: #fff; border: none; border-radius: 6px; padding: 16px 32px; font-weight: 700; font-size: 1.05rem; cursor: pointer; transition: all 0.3s; display: inline-block; font-family: 'Inter', sans-serif; }
.btn-primary:hover { background: var(--brand-blue-hover); }
.btn-secondary { background: var(--bg-base); border: 1px solid var(--border-strong); color: var(--text-primary); border-radius: 6px; padding: 14px 24px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.btn-secondary:hover { border-color: var(--text-primary); }
.btn-whatsapp { width: 100%; padding: 16px; background: #238636; color: white; border: none; border-radius: 6px; font-weight: 700; font-size: 1.05rem; cursor: pointer; transition: all 0.3s; text-transform: uppercase; }
.btn-whatsapp:hover { background: #2ea043; }

.spinner-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 100px 20px; }
.back-to-top { position: fixed; bottom: 120px; right: 40px; width: 48px; height: 48px; background: var(--bg-surface); border: 1px solid var(--border-strong); color: var(--text-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 999; }
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { border-color: var(--brand-blue-light); color: var(--brand-blue-light); }

.notificacion { position: fixed; bottom: 40px; left: 40px; background: #238636; color: white; padding: 16px 32px; border-radius: 12px; font-weight: 600; font-size: 1rem; box-shadow: var(--shadow-lg); z-index: 2000; opacity: 0; transform: translateY(20px); transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1); pointer-events: none; }
.notificacion.mostrar { opacity: 1; transform: translateY(0); }

/* ========================================================= */
/* --- VISOR DE IMÁGENES (PREMIUM) --- */
/* ========================================================= */
.modal-imagen {
    display: none; position: fixed; z-index: 4000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    justify-content: center; align-items: center; padding: 20px;
}
.modal-imagen-content {
    position: relative; max-width: 90vw; max-height: 85vh; border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px var(--glow-color); background: var(--bg-surface);
    padding: 10px; border: 1px solid var(--border-strong); transform-origin: center center;
}
#modal-imagen-img { max-width: 100%; max-height: calc(85vh - 20px); object-fit: contain; border-radius: 8px; display: block; }
.modal-imagen-close {
    position: absolute; top: -20px; right: -20px; background: var(--bg-surface); color: var(--text-primary);
    width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 1.5rem; cursor: pointer; border: 1px solid var(--border-light); transition: all 0.3s ease; box-shadow: var(--shadow-md); z-index: 10;
}
.modal-imagen-close:hover { background: #d1242f; color: white; transform: scale(1.1) rotate(90deg); }

/* ========================================================= */
/* --- MODALES GENERALES --- */
/* ========================================================= */
.modal { display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(13, 17, 23, 0.8); backdrop-filter: blur(8px); }
.modal-content.modal-cliente { background: var(--bg-surface); border-radius: var(--radius-md); margin: 8% auto; width: 90%; max-width: 500px; border: 1px solid var(--border-strong); overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { padding: 32px 32px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-light); }
.modal-header h2 { margin: 0; font-size: 1.5rem; color: var(--text-primary); }
.close-modal { font-size: 2rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.close-modal:hover { color: var(--text-primary); }
.modal-body { padding: 32px; }
.modal-body p { color: var(--text-secondary); margin-bottom: 24px; font-size: 1rem; }
.cliente-form-modal { display: flex; flex-direction: column; gap: 16px; }
.cliente-form-modal input { width: 100%; padding: 16px; background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: 8px; font-size: 1rem; color: var(--text-primary); font-family: 'Inter', sans-serif; transition: all 0.3s; }
.cliente-form-modal input:focus { border-color: var(--brand-blue-light); outline: none; box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15); }
.modal-footer { padding: 24px 32px 32px; display: flex; gap: 16px; background: var(--bg-base); border-top: 1px solid var(--border-light); }
.modal-footer .btn-secondary { flex: 1; }
.modal-footer .btn-primary { flex: 2; margin-top: 0; background: #238636; }

.cantidad-control { display: flex; gap: 12px; align-items: center; justify-content: center; width: 100%; margin-top: 16px; }
.cantidad-input { width: 80px; padding: 12px; background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: 6px; text-align: center; font-size: 1rem; font-weight: 600; color: var(--text-primary); appearance: textfield; transition: all 0.3s; }
.cantidad-input::-webkit-inner-spin-button, .cantidad-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cantidad-input:focus { border-color: var(--brand-blue-light); outline: none; }

.paginacion { display: flex; justify-content: center; gap: 8px; margin: 60px auto; flex-wrap: wrap; }
.pagina-btn { background: var(--bg-surface); border: 1px solid var(--border-strong); color: var(--text-secondary); border-radius: 6px; padding: 10px 16px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.pagina-btn:hover:not(:disabled) { border-color: var(--text-primary); color: var(--text-primary); }
.pagina-btn.active { background: var(--brand-blue); color: #fff; border-color: transparent; }
.pagina-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========================================================= */
/* --- ESTILOS PARA THREE.JS Y ANIME.JS --- */
/* ========================================================= */
.three-canvas-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100vh; z-index: 0;
    pointer-events: none; opacity: 0.8;
}
.flying-dot {
    position: fixed; width: 16px; height: 16px; background: radial-gradient(circle, #ffffff 0%, var(--brand-blue-light) 60%);
    border-radius: 50%; z-index: 9999; pointer-events: none; box-shadow: 0 0 20px var(--brand-blue-light), 0 0 40px var(--brand-blue-light);
}

/* ========================================================= */
/* --- FOOTER --- */
/* ========================================================= */
footer { background: var(--bg-surface); color: var(--text-secondary); padding: 80px 5% 40px; border-top: 1px solid var(--border-light); }
.footer-container { display: flex; flex-wrap: wrap; gap: 60px; justify-content: space-between; max-width: 1400px; margin: 0 auto; }
.footer-logo { height: 60px; margin-bottom: 24px; filter: drop-shadow(0 0 10px rgba(255,255,255,0.1)); }
.footer-col { flex: 1; min-width: 250px; }
.footer-col h3 { font-family: 'Outfit', sans-serif; font-size: 1.2rem; margin-bottom: 24px; color: var(--text-primary); }
.footer-col p, .footer-col a { color: var(--text-secondary); font-size: 1rem; margin-bottom: 12px; display: block; transition: color 0.2s; }
.footer-col a:hover { color: var(--brand-blue-light); }
.footer-bottom { text-align: center; margin-top: 80px; font-size: 0.9rem; color: var(--text-muted); padding-top: 32px; border-top: 1px solid var(--border-light); }

.mobile-bottom-nav { display: none; }

/* ========================================================= */
/* --- RESPONSIVE / MEDIA QUERIES --- */
/* ========================================================= */
@media (max-width: 1200px) {
    .shop-container { grid-template-columns: 240px 1fr; }
    .cart-float { display: flex; }
    .cart-sidebar {
        position: fixed; top: 0; right: -450px; width: 100%; max-width: 400px; height: 100vh;
        background: var(--bg-surface); z-index: 3000; transition: right 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        border-radius: 0; border-left: 1px solid var(--border-strong); box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
    }
    .cart-sidebar.open { right: 0; }
    .cart-close { display: block; }
}

.menu-toggle { display: none; font-size: 2rem; cursor: pointer; color: var(--text-primary); }

@media (max-width: 1024px) {
    .shop-container { grid-template-columns: 1fr; margin-bottom: 150px; }
    .shop-sidebar { position: static; height: auto; margin-bottom: 32px; padding: 24px; box-shadow: none; }
    
    .filters-toggle { display: block; width: 100%; }
    .toggle-filters-btn { width: 100%; background: var(--bg-base); border: 1px solid var(--border-strong); padding: 16px; border-radius: 12px; font-weight: 700; font-size: 1.1rem; color: var(--text-primary); display: flex; justify-content: center; align-items: center; gap: 12px; }
    .filters-panel { display: none !important; margin-top: 24px; }
    .filters-panel[style*="display: block"] { display: block !important; }
    .filters { flex-direction: row; flex-wrap: wrap; }
    .filter-btn { background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: 30px; padding: 8px 16px; }
    
    .hero-github-style { padding: 40px 16px 20px; }
    .hero-github-style h1 { font-size: 3rem; letter-spacing: -1px; }
    .bg-hero-text { font-size: 22vw; top: 20vh; }
}

@media (max-width: 768px) {
    .floating-header { width: 100%; margin: 0; top: 0; flex-wrap: wrap; padding: 12px 16px; border-radius: 0; gap: 16px; border: none; border-bottom: 1px solid var(--border-strong); box-shadow: none; background: rgba(13, 17, 23, 0.98); }
    .floating-header.scrolled { box-shadow: var(--shadow-sm); border-bottom: 1px solid var(--border-strong); }
    .logo { flex: none; }
    .logo img { height: 35px; } 
    .menu-toggle { display: block; margin-left: auto; }
    nav { display: none; width: 100%; order: 4; margin-top: 16px; }
    nav.active { display: block; }
    nav ul { flex-direction: column; align-items: center; gap: 16px; }
    
    .search-wrapper { order: 3; width: 100%; margin-top: 0; max-width: 100%; padding: 0; }
    .search-container { max-width: 100%; background: var(--bg-base); border-radius: 8px; padding: 8px 16px; }
    .search-container:focus-within { background: var(--bg-surface); }
    .search-container input { font-size: 1rem; }

    .cart-float, .back-to-top { display: none !important; }
    body { padding-bottom: 80px; }
    footer { padding-bottom: 100px; }

    .mobile-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(22, 27, 34, 0.95);
        backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border-strong);
        z-index: 2000; justify-content: space-around; align-items: center; padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    }
    .nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); text-decoration: none; flex: 1; transition: all 0.2s ease; }
    .nav-item span { font-size: 0.7rem; font-weight: 600; font-family: 'Inter', sans-serif; }
    .nav-item.active { color: var(--text-primary); }
    .nav-item.active svg { transform: translateY(-2px); stroke: var(--brand-blue-light); }
    
    .nav-icon-wrapper { position: relative; }
    .cart-badge-nav { position: absolute; top: -6px; right: -10px; background: #d1242f; color: #fff; font-size: 0.65rem; font-weight: 800; width: 20px; height: 20px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 2px solid var(--bg-surface); }
    
    .cart-sidebar { max-width: 100%; }
    .hero-github-style h1 { font-size: 2.2rem; }
    .btn-primary-glow { width: 100%; text-align: center; }

    /* ========================================================= */
    /* --- 🟢 CORRECCIÓN 2: VISTA DE TARJETAS MÓVIL PERFECTA --- */
    /* ========================================================= */
    .productos-grid { grid-template-columns: 1fr; gap: 16px; padding: 0 8px; }
    
    .product-card { 
        display: grid; 
        grid-template-columns: 110px 1fr; 
        grid-template-rows: auto auto auto auto 1fr;
        gap: 4px 16px; 
        padding: 16px; 
        align-items: start; 
    }
    
    .product-image { 
        grid-column: 1; grid-row: 1 / 5; 
        width: 100%; height: 110px; margin: 0; padding: 8px; object-fit: contain; 
        background: #ffffff; border-radius: 8px;
    }
    
    .product-card h3 { grid-column: 2; font-size: 0.95rem; margin: 0; line-height: 1.3; }
    .product-card .codigo { grid-column: 2; font-size: 0.7rem; margin: 2px 0; padding: 2px 6px; width: max-content; }
    .product-card .precio { grid-column: 2; font-size: 1.4rem; margin: 2px 0 0 0; color: var(--brand-blue-light); }
    .product-card .stock { grid-column: 2; font-size: 0.8rem; margin: 0; }
    
    /* Ocultar detalle de sedes en la vista móvil para ahorrar espacio */
.product-stock-detail { 
    display: flex !important; 
    grid-column: 1 / 3; /* Hace que la barra de sedes ocupe todo el ancho inferior */
    width: 100%;
    margin-top: 8px;
    padding-bottom: 4px; /* Pequeño espacio para el scroll horizontal si hay muchas sedes */
}
    
    .cantidad-control { 
        grid-column: 1 / 3; /* Ocupar todo el ancho abajo */
        margin-top: 12px; 
        display: flex;
        justify-content: space-between; 
        gap: 12px; 
    }
    
    .cantidad-input { width: 80px; height: 44px; padding: 0 12px; font-size: 1.1rem; }
    
    /* Botón de agregar más visible en móvil */
    .product-card button { 
        height: 44px; padding: 0 16px; font-size: 1rem; flex: 1; max-width: none; 
        background: var(--brand-blue-light); color: white; border-color: transparent;
    }
    
    .badge-low-stock { top: -10px; left: 10px; font-size: 0.7rem; padding: 4px 12px; box-shadow: none; }

    /* ========================================================= */
    /* --- 🟢 CORRECCIÓN 3: NOTIFICACIÓN MÓVIL ARRIBA DEL MENÚ --- */
    /* ========================================================= */
    .notificacion {
        bottom: 100px; /* Sube la notificación por encima del menú inferior */
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        width: max-content;
        max-width: 90%;
        text-align: center;
        padding: 12px 24px;
    }
    .notificacion.mostrar {
        transform: translateX(-50%) translateY(0);
    }
}
