/* ============================================================
   SITA TEXTILE - styles (mobile-first, maroon + gold theme)
   ============================================================ */
:root {
    --maroon: #8E1F2F;
    --maroon-dark: #6E1522;
    --gold: #C9A227;
    --cream: #F7F3EC;
    --white: #fff;
    --black: #1A1A1A;
    --gray: #9CA3AF;
    --gray-dark: #4B5563;
    --line: #E5DED2;
    --green: #10B981;
    --red: #EF4444;
    --orange: #F59E0B;
}

/* ============ DARK MODE ============ */
[data-theme="dark"] {
    --maroon: #B4434F;
    --maroon-dark: #8E2F3C;
    --gold: #E0B341;
    --cream: #121212;
    --white: #1E1E1E;
    --black: #EDEDED;
    --gray: #8A8A8A;
    --gray-dark: #C4C4C4;
    --line: #2E2E2E;
    --chip_bg: #2A2A2A;
    --green: #2BD47F;
    --red: #FF6B6B;
}
[data-theme="dark"] body { background: #0D0D0D; }
[data-theme="dark"] .product-img-wrap, [data-theme="dark"] .detail-img, [data-theme="dark"] .cart-item img, [data-theme="dark"] .ci-ph, [data-theme="dark"] .cat-chip .cat-ph { background: #2A2A2A; }
[data-theme="dark"] .banner-scroll, [data-theme="dark"] .grid, [data-theme="dark"] .hscroll { background: transparent; }
[data-theme="dark"] .btn-gray, [data-theme="dark"] .chip, [data-theme="dark"] .qty-btn, [data-theme="dark"] .mini-btn, [data-theme="dark"] .ref-code { background: #2A2A2A; color: #E8D8D8; }
[data-theme="dark"] .chip.sel { background: var(--maroon); color: #fff; }
[data-theme="dark"] .topbar, [data-theme="dark"] .profile-head { background: var(--maroon-dark); }
[data-theme="dark"] .bottom-nav, [data-theme="dark"] .search-box, [data-theme="dark"] .input, [data-theme="dark"] .card, [data-theme="dark"] .summary, [data-theme="dark"] .cat-chip, [data-theme="dark"] .row-link, [data-theme="dark"] .cart-item, [data-theme="dark"] .order-card, [data-theme="dark"] .admin-row, [data-theme="dark"] .notif-row { background: #1E1E1E; border-color: #2E2E2E; }
[data-theme="dark"] .modal { background: #1E1E1E; }

/* ============ FESTIVE THEMES ============ */
[data-theme="diwali"] {
    --maroon: #B3261E;
    --maroon-dark: #8E1D16;
    --gold: #FFB300;
    --cream: #FDF3E3;
    --white: #FFF8EC;
}
[data-theme="diwali"] .topbar, [data-theme="diwali"] .profile-head { background: linear-gradient(135deg, #B3261E, #E65100); }
[data-theme="holi"] {
    --maroon: #C2185B;
    --maroon-dark: #9A1147;
    --gold: #F06292;
    --cream: #FDF0F4;
    --white: #FFF8FA;
}
[data-theme="holi"] .topbar, [data-theme="holi"] .profile-head { background: linear-gradient(135deg, #C2185B, #7B1FA2, #1976D2); }
[data-theme="eid"] {
    --maroon: #00695C;
    --maroon-dark: #004D40;
    --gold: #26A69A;
    --cream: #ECF7F5;
    --white: #F5FBF9;
}
[data-theme="eid"] .topbar, [data-theme="eid"] .profile-head { background: linear-gradient(135deg, #00695C, #00897B); }

/* ============ FLASH SALE ============ */
.flash-banner {
    background: linear-gradient(135deg, var(--maroon), var(--gold));
    color: #fff; border-radius: 14px; padding: 14px; margin: 10px 12px 0;
    display: flex; align-items: center; gap: 12px;
}
.flash-banner .fb-title { font-weight: 800; font-size: 15px; }
.flash-banner .fb-sub { font-size: 12px; opacity: .9; }
.flash-banner .fb-timer {
    background: rgba(0,0,0,.35); border-radius: 10px; padding: 8px 12px;
    font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 110px; text-align: center;
}

/* ============ PINCODE CHECK ============ */
.pin-row { display: flex; gap: 8px; align-items: center; }
.pin-ok { color: var(--green); font-weight: 700; font-size: 13px; }
.pin-no { color: var(--red); font-weight: 700; font-size: 13px; }
.pin-loading { color: var(--gray); font-size: 13px; }

/* ============ DELIVERY SLOT ============ */
.slot-chip {
    display: block; width: 100%; text-align: left; padding: 11px 14px;
    background: var(--white); border: 1.5px solid var(--line); border-radius: 12px;
    margin-bottom: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--gray-dark);
}
.slot-chip.sel { border-color: var(--maroon); background: #FDF7F8; color: var(--maroon); }

/* ============ TIMELINE TIMESTAMPS ============ */
.tl-time { font-size: 11px; color: var(--gray); margin-left: auto; }

/* ============ ORDER NOTE ============ */
.note-box { background: #FFFBE6; border: 1px solid #F5E6A8; border-radius: 10px; padding: 10px; font-size: 13px; color: var(--gray-dark); }
[data-theme="dark"] .note-box { background: #2A2A1A; border-color: #4A4428; }

/* ============ FILTER CHIPS (admin) ============ */
.fchip {
    display: inline-block; padding: 7px 13px; border-radius: 18px; font-size: 12px;
    background: var(--white); border: 1px solid var(--line); color: var(--gray-dark);
    margin: 0 6px 8px 0; cursor: pointer; font-weight: 600;
}
.fchip.sel { background: var(--maroon); color: #fff; border-color: var(--maroon); }

/* ============ FAQ ============ */
.faq-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.faq-q { padding: 13px 14px; font-weight: 700; font-size: 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-a { padding: 0 14px 13px; font-size: 13px; color: var(--gray-dark); display: none; line-height: 1.5; }
.faq-item.open .faq-a { display: block; }

/* ============ DELIVERY PARTNER ============ */
.dp-card { background: #EEF7FF; border: 1px solid #BCE0FD; border-radius: 10px; padding: 10px; font-size: 13px; }
[data-theme="dark"] .dp-card { background: #10293D; border-color: #1E4A6E; }

/* ============ REWARD / REFERRAL ============ */
.points-card {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    color: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px;
    display: flex; align-items: center; justify-content: space-between;
}
.points-card .pc-num { font-size: 28px; font-weight: 800; }
.points-card .pc-label { font-size: 12px; opacity: .9; }
.ref-code {
    font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--maroon);
    background: #EFE9DE; border-radius: 10px; padding: 8px 14px; display: inline-block;
}

/* ============ RETURN / EXCHANGE ============ */
.ret-card { border-left: 4px solid var(--orange); }

/* ============ INVOICE BUTTON ============ */
.invoice-btn { background: var(--white); color: var(--maroon); border: 1.5px solid var(--maroon); }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #EDE6DA;
    color: var(--black);
    font-size: 15px;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--cream);
    position: relative;
    padding-bottom: 70px;
}
.app.admin-app { max-width: 760px; }

/* ---------- Header ---------- */
.topbar {
    background: var(--maroon);
    color: var(--white);
    padding: 12px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar .tb-title { flex: 1; font-size: 17px; font-weight: 700; }
.icon-btn {
    background: none; border: none; color: var(--white);
    width: 42px; height: 42px; font-size: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }
.icon-btn.dark { color: var(--black); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--white);
    border-top: 1px solid var(--line);
    display: flex;
    z-index: 100;
}
.bottom-nav a {
    flex: 1; text-align: center; padding: 8px 0 10px;
    color: var(--gray-dark); text-decoration: none; font-size: 11px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom-nav a.active { color: var(--maroon); font-weight: 700; }
.bottom-nav .nav-ico { font-size: 20px; position: relative; }
.nav-badge {
    position: absolute; top: -6px; right: -10px;
    background: var(--red); color: #fff; font-size: 9px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: none; align-items: center; justify-content: center; padding: 0 3px;
}

/* ---------- Buttons ---------- */
.btn {
    border: none; border-radius: 12px; cursor: pointer; font-size: 15px;
    padding: 14px 18px; font-weight: 700; display: inline-flex;
    align-items: center; justify-content: center; gap: 8px;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--maroon); color: var(--white); }
.btn-primary:active { background: var(--maroon-dark); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gray { background: #EFE9DE; color: var(--maroon); }
.btn-outline { background: transparent; border: 1.5px solid var(--maroon); color: var(--maroon); }
.btn-red { background: #FEE2E2; color: var(--red); }
.btn:disabled { opacity: 0.5; }

/* ---------- Inputs ---------- */
.input, select.input, textarea.input {
    width: 100%; border: 1px solid var(--line); background: var(--white);
    border-radius: 12px; padding: 13px 14px; font-size: 15px; color: var(--black);
    outline: none;
}
.input:focus { border-color: var(--maroon); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-dark); margin-bottom: 6px; }
textarea.input { min-height: 90px; resize: vertical; }

/* ---------- Cards ---------- */
.card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: 14px; padding: 14px; margin-bottom: 10px;
}
.section-title { font-size: 17px; font-weight: 800; margin: 16px 0 8px; }
.row-link {
    display: flex; align-items: center; gap: 12px; padding: 14px;
    background: var(--white); border: 1px solid var(--line); border-radius: 14px;
    margin-bottom: 10px; cursor: pointer; text-decoration: none; color: var(--black);
}
.row-link .rl-ico { font-size: 20px; width: 34px; text-align: center; }
.row-link .rl-text { flex: 1; font-weight: 600; }
.row-link .rl-arrow { color: var(--gray); font-size: 18px; }

/* ---------- Home ---------- */
.search-row { display: flex; gap: 8px; padding: 10px 12px; }
.search-box {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: var(--white); border-radius: 22px; padding: 10px 14px;
    border: 1px solid var(--line);
}
.search-box input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; }
.search-btn {
    width: 44px; height: 44px; border-radius: 50%; background: var(--maroon);
    color: #fff; border: none; font-size: 17px; cursor: pointer;
}
.banner-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding: 0 12px; }
.banner-scroll::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: none; }
.banner {
    min-width: 100%; height: 150px; border-radius: 14px; scroll-snap-align: center;
    background-size: cover; background-position: center; position: relative;
}
.banner .banner-cap {
    position: absolute; bottom: 10px; left: 12px; color: #fff; font-weight: 800;
    text-shadow: 0 1px 6px rgba(0,0,0,.5); font-size: 16px;
}
.hscroll { display: flex; overflow-x: auto; gap: 10px; padding: 4px 12px; }
.cat-chip {
    min-width: 84px; background: var(--white); border: 1px solid var(--line);
    border-radius: 14px; padding: 8px; text-align: center; cursor: pointer; flex-shrink: 0;
}
.cat-chip img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
.cat-chip .cat-name { font-size: 12px; font-weight: 700; margin-top: 6px; color: var(--gray-dark); }
.cat-chip .cat-ph { width: 60px; height: 60px; border-radius: 10px; background: #EFE9DE; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* ---------- Product grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 12px 20px; }
.product-card {
    background: var(--white); border: 1px solid var(--line); border-radius: 14px;
    overflow: hidden; cursor: pointer;
}
.product-img-wrap { position: relative; height: 150px; background: #F1ECE2; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-img-wrap .ph { width: 100%; height: 100%; background: #F1ECE2; }
.disc-badge {
    position: absolute; top: 8px; left: 8px; background: var(--green); color: #fff;
    font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px;
}
.add-btn {
    position: absolute; bottom: 8px; right: 8px; width: 38px; height: 38px;
    border-radius: 50%; border: none; background: var(--maroon); color: #fff;
    font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.product-info { padding: 10px; }
.p-name { font-size: 13px; font-weight: 700; line-height: 1.25; min-height: 32px; }
.p-price { color: var(--maroon); font-weight: 800; font-size: 15px; margin-top: 5px; }
.p-mrp { color: var(--gray); font-size: 11px; text-decoration: line-through; font-weight: 400; }

/* ---------- Detail ---------- */
.detail-img { width: 100%; height: 300px; object-fit: cover; background: #F1ECE2; }
.detail-body { padding: 14px; }
.detail-title { font-size: 19px; font-weight: 800; }
.detail-price-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.detail-price { color: var(--maroon); font-size: 24px; font-weight: 800; }
.detail-mrp { color: var(--gray); text-decoration: line-through; font-size: 14px; }
.detail-disc {
    background: var(--maroon); color: #fff; font-size: 11px; font-weight: 800;
    padding: 3px 8px; border-radius: 6px;
}
.detail-stock { font-size: 13px; font-weight: 700; margin-top: 8px; }
.stock-in { color: var(--green); }
.stock-out { color: var(--red); }
.detail-sec { font-weight: 800; margin-top: 18px; font-size: 15px; }
.detail-txt { color: var(--gray-dark); margin-top: 4px; font-size: 14px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
    padding: 8px 16px; border-radius: 20px; background: #EFE9DE; border: 2px solid transparent;
    cursor: pointer; font-size: 14px; font-weight: 600; color: var(--gray-dark);
}
.chip.sel { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.qty-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-btn {
    width: 40px; height: 40px; border-radius: 10px; border: none; background: #EFE9DE;
    font-size: 20px; font-weight: 700; color: var(--maroon); cursor: pointer;
}
.qty-val { font-size: 18px; font-weight: 800; width: 44px; text-align: center; }

/* ---------- Cart ---------- */
.cart-item {
    display: flex; gap: 10px; background: var(--white); border: 1px solid var(--line);
    border-radius: 14px; padding: 10px; margin-bottom: 10px;
}
.cart-item img { width: 84px; height: 96px; border-radius: 10px; object-fit: cover; }
.cart-item .ci-ph { width: 84px; height: 96px; border-radius: 10px; background: #F1ECE2; flex-shrink: 0; }
.cart-item .ci-body { flex: 1; }
.ci-name { font-weight: 700; font-size: 14px; }
.ci-size { color: var(--gray); font-size: 12px; margin-top: 2px; }
.ci-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.ci-price { color: var(--maroon); font-weight: 800; }
.ci-remove { background: none; border: none; color: var(--red); font-size: 14px; cursor: pointer; font-weight: 600; }

/* ---------- Summary ---------- */
.summary { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.sum-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: var(--gray-dark); }
.sum-row.total { font-size: 19px; font-weight: 800; color: var(--maroon); border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; }
.sum-row .green { color: var(--green); }

/* ---------- Orders ---------- */
.order-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 13px; margin-bottom: 10px; cursor: pointer; }
.oc-head { display: flex; justify-content: space-between; align-items: center; }
.oc-no { font-weight: 800; font-size: 15px; }
.status-badge { color: #fff; font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 8px; letter-spacing: .3px; }
.oc-date { color: var(--gray); font-size: 12px; margin-top: 3px; }
.oc-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--gray-dark); }
.oc-total { color: var(--maroon); font-weight: 800; font-size: 16px; }

/* ---------- Timeline ---------- */
.timeline { padding: 6px 0; }
.tl-step { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: #D1D5DB; flex-shrink: 0; }
.tl-dot.done { background: var(--green); }
.tl-dot.cancel { background: var(--red); }
.tl-label { font-size: 14px; color: var(--gray); }
.tl-label.done { color: var(--green); font-weight: 700; }

/* ---------- Radio payment ---------- */
.pay-opt {
    display: flex; align-items: center; gap: 10px; padding: 14px;
    background: var(--white); border: 1.5px solid var(--line); border-radius: 14px;
    margin-bottom: 10px; cursor: pointer;
}
.pay-opt.sel { border-color: var(--maroon); background: #FDF7F8; }
.pay-opt .po-radio {
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--gray);
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.pay-opt.sel .po-radio { border-color: var(--maroon); }
.pay-opt.sel .po-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--maroon); }
.pay-opt .po-text { font-weight: 700; font-size: 14px; }

/* ---------- Profile ---------- */
.profile-head {
    background: var(--maroon); color: #fff; border-radius: 14px; padding: 18px; margin-bottom: 14px;
}
.profile-head .ph-name { font-size: 21px; font-weight: 800; }
.profile-head .ph-sub { color: #E8D8D8; font-size: 13px; margin-top: 3px; }
.profile-head .ph-phone { color: var(--gold); font-size: 13px; }

/* ---------- Admin ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat {
    background: var(--white); border: 1px solid var(--line); border-radius: 14px;
    padding: 14px; text-align: center;
}
.stat .st-num { font-size: 24px; font-weight: 800; color: var(--maroon); }
.stat .st-label { color: var(--gray); font-size: 12px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.admin-row .ar-main { flex: 1; }
.admin-row .ar-title { font-weight: 700; font-size: 14px; }
.admin-row .ar-sub { color: var(--gray); font-size: 12px; }
.admin-row .ar-price { color: var(--maroon); font-weight: 800; font-size: 14px; }
.mini-btn { border: none; background: #EFE9DE; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.mini-btn.red { color: var(--red); }
.mini-btn.maroon { color: var(--maroon); }
.img-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.img-thumbs .thumb { position: relative; width: 84px; height: 84px; }
.img-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.img-thumbs .thumb .x {
    position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--red); color: #fff; border: none; font-size: 12px; cursor: pointer;
}
.radio-list label { display: block; padding: 8px 4px; font-size: 14px; font-weight: 600; cursor: pointer; }

/* ---------- Install banner ---------- */
.install-banner {
    display: flex; align-items: center; gap: 10px;
    background: var(--maroon); color: #fff;
    padding: 10px 12px; font-size: 13px;
 border-bottom: 1px solid rgba(255,255,255,0.15);
}
.install-banner .ib-info { flex: 1; }
.install-banner .ib-info b { font-size: 13px; }
.install-banner .ib-info small { color: #E8D8D8; font-size: 11px; }
.ib-btn {
    background: var(--gold); color: var(--black); border: none;
    border-radius: 8px; padding: 8px 14px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.ib-x { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 6px; }

/* ============ CONFETTI ============ */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 500; overflow: hidden; }
.confetti {
    position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px;
    animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
    to { transform: translateY(110vh) rotate(720deg); opacity: 0.6; }
}

/* ============ ROCKET TRACKING ============ */
.rocket-track { display: flex; align-items: center; margin: 12px 0 4px; }
.rocket-step { flex: 1; text-align: center; position: relative; color: var(--gray); }
.rocket-step::before { content: ""; position: absolute; top: 24px; left: 0; right: 0; height: 4px; background: #E5DED2; z-index: 0; }
.rocket-step.done { color: var(--maroon); }
.rocket-step.done::before { background: var(--maroon); }
.rocket-step .rs-ico { font-size: 26px; position: relative; z-index: 1; background: var(--cream); border-radius: 50%; padding: 4px; display: inline-block; }
.rocket-step .rs-label { font-size: 10px; font-weight: 700; margin-top: 2px; }
[data-theme="dark"] .rocket-step .rs-ico { background: #1E1E1E; }

/* ============ SPIN WHEEL ============ */
.spin-wrap { position: relative; width: 280px; height: 280px; margin: 0 auto; }
.spin-wheel { width: 280px; height: 280px; border-radius: 50%; position: relative; overflow: hidden;
    border: 8px solid var(--gold); box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform 4s cubic-bezier(.17,.67,.12,.99); }
.spin-seg { position: absolute; left: 50%; top: 50%; width: 140px; height: 280px; transform-origin: 0 0; text-align: center; }
.spin-seg span { display: block; transform: rotate(90deg); margin-top: 22px; font-size: 13px; font-weight: 800; color: #fff; }
.spin-pin { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 34px; z-index: 3; }
.spin-btn { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 4; }

/* ============ STREAK FLAME ============ */
.streak-flame { font-size: 30px; display: inline-block; animation: flame 1s ease-in-out infinite alternate; }
@keyframes flame { from { transform: scale(1); } to { transform: scale(1.15); } }

/* ============ BADGE MEDALS ============ */
.badge-medal { display: inline-block; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), #F5E6A8);
    display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 6px; box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.badge-medal.locked { filter: grayscale(1); opacity: .4; }

/* ============ ANNOUNCEMENT BAR ============ */
.announce-bar { background: linear-gradient(90deg, var(--maroon), var(--gold)); color: #fff; padding: 8px 12px; font-size: 13px; font-weight: 700; text-align: center; overflow: hidden; white-space: nowrap; }
.announce-bar span { display: inline-block; animation: ticker 12s linear infinite; }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* ============ TIER PROGRESS ============ */
.tier-progress { height: 10px; background: #EFE9DE; border-radius: 8px; overflow: hidden; margin-top: 8px; }
.tier-progress div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--maroon)); border-radius: 8px; transition: width .5s; }
[data-theme="dark"] .tier-progress { background: #2A2A2A; }

/* ============ QR ============ */
.qr-box { text-align: center; padding: 16px; }

/* ============ SPLASH ============ */
.splash-screen { position: fixed; inset: 0; background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); display: flex; align-items: center; justify-content: center; flex-direction: column; z-index: 999; transition: opacity .5s; }
.splash-screen .sp-logo { font-size: 64px; animation: pop .6s ease-out; }
.splash-screen .sp-name { color: #fff; font-size: 26px; font-weight: 800; letter-spacing: 2px; margin-top: 10px; animation: pop .8s ease-out; }
.splash-screen .sp-tag { color: var(--gold); font-size: 13px; margin-top: 6px; }
.splash-screen .sp-bar { width: 120px; height: 4px; background: rgba(255,255,255,.2); border-radius: 4px; margin-top: 24px; overflow: hidden; }
.splash-screen .sp-bar div { height: 100%; background: var(--gold); width: 0; animation: loadbar 1.6s ease forwards; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes loadbar { 0% { width: 0; } 100% { width: 100%; } }

/* ============ CART JOY BUMP ============ */
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }
.bump { animation: bump .4s ease; }

/* ============ SKELETON ============ */
.skel { background: linear-gradient(90deg, #EDE6DA 25%, #F5F0E8 50%, #EDE6DA 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
[data-theme="dark"] .skel { background: linear-gradient(90deg, #2A2A2A 25%, #333 50%, #2A2A2A 75%); background-size: 200% 100%; }

/* ============ PRICE MATCH ============ */
.pm-badge { display: inline-block; background: #E8F5E9; color: #2E7D32; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px; }

/* ============ COMMUNITY ============ */
.community-post { background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.community-post img { width: 100%; max-height: 260px; object-fit: cover; }
.community-post .cp-body { padding: 12px; }
.cp-head { display: flex; align-items: center; gap: 10px; }
.cp-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--maroon); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }

/* ============ POLL ============ */
.poll-opt { display: block; width: 100%; text-align: left; padding: 12px 14px; background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; font-weight: 600; position: relative; overflow: hidden; }
.poll-opt .poll-fill { position: absolute; inset: 0; background: rgba(201,162,39,.15); width: 0; transition: width .4s; }
.poll-opt span { position: relative; z-index: 1; }

/* ============ VIDEO REVIEW ============ */
.video-embed { width: 100%; aspect-ratio: 16/9; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; }

/* ============ BACK TO TOP (base style) ============ */
#backTopBtn { }

/* ---------- Toast / modal / loading ---------- */
.toast {
    position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
    background: #1F2937; color: #fff; padding: 11px 20px; border-radius: 24px;
    font-size: 13px; font-weight: 600; z-index: 300; opacity: 0; pointer-events: none;
    transition: opacity .25s; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; }
.overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
    background: var(--white); border-radius: 16px; padding: 22px; width: 100%; max-width: 360px;
}
.modal-text { font-size: 15px; color: var(--black); margin-bottom: 18px; line-height: 1.5; }
.modal-btns { display: flex; gap: 10px; }
.modal-btns .btn { flex: 1; }
.loading-modal { text-align: center; }
.loading-modal p { margin-top: 12px; color: var(--gray-dark); font-size: 14px; }
.spinner {
    width: 40px; height: 40px; border: 4px solid #EFE9DE; border-top-color: var(--maroon);
    border-radius: 50%; margin: 0 auto; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 40px 20px; color: var(--gray); }
.empty-emoji { font-size: 44px; margin-bottom: 10px; }
.empty-title { font-weight: 700; font-size: 16px; color: var(--gray-dark); }
.empty-sub { font-size: 13px; margin-top: 6px; }

.pad { padding: 12px; }
.mt10 { margin-top: 10px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.mb0 { margin-bottom: 0; }
.muted { color: var(--gray); }
.small { font-size: 12px; }
.center { text-align: center; }
.bold { font-weight: 800; }

.notif-row { display: flex; gap: 12px; align-items: flex-start; padding: 13px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.notif-ico { font-size: 20px; }
.notif-title { font-size: 14px; color: var(--gray-dark); }
.notif-time { font-size: 11px; color: var(--gray); margin-top: 4px; }

.banner-form-img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 12px; margin-top: 10px; }

/* sale price green */
.p-price.sale { color: var(--green) !important; }

/* ============ STYLE POLISH (v2) ============ */
/* smoother, modern feel */
body { -webkit-font-smoothing: antialiased; }

/* nicer cards with soft shadows */
.card, .product-card, .order-card, .summary, .cat-chip, .row-link, .cart-item, .admin-row, .notif-row, .community-post, .slot-chip {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow .2s ease, transform .15s ease;
}
.product-card:active, .row-link:active, .cat-chip:active, .order-card:active { transform: scale(0.98); }
.product-card:hover, .card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* smooth image loading */
img { transition: opacity .2s ease; }
img[loading="lazy"] { opacity: 0; }
img[loading="lazy"].loaded, img:not([loading="lazy"]) { opacity: 1; }

/* nicer buttons */
.btn { letter-spacing: .3px; transition: transform .12s ease, opacity .15s ease, box-shadow .2s; }
.btn:active { transform: scale(0.97); }
.btn-primary { box-shadow: 0 2px 6px rgba(142,31,47,0.3); }

/* nicer input focus */
.input:focus { box-shadow: 0 0 0 3px rgba(142,31,47,0.12); }

/* topbar subtle shadow */
.topbar { box-shadow: 0 2px 6px rgba(0,0,0,0.12); }

/* bottom nav active indicator */
.bottom-nav a.active .nav-ico { transform: scale(1.15); }
.bottom-nav a { transition: color .15s, transform .15s; }

/* product image zoom on hover (web) */
.product-img-wrap img { transition: transform .3s ease; }
.product-card:hover .product-img-wrap img { transform: scale(1.04); }

/* page fade-in */
#view { animation: pageIn .25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* nicer section titles */
.section-title { letter-spacing: .2px; }

/* badges nicer */
.status-badge { box-shadow: 0 1px 2px rgba(0,0,0,0.15); }

/* toast nicer */
.toast { box-shadow: 0 4px 14px rgba(0,0,0,0.25); }

/* skeleton smoother */
.skel { animation-duration: 1.4s; }
