/* ============================================================
   Corner Home — Online Store
   Color palette: near-black background + gold accent
   ============================================================ */

:root {
    --bg:           #0a0a0a;
    --surface:      #141414;
    --surface-2:    #1e1e1e;
    --border:       #2a2a2a;
    --gold:         #C9A551;
    --gold-light:   #E5C97A;
    --gold-dark:    #8B6914;
    --gold-bg:      rgba(201,165,81,.08);
    --text:         #EEEEEE;
    --text-muted:   #888888;
    --text-dim:     #444444;
    --danger:       #e05252;
    --success:      #4caf7d;
    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 4px 24px rgba(0,0,0,.6);
    --transition:   .2s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    overflow-x: clip;
}
body {
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ── Loading spinner ────────────────────────────────────────── */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header ─────────────────────────────────────────────────── */
.store-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.store-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}
.store-logo-img {
    height: 52px;
    width: 52px;
    object-fit: contain;
    border-radius: 6px;
}
.store-logo-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1;
}
.store-logo-text span.logo-ar {
    font-size: 18px;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0;
}
.store-logo-text span.logo-en {
    font-size: 9px;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.75;
}
.header-search {
    flex: 1;
    min-width: 0;
    position: relative;
}
.header-search input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 9px 18px 9px 44px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}
[dir="rtl"] .header-search input { padding: 9px 44px 9px 36px; }
[dir="ltr"] .header-search input { padding: 9px 36px 9px 44px; }
.header-search input:focus { border-color: var(--gold); }
.header-search input::placeholder { color: var(--text-muted); }
.header-search .search-clear {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    width: 18px; height: 18px; border-radius: 50%; border: none;
    background: #555; color: #ccc; font-size: 10px; font-weight: 700;
    cursor: pointer; display: none; align-items: center; justify-content: center;
    padding: 0; line-height: 1; transition: background .15s;
}
[dir="rtl"] .header-search .search-clear { right: auto; left: 10px; }
.header-search .search-clear:hover { background: #777; color: white; }
.header-search .search-clear.visible { display: flex; }
.header-search .search-icon {
    position: absolute;
    top: 50%; left: 15px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 16px;
}
[dir="rtl"] .header-search .search-icon { left: auto; right: 15px; }
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.track-icon { display: none; }
.btn-icon {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 6px;
}
.btn-icon:hover { border-color: var(--gold); color: var(--gold); }
.lang-select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    height: 32px;
    transition: border-color var(--transition), color var(--transition);
}
.lang-select:hover, .lang-select:focus { border-color: var(--gold); color: var(--gold); }
.cart-btn {
    position: relative;
    background: var(--gold);
    border: none;
    color: #000;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 16px;
    font-weight: 700;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.cart-btn:hover { background: var(--gold-light); }
.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    width: 18px; height: 18px;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
[dir="rtl"] .cart-badge { right: auto; left: -6px; }

/* ── Category filter ─────────────────────────────────────────── */
.category-bar {
    position: fixed;
    top: 65px; /* fallback: 64px header-inner + 1px border; JS overrides precisely */
    left: 0;
    right: 0;
    z-index: 199;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.category-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 8px;
    align-items: center;
    height: 50px;
    flex-wrap: nowrap;
}
.cat-overflow {
    visibility: hidden;
    position: absolute;
    pointer-events: none;
}
.cat-more-wrap {
    position: relative;
    flex-shrink: 0;
}
.cat-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
    min-width: 180px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}
[dir="rtl"] .cat-dropdown { right: auto; left: 0; }
.cat-dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    text-align: right;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
[dir="ltr"] .cat-dropdown-item { text-align: left; }
.cat-dropdown-item:hover { background: var(--gold-bg); color: var(--gold); }
.cat-dropdown-item.active { background: var(--gold-bg); color: var(--gold); font-weight: 800; }
.cat-pill {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.cat-pill:hover { border-color: var(--gold); color: var(--gold); }
.cat-pill.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
}

/* ── Main content ────────────────────────────────────────────── */
.store-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 80px;
    padding-top: 138px; /* 64px header + 50px category bar + 24px gap */
}
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 13px;
}
.results-bar strong { color: var(--gold); }

/* ── Product grid ────────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.product-card-filler {
    visibility: hidden;
    pointer-events: none;
}

/* ── Product card ────────────────────────────────────────────── */
.product-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    margin-bottom: 4px;
}
.product-img-clickable {
    cursor: zoom-in;
    position: relative;
}
.product-img-pos {
    position: absolute;
    bottom: 6px;
    inset-inline-end: 6px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    pointer-events: none;
}

/* Thumbnail strip on product card */
.product-img-thumbs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 5px 0 2px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}
.product-img-thumbs::-webkit-scrollbar { display: none; }
.product-img-thumb {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .15s, opacity .15s;
    background: var(--surface-2);
    opacity: 0.55;
    scroll-snap-align: start;
}
.product-img-thumb:hover { opacity: 0.85; }
.product-img-thumb.active {
    border-color: var(--gold);
    opacity: 1;
}
.product-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ── Add-to-cart note modal ── */
.atc-overlay {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(0,0,0,.65); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn .15s ease;
}
.atc-modal {
    background: var(--surface); border: 1px solid #2a2a2a;
    border-radius: 16px; padding: 24px 22px 20px;
    width: 100%; max-width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    animation: slideUp .18s ease;
}
.atc-product-name {
    font-size: 15px; font-weight: 700; color: var(--text);
    margin-bottom: 6px; line-height: 1.4;
}
.atc-hint {
    font-size: 12px; color: var(--text-muted); margin-bottom: 14px;
}
.atc-note-input {
    width: 100%; background: var(--surface-2); border: 1px solid #333;
    border-radius: 10px; color: var(--text); font-family: inherit;
    font-size: 14px; padding: 10px 14px; outline: none;
    transition: border-color .15s; margin-bottom: 16px;
}
.atc-note-input::placeholder { color: var(--text-muted); }
.atc-note-input:focus { border-color: var(--gold); }
.atc-actions {
    display: flex; gap: 10px;
}
.atc-btn-skip {
    flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #333;
    background: transparent; color: var(--text-muted); font-family: inherit;
    font-size: 13px; cursor: pointer; transition: all .15s;
}
.atc-btn-skip:hover { border-color: #555; color: var(--text); }
.atc-btn-add {
    flex: 2; padding: 10px; border-radius: 10px; border: none;
    background: var(--gold); color: #000; font-family: inherit;
    font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.atc-btn-add:hover { background: var(--gold-light); }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Lightbox ── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: lb-fade-in 0.18s ease;
}
@keyframes lb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(92vw, 580px);
    animation: lb-scale-in 0.18s ease;
}
@keyframes lb-scale-in {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.lightbox-img-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-img {
    width: 100%;
    max-height: 68vh;
    object-fit: contain;
    border-radius: var(--radius);
    display: block;
}
.lightbox-placeholder {
    width: min(80vw, 400px);
    height: min(80vw, 400px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 110px;
    background: var(--surface-2);
    border-radius: var(--radius);
}
.lightbox-name {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    opacity: 0.9;
}
.lightbox-close {
    position: fixed;
    top: 16px;
    right: 18px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.28); }
.lightbox-download {
    position: fixed;
    top: 16px;
    left: 18px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1001;
}
.lightbox-download svg { width: 18px; height: 18px; }
.lightbox-download:hover { background: rgba(255,255,255,0.28); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.14);
    border: none;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { inset-inline-start: 6px; }
.lightbox-next { inset-inline-end:  6px; }
.lightbox-counter {
    position: absolute;
    bottom: 8px;
    inset-inline-end: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    font-weight: 600;
    background: rgba(0,0,0,0.4);
    padding: 2px 8px;
    border-radius: 20px;
}
/* Thumbnail strip in lightbox */
.lightbox-thumbs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 4px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    max-width: 100%;
}
.lightbox-thumbs::-webkit-scrollbar { display: none; }
.lightbox-thumb {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 7px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.18);
    cursor: pointer;
    transition: border-color .15s, opacity .15s, transform .15s;
    background: var(--surface-2);
    opacity: 0.5;
    scroll-snap-align: start;
}
.lightbox-thumb:hover { opacity: 0.8; }
.lightbox-thumb.active {
    border-color: var(--gold);
    opacity: 1;
    transform: scale(1.06);
}
.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.product-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-dim);
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color var(--transition), transform var(--transition);
    position: relative;
    min-width: 0; /* prevent grid blowout — let 1fr stay equal */
    overflow: hidden;
}
.product-card:hover {
    border-color: var(--gold-dark);
    transform: translateY(-2px);
}
.product-card.in-cart {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--surface) 80%, rgba(201,165,81,.06));
}
.product-category {
    font-size: 10px;
    font-weight: 700;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: .8px;
}
.product-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
}
.product-unit {
    font-size: 12px;
    color: var(--text-muted);
}
.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--gold);
}
.product-price span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.product-qty-badge {
    font-size: 11px;
    color: var(--text-dim);
}
.product-qty-badge.low { color: var(--danger); }

.btn-add-cart {
    width: 100%;
    background: var(--gold);
    border: none;
    color: #000;
    border-radius: var(--radius-sm);
    padding: 9px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    margin-top: 6px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-add-cart:hover { background: var(--gold-light); }
.btn-add-cart.in-cart { background: var(--surface-2); border: 1px solid var(--gold); color: var(--gold); }

.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 6px;
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.cart-qty-btn {
    background: var(--surface-2);
    border: none;
    color: var(--gold);
    width: 36px; height: 36px;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background var(--transition);
}
.cart-qty-btn:hover { background: var(--gold-bg); }
.cart-qty-display {
    flex: 1;
    text-align: center;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    background: transparent;
    border: none;
    pointer-events: none;
}

/* ── Load more ──────────────────────────────────────────────── */
.load-more-wrap {
    text-align: center;
    margin-top: 32px;
}
.btn-load-more {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition);
}
.btn-load-more:hover { border-color: var(--gold); color: var(--gold); }
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; }

/* ── Cart drawer ─────────────────────────────────────────────── */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 300;
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 100vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 301;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s ease;
    box-shadow: var(--shadow);
}
[dir="rtl"] .cart-drawer {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.cart-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--gold);
}
.cart-close {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    width: 34px; height: 34px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.cart-close:hover { border-color: var(--danger); color: var(--danger); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cart-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; }
.cart-item-unit { font-size: 11px; color: var(--text-muted); }
.cart-item-price { font-size: 13px; color: var(--gold); font-weight: 700; margin-top: 2px; }
.cart-item-note {
    display: block; width: 100%; margin-top: 6px;
    background: #1e1e1e; border: 1px solid #333; border-radius: 6px;
    color: var(--text); font-family: inherit; font-size: 11px;
    padding: 5px 8px; outline: none; transition: border-color .15s;
}
.cart-item-note::placeholder { color: var(--text-muted); }
.cart-item-note:focus { border-color: var(--gold); }
.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.ci-btn {
    background: var(--surface);
    border: none;
    color: var(--gold);
    width: 28px; height: 28px;
    font-size: 14px;
    font-weight: 700;
    transition: background var(--transition);
}
.ci-btn:hover { background: var(--gold-bg); }
.ci-qty {
    padding: 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    min-width: 32px;
    text-align: center;
}
.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    padding: 2px;
    cursor: pointer;
    transition: color var(--transition);
    align-self: flex-start;
}
.cart-item-remove:hover { color: var(--danger); }

.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 12px;
}
.cart-empty .cart-empty-icon { font-size: 48px; }

.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
}
.cart-total-row .total-label { color: var(--text-muted); }
.cart-total-row .total-amount { color: var(--gold); font-size: 20px; }
.btn-checkout {
    width: 100%;
    background: var(--gold);
    border: none;
    color: #000;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    transition: all var(--transition);
}
.btn-checkout:hover { background: var(--gold-light); }
.btn-clear-cart {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 12px;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: color var(--transition);
}
.btn-clear-cart:hover { color: var(--danger); }

/* ── Checkout page ───────────────────────────────────────────── */
.checkout-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}
.checkout-page h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 28px;
}
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 768px) {
    .checkout-grid { grid-template-columns: 1fr; }
}
.form-card, .order-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-label .req { color: var(--gold); }
.form-input, .form-textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}
.form-input:focus, .form-textarea:focus { border-color: var(--gold); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.summary-item:last-child { border-bottom: none; }
.summary-item-name { color: var(--text); flex: 1; }
.summary-item-unit { color: var(--text-muted); font-size: 11px; }
.summary-item-qty  { color: var(--text-muted); font-size: 12px; }
.summary-item-note { color: var(--gold-light); font-size: 11px; margin-top: 2px; font-style: italic; }
.summary-item-price { color: var(--gold); font-weight: 700; flex-shrink: 0; }
.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 17px;
    font-weight: 800;
    padding-top: 14px;
    margin-top: 8px;
    border-top: 1px solid var(--gold-dark);
}
.summary-total .total-val { color: var(--gold); }
.summary-delivery {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 0;
}

.cod-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-bg);
    border: 1px solid var(--gold-dark);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}
.cod-badge .cod-icon { color: var(--gold); font-size: 18px; }

.btn-place-order {
    width: 100%;
    background: var(--gold);
    border: none;
    color: #000;
    border-radius: var(--radius-sm);
    padding: 15px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    margin-top: 20px;
    transition: all var(--transition);
    cursor: pointer;
}
.btn-place-order:hover:not(:disabled) { background: var(--gold-light); }
.btn-place-order:disabled { opacity: .5; cursor: not-allowed; }

.form-error {
    background: rgba(224,82,82,.1);
    border: 1px solid rgba(224,82,82,.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── Order success ───────────────────────────────────────────── */
.success-page {
    max-width: 600px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}
.success-icon { font-size: 64px; margin-bottom: 16px; }
.success-page h1 { font-size: 26px; font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.success-page p { color: var(--text-muted); margin-bottom: 4px; }
.order-id-box {
    background: var(--surface);
    border: 1px solid var(--gold-dark);
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px 0;
    display: inline-block;
    min-width: 200px;
}
.order-id-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.order-id-value { font-size: 32px; font-weight: 800; color: var(--gold); }
.keep-order-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff0f0;
    border: 1px solid #e53935;
    border-radius: var(--radius);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #c62828;
    width: fit-content;
    max-width: 320px;
    margin: 0 auto 20px;
    text-align: center;
}
.keep-order-icon { font-size: 16px; flex-shrink: 0; }
.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}
.btn-primary {
    background: var(--gold);
    border: none;
    color: #000;
    border-radius: var(--radius-sm);
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition);
}
.btn-primary:hover { background: var(--gold-light); }
.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

/* ── Track page ──────────────────────────────────────────────── */
.track-page {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px 80px;
}
.track-page h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 24px;
}
.track-form-card, .order-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 700;
}
.status-pending       { background: rgba(201,165,81,.15); color: var(--gold); }
.status-confirmed     { background: rgba(76,175,125,.15); color: var(--success); }
.status-out_for_delivery { background: rgba(100,160,255,.15); color: #64a0ff; }
.status-delivered     { background: rgba(76,175,125,.25); color: var(--success); }
.status-cancelled     { background: rgba(224,82,82,.15); color: var(--danger); }

.order-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}
.order-meta-row { display: flex; gap: 8px; }
.order-meta-row .meta-label { color: var(--text-muted); min-width: 100px; }
.order-meta-row .meta-val   { color: var(--text); font-weight: 600; }

.order-items-list { display: flex; flex-direction: column; gap: 8px; }
.order-item-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.order-item-row:last-child { border-bottom: none; }
.oi-name { color: var(--text); flex: 1; }
.oi-qty  { color: var(--text-muted); }
.oi-sub  { color: var(--gold); font-weight: 700; }

/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet (≤768px) */
@media (max-width: 768px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .product-grid  { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* Large phone (≤600px) */
@media (max-width: 600px) {
    /* Header */
    .header-inner       { height: 56px; padding: 0 12px; gap: 8px; }
    .store-logo-text    { display: none; }
    .btn-icon           { padding: 6px 10px; font-size: 12px; }
    .cart-btn           { padding: 5px 8px; font-size: 14px; gap: 4px; }
    .track-label        { display: none; }
    .track-icon         { display: inline; font-size: 16px; }

    /* Category bar — top set by JS; fallback only */
    .category-bar       { top: 57px; } /* 56px + 1px border */
    .category-inner     { padding: 0 12px; gap: 6px; height: 44px; }
    .cat-pill           { padding: 4px 12px; font-size: 12px; }

    /* Product grid & cards */
    .product-grid       { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-card       { padding: 12px 10px 10px; gap: 6px; }
    .product-category   { font-size: 9px; }
    .product-name       { font-size: 13px; }
    .product-price      { font-size: 16px; }
    .btn-add-cart       { font-size: 12px; padding: 8px 6px; }
    .cart-qty-btn       { width: 30px; height: 30px; font-size: 15px; }

    /* Cart drawer — narrower on mobile so page peeks through */
    .cart-drawer        { width: min(340px, 88vw); }
    .cart-header        { padding: 12px 14px; }
    .cart-items         { padding: 8px 12px; gap: 8px; }
    .cart-item          { padding: 9px; gap: 7px; }
    .cart-footer        { padding: 10px 14px; gap: 8px; }
    .cart-title         { font-size: 14px; }
    .btn-checkout       { padding: 11px; font-size: 13px; }
    .ci-btn             { width: 26px; height: 26px; font-size: 13px; }
    .ci-qty             { padding: 0 8px; min-width: 26px; font-size: 12px; }
    .cart-item-name     { font-size: 12px; }

    /* Pages */
    .store-main         { padding: 124px 10px 80px; } /* 56px header + 44px bar + 24px gap */
    .checkout-page      { padding: 20px 12px 80px; }
    .track-page         { padding: 20px 12px 80px; margin-top: 0; }
    .form-card,
    .order-summary-card,
    .track-form-card,
    .order-detail-card  { padding: 18px 14px; }
    .success-page       { margin: 30px auto; }
}

/* Small phone (≤400px) */
@media (max-width: 400px) {
    .header-inner       { gap: 6px; padding: 0 10px; }
    .product-grid       { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-card       { padding: 10px 8px 8px; }
    .product-name       { font-size: 12px; }
    .product-price      { font-size: 14px; }
    .btn-add-cart       { font-size: 11px; padding: 7px 4px; }
    .category-inner     { padding: 0 10px; gap: 5px; }
    .cat-pill           { padding: 3px 10px; font-size: 11px; }
    .store-main         { padding: 124px 8px 80px; }
    .cart-item-controls { flex-shrink: 0; }
}

/* Very small phone (≤320px) — single column */
@media (max-width: 320px) {
    .product-grid { grid-template-columns: 1fr; }
}

/* Star rating */
.star-rating { display: flex; align-items: center; gap: 5px; margin: 4px 0 2px; }
.stars { display: flex; gap: 1px; }
.star {
    background: none; border: none; font-size: 17px; cursor: pointer;
    color: #444; padding: 0; line-height: 1;
    transition: color .1s;
}
.star.filled { color: var(--gold); }
.stars:not(.stars-voted):hover .star { color: var(--gold-light); }
.stars:not(.stars-voted) .star:hover ~ .star { color: #444; }
.stars-voted .star { cursor: default; }
.star-count { font-size: 11px; color: var(--text-muted); }

/* ── Store Footer ──────────────────────────────────────────────────────────── */
.store-footer {
    background: #111;
    border-top: 1px solid #222;
    padding: 32px 16px 24px;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 13px;
}
.store-footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.store-footer-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}
.footer-logo-img {
    height: 80px;
    width: 80px;
    object-fit: contain;
    border-radius: 10px;
    opacity: 0.9;
    flex-shrink: 0;
}
.store-footer-brand-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.2;
}
.store-footer-brand-text small {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 1px;
}
.store-footer-address {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.6;
    color: #aaa;
}
.store-footer-address-icon { flex-shrink: 0; font-size: 15px; margin-top: 1px; }
.store-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.store-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 8px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s, color .15s, border-color .15s;
}
.store-footer-link:hover { background: #222; color: var(--text); border-color: #444; }
.store-footer-link.whatsapp:hover { color: #25d366; border-color: #25d366; }
.store-footer-link.facebook:hover { color: #1877f2; border-color: #1877f2; }
.store-footer-link.instagram:hover { color: #e1306c; border-color: #e1306c; }
.store-footer-link.tiktok:hover { color: #fff; border-color: #fff; }
.store-footer-link.phone:hover { color: var(--gold); border-color: var(--gold); }
.store-footer-copy {
    border-top: 1px solid #222;
    padding-top: 16px;
    font-size: 11px;
    color: #555;
    text-align: center;
}
