/* ============================================================
   ShopBD — Mobile-first design system
   Palette: teal #0e7c66 (primary), amber #f59e0b (accent),
   ink #0f172a, surface #ffffff, bg #f8fafc
   ============================================================ */
:root {
    --primary: #0e7c66;
    --primary-dark: #0a5c4c;
    --primary-light: #e9f7f2;
    --accent: #f59e0b;
    --accent-soft: #fef3c7;
    --ink: #0f172a;
    --ink-soft: #475569;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f8fafc;
    --surface: #ffffff;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
    --shadow-lg: 0 8px 30px rgba(15, 23, 42, .12);
    --header-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Bengali", sans-serif;
    font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg);
    padding-bottom: calc(62px + env(safe-area-inset-bottom)); /* bottom nav space */
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 14px; }
.container.narrow { max-width: 640px; }
.narrow-page { max-width: 720px; }
.d-none { display: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
    font-weight: 600; font-size: .95rem; line-height: 1.2; text-align: center;
    transition: background .15s, color .15s, border-color .15s, transform .05s;
    min-height: 44px; /* touch target */
    text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary-dark); }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-sm { padding: 6px 12px; min-height: 36px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; color: var(--primary); padding: 0; font-size: .88rem; }
.link-btn.danger { color: var(--danger); }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.form-field label { font-weight: 600; font-size: .88rem; color: var(--ink); }
.form-field input, .form-field select, .form-field textarea, .search-form input {
    padding: 11px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: #fff; color: var(--ink); width: 100%; min-height: 44px;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 124, 102, .12);
}
.form-field input:disabled { background: #f1f5f9; color: var(--muted); }
.field-hint { font-size: .78rem; color: var(--muted); }
.field-error { color: var(--danger); font-size: .8rem; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: .92rem; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---------- Alerts & toasts ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-size: .92rem; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.toast-stack { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 380px); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .9rem; display: flex; align-items: center; gap: 10px; animation: toast-in .25s ease; }
.toast.success { background: #065f46; } .toast.error { background: #991b1b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 120; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.header-top { padding: 8px 0; }
.header-top-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo { flex: 0 0 auto; }
.logo img { height: 34px; width: auto; display: block; }
.search-form { flex: 1 1 100%; order: 10; position: relative; display: flex; }
.search-form input { border-radius: 10px 0 0 10px; border-right: 0; min-height: 40px; font-size: .92rem; }
.search-form button { border: 1.5px solid var(--line); border-left: 0; background: var(--primary); border-radius: 0 10px 10px 0; width: 44px; display: grid; place-items: center; color: #fff; }
.search-form button img { filter: brightness(0) invert(1); }
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 50; }
.search-suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search-suggest a:last-child { border-bottom: 0; }
.search-suggest img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.search-suggest .sg-price { color: var(--primary); font-weight: 700; margin-left: auto; }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; padding: 6px 8px; color: var(--ink); font-size: .68rem; min-width: 40px; min-height: 44px; justify-content: center; }
.icon-btn img { color: currentColor; }
.badge-dot { position: absolute; top: 2px; right: 2px; background: var(--accent); color: #fff; font-size: .66rem; font-weight: 700; border-radius: 999px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }

.cat-nav { background: var(--surface); border-top: 1px solid var(--line); }
.cat-nav-row { display: flex; gap: 4px; overflow-x: auto; padding: 0 14px; scrollbar-width: none; }
.cat-nav-row::-webkit-scrollbar { display: none; }
.cat-item { position: relative; }
.cat-link { display: inline-block; padding: 10px 12px; color: var(--ink); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.cat-link:hover { color: var(--primary); }
.cat-flash { color: var(--accent); }
.cat-dropdown { display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 210px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; box-shadow: var(--shadow-lg); padding: 6px 0; z-index: 60; }
.cat-item:hover .cat-dropdown { display: block; }
.cat-dropdown a { display: block; padding: 8px 16px; color: var(--ink); font-size: .88rem; }
.cat-dropdown a:hover { background: var(--primary-light); color: var(--primary-dark); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    display: flex; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; color: var(--muted); font-size: .68rem; position: relative; min-height: 56px; justify-content: center; }
.bn-item.is-active, .bn-item:hover { color: var(--primary); }

/* ---------- Sections ---------- */
.section { margin: 22px 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-title { font-size: 1.12rem; font-weight: 800; margin: 0; }
.see-all { margin-left: auto; font-weight: 600; font-size: .88rem; }
.page-title { font-size: 1.35rem; margin: 18px 0 14px; }
.breadcrumbs { font-size: .82rem; color: var(--muted); margin: 12px 0; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Hero ---------- */
.hero { margin-top: 12px; }
.hero-slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); scrollbar-width: none; }
.hero-slider::-webkit-scrollbar { display: none; }
.hero-slide { flex: 0 0 100%; scroll-snap-align: start; background: linear-gradient(135deg, var(--hero-bg, #0e7c66), color-mix(in srgb, var(--hero-bg, #0e7c66) 72%, #000 28%)); color: var(--hero-text, #fff); min-height: 170px; display: flex; }
.hero-slide-inner { padding: 26px 22px; display: flex; flex-direction: column; justify-content: center; gap: 8px; max-width: 520px; }
.hero-slide h1 { font-size: 1.5rem; margin: 0; }
.hero-slide p { margin: 0; opacity: .92; font-size: .92rem; }
.hero-slide .btn { align-self: flex-start; margin-top: 6px; }
.hero-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.hero-dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; background: #cbd5e1; padding: 0; }
.hero-dots button.is-active { background: var(--primary); width: 20px; border-radius: 4px; }

.strip-row { display: grid; gap: 8px; margin-top: 10px; }
.strip-banner { display: block; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--strip-bg); color: var(--strip-text); font-weight: 600; font-size: .85rem; }

/* ---------- Category circles ---------- */
.cat-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-circle { flex: 0 0 auto; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--ink); }
.cat-circle-icon { width: 58px; height: 58px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); font-weight: 800; display: grid; place-items: center; font-size: .95rem; border: 1.5px solid #d3ece4; }
.cat-circle-name { font-size: .72rem; line-height: 1.2; }

/* ---------- Product cards & grids ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.product-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; display: flex; flex-direction: column; }
.pc-media { position: relative; display: block; aspect-ratio: 1; background: #f1f5f9; }
.pc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-badge { position: absolute; top: 8px; left: 8px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.pc-badge-flash { left: auto; right: 8px; background: var(--accent); }
.pc-out-label { position: absolute; inset: auto 0 0; background: rgba(15,23,42,.72); color: #fff; text-align: center; font-size: .75rem; padding: 4px; }
.pc-wish { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); display: grid; place-items: center; color: var(--muted); box-shadow: var(--shadow); }
.pc-wish.is-active { color: var(--danger); }
.pc-wish.is-active img { fill: currentColor; }
.product-card.is-out .pc-media img { opacity: .55; }
.pc-body { padding: 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.pc-name { color: var(--ink); font-size: .86rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.pc-rating { display: flex; align-items: center; gap: 5px; }
.stars { position: relative; display: inline-block; font-size: .78rem; color: #d1d5db; }
.stars::before { content: "★★★★★"; letter-spacing: 1px; }
.stars::after { content: "★★★★★"; letter-spacing: 1px; position: absolute; left: 0; top: 0; color: var(--accent); width: calc(var(--rating, 0) / 5 * 100%); overflow: hidden; white-space: nowrap; }
.pc-rating-count { font-size: .72rem; color: var(--muted); }
.pc-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pc-price-now { color: var(--primary-dark); font-weight: 800; font-size: .98rem; }
.pc-price-old { color: var(--muted); text-decoration: line-through; font-size: .78rem; }
.pc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: auto; }
.pc-actions .btn { padding: 6px 6px; min-height: 36px; font-size: .8rem; }
.btn-add-cart { margin-top: auto; }

/* ---------- Flash countdown ---------- */
.flash-section { background: linear-gradient(180deg, #fff7ed, var(--bg)); padding: 18px 0; border-block: 1px solid #fde68a; }
.flash-countdown { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: .9rem; color: var(--danger); }
.cd-box { background: #fff; border: 1px solid #fecaca; border-radius: 6px; padding: 3px 6px; min-width: 30px; text-align: center; }

/* ---------- Promo / why / reviews / blog ---------- */
.promo-wrap { margin: 18px 0; }
.promo-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px; border-radius: var(--radius); background: linear-gradient(120deg, var(--hero-bg, #1d3557), color-mix(in srgb, var(--hero-bg, #1d3557) 75%, #000 25%)); color: var(--hero-text, #fff); }
.promo-banner h3 { margin: 0 0 4px; font-size: 1.15rem; }
.promo-banner p { margin: 0; opacity: .9; font-size: .88rem; }
.why-section { background: var(--surface); padding: 22px 0; border-block: 1px solid var(--line); }
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.why-item img { color: var(--primary); margin-bottom: 6px; }
.why-item h3 { font-size: .95rem; margin: 0 0 3px; }
.why-item p { font-size: .8rem; color: var(--muted); margin: 0; }
.review-grid { display: grid; gap: 12px; }
.review-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.review-stars { color: var(--accent); letter-spacing: 2px; font-size: .85rem; }
.review-meta { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.blog-grid { display: grid; gap: 12px; }
.blog-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.blog-card:hover { border-color: var(--primary); }
.blog-card h3 { margin: 0; font-size: 1rem; }
.blog-card p { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.blog-card time { font-size: .75rem; color: var(--muted); }
.blog-cat { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--primary); }
.popcat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.popcat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); }
.popcat strong { display: block; font-size: .92rem; }
.popcat span { font-size: .78rem; color: var(--muted); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 44px 18px; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line); margin: 18px 0; }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.empty-state .btn { margin-top: 12px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.page-link { padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font-size: .88rem; }
.page-link.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-dots { align-self: center; color: var(--muted); }

/* ---------- Category page ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sort-form { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: .85rem; }
.sort-form select { padding: 7px 8px; border-radius: 8px; border: 1.5px solid var(--line); min-height: 38px; }
.toolbar-count { font-size: .82rem; color: var(--muted); }
.filter-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.filter-close { background: none; border: 0; font-size: 1rem; color: var(--muted); }
.filter-group { border: 0; padding: 0 0 10px; margin: 0 0 10px; border-bottom: 1px solid var(--line); }
.filter-group legend { font-weight: 700; font-size: .85rem; padding: 0; margin-bottom: 4px; }
.price-row { display: flex; gap: 6px; align-items: center; }
.price-row input { width: 100%; padding: 8px; border: 1.5px solid var(--line); border-radius: 8px; }
.subcat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; scrollbar-width: none; }
.subcat-chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 7px 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); font-size: .84rem; font-weight: 600; }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Product page ---------- */
.product-layout { display: block; }
.pg-main { position: relative; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.pg-main img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: #fff; }
.pg-badge { position: absolute; top: 10px; left: 10px; background: var(--danger); color: #fff; font-weight: 800; padding: 4px 9px; border-radius: 8px; }
.pg-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.pg-thumb { flex: 0 0 auto; width: 60px; height: 60px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; padding: 0; background: #fff; }
.pg-thumb.is-active { border-color: var(--primary); }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { margin-top: 14px; }
.pi-title { font-size: 1.25rem; }
.pi-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); margin-bottom: 10px; }
.pi-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.pi-price-now { font-size: 1.55rem; font-weight: 800; color: var(--primary-dark); }
.pi-price-old { color: var(--muted); text-decoration: line-through; font-size: 1rem; }
.pi-stock { font-size: .86rem; font-weight: 700; color: var(--success); margin-bottom: 12px; }
.pi-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.qty-stepper { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.qty-stepper button { width: 40px; height: 44px; border: 0; background: #f8fafc; font-size: 1.1rem; color: var(--ink); }
.qty-stepper input { width: 48px; text-align: center; border: 0; min-height: 44px; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pi-trust { display: flex; flex-wrap: wrap; gap: 8px; font-size: .78rem; color: var(--ink-soft); margin-bottom: 12px; }
.pi-trust span { background: var(--primary-light); border-radius: 999px; padding: 5px 10px; }
.pi-short { font-size: .92rem; color: var(--ink-soft); }
.pi-variants { margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.variant-label { font-weight: 700; font-size: .88rem; }
.variant-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.variant-chip { padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: .88rem; font-weight: 600; color: var(--ink); }
.variant-chip.is-selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.variant-chip:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.variant-chip[data-value-id][style*="--chip-color"]::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--chip-color); margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.variant-hint { font-size: .78rem; color: var(--danger); margin: 4px 0 0; }
.variant-hint.is-ok { color: var(--success); }

.product-tabs { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tab-nav { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-btn { flex: 1 0 auto; padding: 13px 16px; border: 0; background: none; font-weight: 700; font-size: .9rem; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tab-btn.is-active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab-panel { padding: 16px; display: none; }
.tab-panel.is-active { display: block; }
.rich-text { font-size: .93rem; color: var(--ink-soft); }
.rich-text h2, .rich-text h3 { color: var(--ink); }
.spec-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.spec-table th, .spec-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.spec-table th { color: var(--muted); width: 40%; font-weight: 600; }
.review-form { background: var(--bg); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.rating-input { display: flex; gap: 6px; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input label { cursor: pointer; border: 1.5px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: .85rem; background: #fff; }
.rating-input input { accent-color: var(--accent); }
.review-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.review-item:last-child { border-bottom: 0; }
.review-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; }
.verified-badge { font-size: .7rem; background: #ecfdf5; color: #065f46; border-radius: 999px; padding: 2px 8px; font-weight: 700; }
.review-item time { margin-left: auto; font-size: .76rem; color: var(--muted); }
.review-item p { margin: 6px 0 0; font-size: .9rem; color: var(--ink-soft); }
.review-login-hint { background: var(--primary-light); padding: 10px 14px; border-radius: 8px; font-size: .88rem; }

.sticky-buy { position: fixed; bottom: calc(56px + env(safe-area-inset-bottom)); left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(15,23,42,.08); display: flex; gap: 8px; padding: 10px 14px; z-index: 140; align-items: center; }
.sticky-buy .btn { flex: 1; min-height: 46px; }
.sticky-buy-price { display: flex; flex-direction: column; line-height: 1.1; }
.sticky-buy-price strong { color: var(--primary-dark); font-size: 1.05rem; }
.sticky-buy-price s { color: var(--muted); font-size: .75rem; }

/* ---------- Cart / checkout ---------- */
.cart-layout, .checkout-layout { display: block; }
.cart-items { display: flex; flex-direction: column; gap: 10px; }
.cart-item { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.ci-image img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.ci-body { flex: 1; }
.ci-name { font-weight: 600; color: var(--ink); font-size: .92rem; }
.ci-variant { font-size: .8rem; color: var(--muted); }
.ci-price { color: var(--primary-dark); font-weight: 700; margin: 4px 0; }
.ci-controls { display: flex; align-items: center; gap: 12px; }
.ci-remove { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--danger); font-size: .8rem; }
.ci-line-total { font-weight: 800; white-space: nowrap; align-self: flex-start; }
.cart-summary, .checkout-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.cs-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: .92rem; }
.cs-row.cs-discount strong { color: var(--success); }
.cs-total { display: flex; justify-content: space-between; border-top: 1.5px dashed var(--line); margin-top: 8px; padding-top: 12px; font-size: 1.05rem; font-weight: 800; }
.cs-total strong { color: var(--primary-dark); }
.coupon-form { display: flex; gap: 8px; margin: 12px 0; }
.coupon-form input { flex: 1; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px; text-transform: uppercase; }
.continue-shopping { display: block; text-align: center; margin-top: 10px; font-size: .86rem; }
.checkout-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.checkout-card h2 { font-size: 1.02rem; }
.pay-methods { display: grid; gap: 10px; }
.pay-method { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; }
.pay-method.is-selected { border-color: var(--primary); background: var(--primary-light); }
.pay-method input { grid-row: 1 / span 2; align-self: center; accent-color: var(--primary); width: 18px; height: 18px; }
.pm-name { font-weight: 700; }
.pm-desc { grid-column: 2; font-size: .8rem; color: var(--muted); }
.co-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.co-item { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.co-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.co-item-info { flex: 1; display: flex; flex-direction: column; }
.co-item-name { font-weight: 600; line-height: 1.3; }
.co-item-qty { color: var(--muted); font-size: .8rem; }
.co-secure { font-size: .78rem; color: var(--muted); text-align: center; margin: 10px 0 0; }

/* ---------- Quick checkout popup (Buy Now) ---------- */
.qc-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .22s ease; }
.qc-overlay.is-open { opacity: 1; }
.qc-dialog { background: var(--surface); width: 100%; max-width: 540px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 20px 18px 22px; position: relative; transform: translateY(48px); transition: transform .26s cubic-bezier(.2, .8, .3, 1.1); box-shadow: var(--shadow-lg); }
.qc-overlay.is-open .qc-dialog { transform: translateY(0); }
.qc-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); font-size: 1.25rem; line-height: 1; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.qc-close:hover { background: var(--line); }
.qc-title { font-size: 1.05rem; margin: 0 0 14px; padding-right: 40px; }
.qc-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 34px 0; color: var(--muted); font-size: .9rem; }
.spinner-dark { border: 2.5px solid var(--line); border-top-color: var(--primary); }
.qc-product { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 14px; }
.qc-product > img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.qc-product-info { flex: 1; min-width: 0; }
.qc-product-name { color: var(--ink); font-weight: 700; font-size: .92rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qc-product-price { color: var(--primary-dark); font-weight: 800; margin-top: 3px; font-size: 1.02rem; }
.qc-price-old { color: var(--muted); font-size: .8rem; font-weight: 400; }
.qc-qty input { min-height: 38px; }
.qc-variant-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: 16px 14px; text-align: center; font-size: .9rem; color: #92400e; }
.qc-variant-note .btn { margin-top: 10px; }
.qc-summary { background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 4px 14px 8px; margin: 14px 0; }
.qc-summary .cs-total { padding-top: 8px; margin-top: 4px; border-top: 1.5px dashed var(--line); }
.qc-secure { text-align: center; font-size: .8rem; color: var(--muted); margin: 10px 0 0; }

/* ---------- Footer ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 30px; padding: 32px 0 0; font-size: .9rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin: 0 0 14px; position: relative; padding-bottom: 10px; }
.site-footer h4::after { content: ""; position: absolute; left: 0; bottom: 0; width: 30px; height: 2.5px; border-radius: 2px; background: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 26px; padding-bottom: 28px; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.footer-about { color: #94a3b8; font-size: .86rem; line-height: 1.65; margin: 0 0 12px; }
.footer-col > a { color: #cbd5e1; padding: 4px 0; font-size: .88rem; transition: color .15s, transform .15s; }
.footer-col > a:hover { color: #fff; transform: translateX(3px); }
.footer-col p { color: #94a3b8; margin: 0 0 6px; font-size: .86rem; }
.footer-col p a { color: #5eead4; font-weight: 700; }
.footer-social { display: flex; gap: 8px; margin-top: 6px; }
.footer-social a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08); color: #e2e8f0; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; transition: background .15s, color .15s, transform .15s; }
.footer-social a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.newsletter-form { display: flex; width: 100%; max-width: 300px; margin-top: 8px; background: #fff; border-radius: 10px; overflow: hidden; }
.newsletter-form input { flex: 1; border: 0; padding: 10px 12px; font-size: .85rem; min-width: 0; color: var(--ink); outline: none; }
.newsletter-form button { border: 0; background: var(--primary); color: #fff; font-weight: 700; font-size: .82rem; padding: 10px 14px; cursor: pointer; }
.newsletter-form button:hover { background: var(--primary-dark); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 0; }
.footer-bottom-row { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: .8rem; color: #94a3b8; }
.pay-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pay-badge { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #e2e8f0; font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; }

/* ---------- Auth ---------- */
.auth-page { display: grid; place-items: center; min-height: 60vh; padding: 24px 14px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth-row { display: flex; justify-content: flex-end; margin: 4px 0 14px; font-size: .85rem; }
.auth-alt { text-align: center; margin-top: 16px; font-size: .9rem; }

/* ---------- Order success / track ---------- */
.success-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; margin: 22px 0; }
.success-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: #ecfdf5; color: var(--success); font-size: 1.8rem; font-weight: 800; display: grid; place-items: center; }
.success-summary { text-align: left; margin: 18px 0; border-top: 1px solid var(--line); padding-top: 10px; }
.success-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.track-result { margin-top: 16px; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.history-list li:last-child { border-bottom: 0; }
.order-timeline { display: flex; margin: 18px 0 6px; }
.tl-step { flex: 1; text-align: center; position: relative; }
.tl-step::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2.5px; background: var(--line); }
.tl-step:first-child::before { display: none; }
.tl-step.is-done::before { background: var(--primary); }
.tl-dot { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--line); margin: 0 auto 6px; position: relative; z-index: 1; }
.tl-step.is-done .tl-dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.tl-label { font-size: .68rem; color: var(--muted); }
.tl-step.is-done .tl-label { color: var(--primary-dark); font-weight: 700; }
.order-detail-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.order-detail-head h1 { font-size: 1.2rem; margin: 0; }
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: #e2e8f0; color: var(--ink); white-space: nowrap; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-processing { background: #ede9fe; color: #5b21b6; }
.status-shipped { background: #cffafe; color: #155e75; }
.status-delivered { background: #dcfce7; color: #166534; }
.status-cancelled, .status-returned { background: #fee2e2; color: #991b1b; }
.status-return_requested { background: #ffedd5; color: #9a3412; }

/* ---------- Account ---------- */
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0 4px; }
.account-head h1 { margin-bottom: 2px; }
.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; padding: 14px; color: var(--ink); }
.stat-card strong { display: block; font-size: 1.3rem; color: var(--primary-dark); }
.stat-card span { font-size: .78rem; color: var(--muted); }
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; color: var(--ink); }
.order-row .muted { display: block; font-size: .78rem; }
.order-row-right { display: flex; align-items: center; gap: 10px; }
.address-list { display: grid; gap: 10px; margin-bottom: 14px; }
.address-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.address-card.is-default { border-color: var(--primary); }
.address-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.address-actions { display: flex; gap: 14px; margin-top: 8px; }

/* ---------- Brands / blog post / static ---------- */
.brand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.brand-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); }
.brand-initial { width: 54px; height: 54px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.blog-post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.blog-meta { font-size: .8rem; color: var(--muted); }
.blog-cover { border-radius: var(--radius-sm); margin: 10px 0; }
.static-page { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* ---------- Error pages ---------- */
.error-page { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 8px; padding: 20px; }
.error-page h1 { font-size: 4rem; color: var(--primary); margin: 0; }

/* ============================================================
   ≥ 640px (md)
   ============================================================ */
@media (min-width: 640px) {
    .form-row { grid-template-columns: 1fr 1fr; }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .hscroll { grid-auto-columns: 30%; }
    .popcat-grid { grid-template-columns: repeat(4, 1fr); }
    .why-grid { grid-template-columns: repeat(4, 1fr); }
    .review-grid { grid-template-columns: repeat(3, 1fr); }
    .blog-grid { grid-template-columns: repeat(3, 1fr); }
    .brand-grid { grid-template-columns: repeat(4, 1fr); }
    .strip-row { grid-template-columns: repeat(2, 1fr); }
    .hero-slide { min-height: 230px; }
    .hero-slide h1 { font-size: 1.9rem; }
    .search-form { flex: 1 1 auto; order: 0; }
    .header-actions { margin-left: 0; }
    .d-md-inline { display: inline; }
    .d-md-block { display: block; }
    .d-md-flex { display: flex; }
    .qc-overlay { align-items: center; padding: 20px; }
    .qc-dialog { border-radius: 16px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom-row { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* ============================================================
   ≥ 900px (lg): desktop — hide bottom nav, show sidebar layouts
   ============================================================ */
@media (min-width: 900px) {
    body { padding-bottom: 0; font-size: 15.5px; }
    .bottom-nav { display: none; }
    .sticky-buy { display: none; }
    .product-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .hscroll { grid-auto-columns: 22%; }
    .category-layout { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
    .filter-panel { display: block !important; position: sticky; top: 110px; }
    .filter-head, #filterToggle { display: none; }
    .product-layout { display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: 30px; align-items: start; }
    .product-info { margin-top: 0; }
    .cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
    .checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
    .cart-summary, .checkout-summary { position: sticky; top: 110px; margin-top: 0; }
    .header-actions .d-none { display: inline; }

    /* Roomier header + navigation */
    .header-top { padding: 12px 0; }
    .logo img { height: 38px; }
    .search-form input { min-height: 42px; font-size: .95rem; }
    .header-actions { gap: 6px; }
    .icon-btn { flex-direction: row; gap: 7px; font-size: .8rem; min-height: 40px; }
    .cat-nav-row { justify-content: center; gap: 6px; }
    .cat-link { padding: 11px 16px; font-size: .92rem; }

    /* Roomier sections & hero */
    .section { margin: 32px 0; }
    .section-title { font-size: 1.3rem; }
    .hero { margin-top: 18px; }
    .hero-slide { min-height: 320px; border-radius: var(--radius); }
    .hero-slide-inner { max-width: 620px; padding: 42px 40px; }
    .hero-slide h1 { font-size: 2.35rem; }
    .hero-slide p { font-size: 1.02rem; }
    .hero-dots { margin-top: 14px; }
    .cat-circle { width: 92px; }
    .cat-circle-icon { width: 72px; height: 72px; font-size: 1.15rem; }
    .cat-circle-name { font-size: .8rem; }
    .why-section { padding: 34px 0; }
    .why-item { text-align: center; }
    .promo-banner { padding: 30px 34px; }
    .page-title { font-size: 1.6rem; }
    .site-footer { padding-top: 44px; margin-top: 40px; }
    .site-footer h4 { font-size: 1rem; }
}

/* ============================================================
   ≥ 1200px (xl): full desktop polish
   ============================================================ */
@media (min-width: 1200px) {
    .container { max-width: 1280px; padding: 0 24px; }
    .product-grid { grid-template-columns: repeat(5, 1fr); }
    .hscroll { grid-auto-columns: 18.4%; }
    .hero-slide { min-height: 360px; }
    .hero-slide h1 { font-size: 2.6rem; }
    .product-layout { grid-template-columns: minmax(0, 540px) 1fr; gap: 40px; }
    .cart-layout { grid-template-columns: 1fr 400px; gap: 26px; }
    .checkout-layout { grid-template-columns: 1fr 420px; gap: 26px; }
    .pc-name { font-size: .9rem; }
    .pc-actions .btn { min-height: 38px; font-size: .84rem; }
}

/* Print (invoice-ish) */
@media print {
    .site-header, .site-footer, .bottom-nav, .sticky-buy, .toast-stack { display: none !important; }
}
