/* =============================================
   MenToyPlay — Design System v3.0
   Tienda de juguetes armables educativos
   Paleta: Azul profundo + Naranja energético
   ============================================= */

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

/* ── Variables ───────────────────────── */
:root {
    /* Paleta principal */
    --primary:        #1E3A5F;
    --primary-light:  #2563EB;
    --primary-dark:   #152A47;
    --primary-bg:     #EFF6FF;

    --orange:         #FF6B35;
    --orange-light:   #FF8C61;
    --orange-dark:    #E55A25;
    --orange-bg:      #FFF7F4;

    /* Colores por categoría */
    --cat-armables:    #3B82F6;
    --cat-armables-bg: #EFF6FF;
    --cat-cubos:       #8B5CF6;
    --cat-cubos-bg:    #F5F3FF;
    --cat-mesa:        #EC4899;
    --cat-mesa-bg:     #FDF2F8;
    --cat-logica:      #10B981;
    --cat-logica-bg:   #ECFDF5;
    --cat-bloques:     #F59E0B;
    --cat-bloques-bg:  #FFFBEB;
    --cat-puzzles:     #EF4444;
    --cat-puzzles-bg:  #FEF2F2;

    /* Material (compatibilidad con productos.html) */
    --madera:          #92400E;
    --madera-bg:       #FEF3C7;
    --eps:             #2563EB;
    --eps-bg:          #EFF6FF;
    --metal:           #475569;
    --metal-bg:        #F1F5F9;

    /* Dificultad */
    --principiante:    #10B981;
    --medio:           #F59E0B;
    --avanzado:        #EF4444;

    /* Stock */
    --stock-ok:        #10B981;
    --stock-low:       #F59E0B;
    --stock-out:       #EF4444;

    /* Neutrales */
    --white:    #FFFFFF;
    --bg:       #F8FAFC;
    --border:   #E2E8F0;
    --gray-50:  #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --black:    #0F172A;

    /* Tipografía */
    --font-head: 'Nunito', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    /* Alias de compatibilidad */
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-serif: 'Nunito', system-ui, sans-serif;

    /* Espaciado */
    --max-w:      1280px;
    --section-py: 72px;

    /* UI */
    --radius-sm:  6px;
    --radius:     10px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
    --shadow:     0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:  0 12px 40px rgba(0,0,0,0.12);
    --shadow-xl:  0 20px 60px rgba(0,0,0,0.16);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Compatibilidad versión anterior */
    --gold:        #F59E0B;
    --gold-light:  #FCD34D;
    --cream:       #FFF7F4;
    --cream-dark:  #FEF0E8;
}

/* ── Reset ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    color: var(--gray-800);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a  { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Container ───────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Animaciones ─────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* ── Botones ─────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-head);
    letter-spacing: 0.01em;
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--orange);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(255,107,53,0.35);
}
.btn-primary:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,107,53,0.45);
}
.btn-secondary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(30,58,95,0.25);
}
.btn-secondary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30,58,95,0.35);
}
.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.5);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: var(--white); }
.btn-wa {
    background: #25D366;
    color: var(--white);
    box-shadow: 0 4px 14px rgba(37,211,102,0.35);
}
.btn-wa:hover {
    background: #1EB358;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,0.45);
}
.btn-wa:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-sm  { padding: 8px 16px; font-size: 12.5px; }
.btn-lg  { padding: 14px 32px; font-size: 15px; }
.btn-xl  { padding: 18px 40px; font-size: 17px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Badges de categoría ─────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-head);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
}
.badge-armables  { background: var(--cat-armables-bg);  color: var(--cat-armables);  }
.badge-cubos     { background: var(--cat-cubos-bg);     color: var(--cat-cubos);     }
.badge-mesa      { background: var(--cat-mesa-bg);      color: var(--cat-mesa);      }
.badge-logica    { background: var(--cat-logica-bg);    color: var(--cat-logica);    }
.badge-bloques   { background: var(--cat-bloques-bg);   color: var(--cat-bloques);   }
.badge-puzzles   { background: var(--cat-puzzles-bg);   color: var(--cat-puzzles);   }

/* Badges de material (compatibilidad productos.html) */
.badge-material {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
}
.badge-madera { background: var(--madera-bg); color: var(--madera); }
.badge-eps    { background: var(--eps-bg);    color: var(--eps);    }
.badge-metal  { background: var(--metal-bg);  color: var(--metal);  }

.badge-dif { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; }
.badge-dif.principiante { background: #DCFCE7; color: var(--principiante); }
.badge-dif.medio        { background: #FEF3C7; color: var(--medio); }
.badge-dif.avanzado     { background: #FEE2E2; color: var(--avanzado); }

/* ── Stock dot ───────────────────────── */
.stock-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.stock-dot.ok  { background: var(--stock-ok); }
.stock-dot.low { background: var(--stock-low); }
.stock-dot.out { background: var(--stock-out); }

/* ── Section heading ─────────────────── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-head);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 10px;
}
.section-title {
    font-family: var(--font-head);
    font-size: clamp(26px, 3.5vw, 38px);
    font-weight: 900;
    line-height: 1.15;
    color: var(--primary);
    letter-spacing: -0.02em;
}
.section-subtitle {
    font-size: 15px;
    color: var(--gray-500);
    line-height: 1.7;
    max-width: 520px;
    margin-top: 10px;
}

/* ── Toast ───────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--gray-800);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-head);
    z-index: 9999;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
    pointer-events: none;
}
.toast.show  { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--stock-ok); }
.toast.error   { background: var(--stock-out); }

/* ── Spinner ─────────────────────────── */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Loading state ───────────────────── */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 80px;
    color: var(--gray-400);
}

/* ── No results ──────────────────────── */
.no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    color: var(--gray-400);
    text-align: center;
    gap: 16px;
    grid-column: 1/-1;
}
.no-results.show { display: flex; }
.no-results i    { font-size: 48px; }
.no-results h3   { font-family: var(--font-head); font-size: 20px; color: var(--gray-500); }

/* ── Error state ─────────────────────── */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 80px;
    text-align: center;
    grid-column: 1/-1;
}
.error-state i { font-size: 40px; color: var(--stock-out); }

/* ── Retry button ────────────────────── */
.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-head);
    cursor: pointer;
    border: none;
    margin-top: 8px;
    transition: all var(--transition);
}
.btn-retry:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ── Responsive helpers ──────────────── */
@media (max-width: 768px) { .container { padding: 0 16px; } }