:root {
    --primary: #c0392b;
    --primary-dark: #962d22;
    --dark: #222;
    --bg: #faf8f6;
    --card-bg: #fff;
    --border: #eee;
    --green: #27ae60;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--dark);
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
a { text-decoration: none; color: inherit; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 22px; font-weight: 700; color: var(--primary); }
.main-nav { display: flex; gap: 22px; }
.main-nav a { font-weight: 500; }
.main-nav a:hover { color: var(--primary); }
.cart-link { position: relative; font-weight: 600; }
.cart-badge {
    background: var(--primary); color: #fff; border-radius: 50%;
    font-size: 12px; padding: 2px 6px; margin-left: 4px;
}

/* ---------- Categories / Products ---------- */
.categories-bar { display: flex; gap: 10px; overflow-x: auto; padding: 16px 0; }
.categories-bar a {
    padding: 8px 16px; background: #fff; border: 1px solid var(--border);
    border-radius: 20px; white-space: nowrap; font-weight: 500;
}
.categories-bar a.active, .categories-bar a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 40px; }
.product-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px; display: flex; flex-direction: column; transition: box-shadow .2s;
}
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.product-card img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; background: #eee; }
.product-card h3 { font-size: 16px; margin: 10px 0 4px; }
.product-card p { font-size: 13px; color: #777; flex-grow: 1; }
.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.price { font-weight: 700; color: var(--primary); }
.btn {
    background: var(--primary); color: #fff; border: none; border-radius: 8px;
    padding: 9px 16px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #f1f1f1; color: var(--dark); }
.btn.secondary:hover { background: #e3e3e3; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Modifiers modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none;
    align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 12px; padding: 22px; max-width: 420px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { margin-top: 0; }
.modifier-group { margin-bottom: 14px; }
.modifier-group .group-title { font-weight: 600; margin-bottom: 6px; }
.modifier-option { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.qty-control { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.qty-control button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background:#fff; cursor:pointer; }

/* ---------- Cart / Checkout ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.cart-table td, .cart-table th { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
.cart-summary { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; max-width: 380px; margin-left: auto; }
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.cart-summary .total-row { font-weight: 700; font-size: 18px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert.error { background: #fdecea; color: #c0392b; }
.alert.success { background: #eafaf1; color: #1e8449; }

/* ---------- Auth forms ---------- */
.auth-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 26px; max-width: 380px; margin: 30px auto; }
.auth-box h2 { margin-top: 0; text-align: center; }

/* ---------- Profile / order history ---------- */
.order-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.order-card .order-head { display: flex; justify-content: space-between; font-weight: 600; }
.badge-status { padding: 3px 10px; border-radius: 12px; font-size: 12px; background: #f1f1f1; }
.cashback-box { background: linear-gradient(135deg,#f5b041,#c0392b); color:#fff; border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.cashback-box .amount { font-size: 28px; font-weight: 700; }

/* ---------- Promotions ---------- */
.promo-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.promo-code { display: inline-block; background: #f1f1f1; padding: 4px 10px; border-radius: 6px; font-family: monospace; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: #1e1e1e; color: #ccc; margin-top: 30px; padding: 30px 0 10px; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.copyright { text-align: center; padding: 16px 0 4px; font-size: 13px; color: #888; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px; }
    .main-nav { gap: 14px; font-size: 14px; }
    .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cart-summary { max-width: 100%; }
}
