/*
 * assets/css/themes.css
 * ─────────────────────────────────────────────────────────────────────────────
 * Theme design-tokens for all 3 desktop themes: dark (default) · light · purple
 * Dynamic --accent can be overridden via an inline <style> on :root if needed.
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ═══════════════════════════════════════════════════════════════════════════
   DARK THEME  (default — no data-theme attribute)
═══════════════════════════════════════════════════════════════════════════ */
:root {
    /* Backgrounds */
    --bg:        #0d1526;
    --bg2:       #111d33;
    --card:      #162035;
    --card-h:    #1a2740;

    /* Text */
    --text:      #e2e8f0;
    --muted:     #64748b;

    /* Brand / accent */
    --primary:   #a5b4fc;
    --price:     #f9a8d4;
    --accent:    #fbbf24;          /* overridden inline when DB value differs */
    --green:     #6ee7b7;
    --red:       #f87171;

    /* Borders & shadows */
    --border:    rgba(255,255,255,.08);
    --sh1:       0 2px 12px rgba(0,0,0,.25);
    --sh2:       0 6px 28px rgba(0,0,0,.35);

    /* Layout */
    --topbar-h:  118px;
    --cart-w:    400px;
    --max-w:     1380px;
    --r:         12px;
    --rl:        18px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME  [data-theme="light"]
═══════════════════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
    --bg:        #f0f5ed;
    --bg2:       #e4efe0;
    --card:      #ffffff;
    --card-h:    #edf5e9;
    --text:      #1e293b;
    --muted:     #64748b;
    --primary:   #5B7A42;
    --price:     #e11d48;
    --green:     #16a34a;
    --red:       #e91e63;
    --border:    rgba(0,0,0,.08);
    --sh1:       0 2px 12px rgba(0,0,0,.06);
    --sh2:       0 6px 28px rgba(0,0,0,.1);
}


/* ═══════════════════════════════════════════════════════════════════════════
   PURPLE / VIOLET THEME  [data-theme="purple"]
═══════════════════════════════════════════════════════════════════════════ */
html[data-theme="purple"] {
    --bg:        #0f0d1a;
    --bg2:       #17142b;
    --card:      #1e1a35;
    --card-h:    #271f4a;
    --text:      #ede9f8;
    --muted:     #9d8ec4;
    --primary:   #c084fc;
    --price:     #e879f9;
    --accent:    #a855f7;
    --green:     #34d399;
    --red:       #f87171;
    --border:    rgba(192,132,252,.18);
    --sh1:       0 2px 12px rgba(124,58,237,.22);
    --sh2:       0 6px 28px rgba(124,58,237,.32);
}


/* ═══════════════════════════════════════════════════════════════════════════
   THEME PICKER POPOVER  (shared across all pages)
═══════════════════════════════════════════════════════════════════════════ */
.theme-picker-wrap { position: relative; }

.theme-picker {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 14px 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    z-index: 9999;
    display: none;
    white-space: nowrap;
    min-width: 216px;
}
.theme-picker.open {
    display: block;
    animation: tpIn .18s ease;
}
@keyframes tpIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tp-title {
    font-size: .68rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tp-title i { color: var(--primary); }

.tp-options { display: flex; gap: 8px; }

.tp-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px 8px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--card-h);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: .74rem;
    font-weight: 700;
    color: var(--text);
    transition: border-color .18s, background .18s;
    flex: 1;
    position: relative;
}
.tp-opt:hover  { border-color: var(--primary); }
.tp-opt.active {
    border-color: var(--primary);
    background: rgba(165,180,252,.1);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.tp-swatch {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.15);
    flex-shrink: 0;
}

.tp-check {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: .6rem;
    color: var(--primary);
    display: none;
}
.tp-opt.active .tp-check { display: block; }
