/*-----  ---- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
}

/* ---------------- Light Mode---------------- */

body {
    background: #f4f6fb;     
    color: #222;               
}

/*---- Cards, product boxes, cart area ----*/
.card,
.product-card,
.cart-wrapper,
.site-header {
    background: #ffffff;
    color: #222;
    border: 1px solid #dde1ec;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

/*---- Buttons ----*/
.btn.primary {
    background: #2f80ed;       
    color: white;
}

.btn.primary:hover {
    background: #1c5fb3;
}

.btn.danger {
    background: #d92027;       
    color: white;
}

.btn.danger:hover {
    background: #b3161c;
}

/*---- Tables ----*/
table,
th,
td {
    border-color: #dde1ec;
}

/*---------------- Dark Mode ----------------*/

body.dark {background: #141414;}

/* Dark mode for cards and containers */
body.dark .card,
body.dark .product-card,
body.dark .cart-wrapper,
body.dark .site-header {background: #1f1f1f;color: #f5f5f5;border: 1px solid #333;box-shadow: 0 4px 12px rgba(0,0,0,0.5);}

/* Dark mode for tables */
body.dark table,
body.dark th,
body.dark td {background: #1f1f1f;color: #f5f5f5;border-color: #333;}

/* Dark mode buttons */
body.dark .btn.primary {background: #1c5fb3;}
body.dark .btn.primary:hover {background: #174a8d;}
body.dark .btn.danger {background: #b3161c;}
body.dark .btn.danger:hover {background: #8d1016;}




/*---- Wrapper to center content ----*/
.page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

/*--- Header ---*/
.site-header {
    background: var(--card-bg);
    padding: 16px 18px;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 13px;
    color: #777;
}

.student-info {
    font-size: 13px;
    margin-top: 4px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
}

/*--- Inputs & select ---*/
select,
input[type="text"] {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    min-width: 140px;
    background: #fff;
}

/*--- Buttons ---*/
.btn {
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}

.btn.primary:hover {
    background: var(--primary-dark);
}

.btn.secondary {
    background: #555;
    color: #fff;
}

.btn.secondary:hover {
    background: #333;
}

.btn.danger {
    background: var(--danger);
    color: #fff;
}

.btn.danger:hover {
    background: var(--danger-dark);
}

/*--- Layout ---*/
.layout {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 20px;
}

/*--- Products ---*/
.products-section h2,
.cart-section h2 {
    margin-bottom: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

/*--- Product card ---*/
.product-card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.product-image-wrapper {
    width: 100%;
    height: 130px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 6px;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-name {
    font-weight: bold;
    font-size: 15px;
}

.product-desc {
    font-size: 13px;
    color: #666;
}

.product-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.product-price {
    font-weight: bold;
    color: var(--primary-dark);
}

/*----- Cart ------*/
.cart-wrapper {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    padding: 12px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cart-table th,
.cart-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.cart-table thead {
    background: rgba(0,0,0,0.04);
}

/*-- Qty input --*/
.cart-qty-input {
    width: 50px;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/*--Cart footer --*/
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

#grandTotal {
    font-weight: bold;
    font-size: 15px;
}

/*--- Footer --*/
.site-footer {
    text-align: center;
    font-size: 13px;
    margin-top: 26px;
    color: #777;
}

/*--- Dark Mode tweaks ----*/
body.dark select,
body.dark input[type="text"] {
    background: #111;
    color: #f5f5f5;
    border-color: #444;
}

/*--- Responsive ---*/
@media (max-width: 800px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls {
        width: 100%;
        justify-content: flex-start;
    }
}
