/* --- XROSS THEME VARIABLES --- */
:root {
    --xross-brand: #cc0000;    /* Default Red for Dark Theme */
    --xross-black: #0b0b0b;
    --xross-grey: #222222;
    --xross-text: #ffffff;
    --xross-nav-bg: #111;
    --xross-card-bg: #1a1a1a;
    --xross-price-text: #ffffff;
}

/* --- LIGHT MODE OVERRIDES (Southern San Andreas Yellow) --- */
body.light-mode {
    --xross-brand: #ffb400;    /* Yellow for Light Theme */
    --xross-black: #ffffff;
    --xross-grey: #e1e1e1;
    --xross-text: #1a1a1a;
    --xross-nav-bg: var(--xross-brand);
    --xross-card-bg: #ffffff;
    --xross-price-text: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial Black', sans-serif;
}

body {
    background-color: var(--xross-black);
    color: var(--xross-text);
    transition: background 0.3s ease, color 0.3s ease;
}

/* --- LOGO & HEADER --- */
#logo-span { 
    color: var(--xross-brand); 
    transition: color 0.3s ease; 
}

.main-header {
    background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
    padding: 20px;
    text-align: center;
    border-bottom: 3px solid var(--xross-brand);
}

.top-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1400px; 
    margin: 0 auto; 
}

.header-left { display: flex; align-items: center; gap: 15px; }

.logo { 
    cursor: pointer; 
    font-style: italic; 
    font-size: 3rem; 
    letter-spacing: -2px; 
    color: #fff; 
}

.view-title { 
    font-weight: 900; 
    text-transform: uppercase; 
    font-size: 0.9rem; 
    color: #888;
    letter-spacing: 1px;
}

/* --- MENU BUTTON (Sidebar Toggle) --- */
.menu-btn { 
    background: none; 
    border: 1px solid rgba(255,255,255,0.2); 
    color: #fff; 
    font-size: 1.5rem; 
    cursor: pointer; 
    padding: 5px 10px;
    transition: 0.2s;
}

.menu-btn:hover { 
    background: var(--xross-brand); 
    border-color: var(--xross-brand);
    color: var(--xross-price-text);
}

.theme-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* --- NAVIGATION BAR --- */
.category-nav { 
    background: var(--xross-nav-bg); 
    padding: 10px 20px; 
    position: sticky; 
    top: 0; 
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.nav-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    max-width: 1400px; 
    margin: 0 auto; 
}

.nav-right { display: flex; align-items: center; gap: 8px; }

/* Filter Buttons */
.tab-btn { 
    background: #111; 
    color: white; 
    border: none; 
    padding: 8px 16px; 
    cursor: pointer; 
    text-transform: uppercase; 
    font-size: 0.7rem;
}

body.light-mode .tab-btn { background: rgba(0,0,0,0.8); }

.tab-btn:hover, .tab-btn.active { 
    background: white !important; 
    color: black !important; 
}

.xross-input { 
    background: rgba(255,255,255,0.15); 
    border: 1px solid rgba(0,0,0,0.1); 
    padding: 8px; 
    color: inherit; 
    font-weight: bold; 
}

.xross-select { 
    background: #000; 
    color: #fff; 
    border: 1px solid #444; 
    padding: 7px; 
}

/* --- THE ADD (+) BUTTON --- */
.add-btn {
    background: #000;
    color: #fff;
    border: 1px solid #fff;
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.add-btn:hover {
    background: var(--xross-brand);
    border-color: var(--xross-brand);
    color: var(--xross-price-text);
}

/* --- SIDEBAR --- */
.sidebar { 
    height: 100%; 
    width: 0; 
    position: fixed; 
    z-index: 3000; 
    top: 0; 
    left: 0; 
    background-color: #0b0b0b; 
    overflow-x: hidden; 
    transition: 0.5s; 
    padding-top: 60px; 
    border-right: 3px solid var(--xross-brand);
}

.sidebar-links a { 
    padding: 15px 32px; 
    text-decoration: none; 
    font-size: 1.2rem; 
    color: white; 
    display: block; 
    transition: 0.3s; 
    text-transform: uppercase;
}

.sidebar-links a:hover { 
    background-color: var(--xross-brand); 
    color: var(--xross-price-text);
}

.close-sidebar { 
    position: absolute; 
    top: 10px; 
    right: 25px; 
    font-size: 36px; 
    background: none; 
    border: none; 
    color: white; 
    cursor: pointer; 
}

/* --- PRODUCT CARDS --- */
.product-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 25px; 
    padding: 40px; 
}

.car-card { 
    background: var(--xross-card-bg); 
    border: 1px solid #ddd; 
}

.card-header { 
    background: var(--xross-grey); 
    color: #666; 
    font-size: 10px; 
    padding: 8px; 
    display: flex;
    justify-content: space-between;
}

.car-card img { width: 100%; height: 180px; object-fit: cover; }

.card-footer { 
    display: flex; 
    background: #000; 
    color: #fff; 
}

.car-name { padding: 12px; flex-grow: 1; font-size: 1.1rem; text-transform: uppercase; }

.car-price { 
    background: var(--xross-brand); 
    color: var(--xross-price-text); 
    padding: 12px 20px; 
    font-weight: 900;
    font-style: italic;
    transition: background 0.3s ease;
}

/* --- MODAL --- */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); }
.modal-content { background: #1a1a1a; color: white; margin: 10% auto; width: 90%; max-width: 400px; border: 2px solid var(--xross-brand); }
.modal-header { background: var(--xross-brand); padding: 15px; display: flex; justify-content: space-between; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.modal-body input, .modal-body select { padding: 10px; background: #333; color: white; border: 1px solid #444; }
.submit-btn { background: var(--xross-brand); color: var(--xross-price-text); border: none; padding: 15px; cursor: pointer; font-weight: bold; }

/* --- XROSS THEME VARIABLES --- */
:root {
    --xross-brand: #cc0000;    
    --xross-black: #0b0b0b;
    --xross-grey: #222222;
    --xross-text: #ffffff;
    --xross-nav-bg: #111;
    --xross-card-bg: #1a1a1a;
    --xross-price-bg: #cc0000;
    --xross-price-text: #ffffff;
    --xross-muted: #888888;
}

/* --- LIGHT MODE OVERRIDES --- */
body.light-mode {
    --xross-brand: #e5a100;    /* A more "Golden" subtle yellow */
    --xross-black: #f0f0f0;    /* Light grey instead of pure white */
    --xross-grey: #d1d1d1;
    --xross-text: #1a1a1a;
    --xross-nav-bg: #222;      /* Keep Nav Dark for contrast */
    --xross-card-bg: #ffffff;
    --xross-price-bg: #e5a100;
    --xross-price-text: #000000;
    --xross-muted: #555555;
}

/* ... keep your global Reset and Body tags ... */

/* --- HEADER FIX (Ensuring text doesn't vanish) --- */
.main-header {
    background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
    padding: 20px;
    text-align: center;
    border-bottom: 3px solid var(--xross-brand);
    color: #ffffff !important; /* Force white text in header always */
}

/* --- PRODUCT CARD RE-DESIGN (The LMS Look) --- */
.car-card { 
    background: var(--xross-card-bg); 
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* Slanted Header for that high-performance feel */
.card-header { 
    background: var(--xross-grey); 
    color: var(--xross-muted); 
    font-size: 11px; 
    padding: 10px; 
    font-weight: bold;
    letter-spacing: 1px;
}

.car-card img { 
    width: 100%; 
    height: 180px; 
    object-fit: contain; /* Better for transparent car PNGs */
    background: radial-gradient(circle, #333 0%, #111 100%); /* Fakes a studio floor */
    display: block;
}

.card-footer { 
    display: flex; 
    background: #000000; /* Footer always stays dark */
    color: #ffffff; 
    align-items: stretch;
}

.car-name { 
    padding: 15px; 
    flex-grow: 1; 
    font-size: 1.2rem; 
    text-transform: uppercase; 
    font-style: italic; 
    letter-spacing: -1px;
}

.car-price { 
    background: var(--xross-price-bg); 
    color: var(--xross-price-text); 
    padding: 15px 25px; 
    font-weight: 900;
    font-style: italic;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%); /* The 'Slanted' look */
}