/* ============================================================
   MarketWaveStores — Design System (v2)
   Tailwind-style tokens · Royal blue / Green / Gold · Light + Dark
   Sits on top of Bootstrap 5. Prefix: --mws-*
   ============================================================ */

/* ---------- Design tokens: LIGHT ----------
   Palette: #266ef6 #0275d8 #00aaff · #6d2aff · #0b355a #e8eaf6 · #f47321 · #e2123c */
:root {
    /* Brand — blue scale */
    --mws-royal:        #0b355a;  /* deep navy brand */
    --mws-royal-700:    #0b355a;
    --mws-primary:      #266ef6;  /* primary action */
    --mws-primary-600:  #266ef6;
    --mws-primary-700:  #0275d8;  /* darker hover */
    --mws-blue:         #00aaff;  /* bright sky accent */
    --mws-blue-300:     #8fd6ff;
    --mws-blue-50:      #e8eaf6;  /* tinted surface (lavender) */

    /* Accent — violet */
    --mws-purple:       #6d2aff;
    --mws-purple-600:   #5a1fe0;
    --mws-purple-50:    #efe9ff;

    /* Growth — green (semantic success/in-stock only) */
    --mws-green:        #12a36b;
    --mws-green-500:    #16b877;
    --mws-green-50:     #e7f8f0;

    /* Premium / CTA — orange */
    --mws-gold:         #f47321;
    --mws-gold-600:     #d85f12;
    --mws-gold-50:      #fff1e6;

    /* Feedback */
    --mws-danger:       #e2123c;
    --mws-warning:      #f47321;
    --mws-info:         #00aaff;

    /* Neutrals */
    --mws-bg:           #f4f6fc;
    --mws-bg-elev:      #ffffff;
    --mws-surface:      #ffffff;
    --mws-surface-2:    #eef1f9;
    --mws-text:         #0b355a;
    --mws-text-muted:   #566581;
    --mws-border:       #dde3f1;
    --mws-border-strong:#c4cde1;

    /* Chrome */
    --mws-navbar-bg:    #0b355a;
    --mws-navbar-text:  #cdd9ef;
    --mws-navbar-active:#ffffff;
    --mws-footer-bg:    #071f38;

    /* Effects */
    --mws-shadow-sm: 0 1px 2px rgba(11,53,90,.06), 0 1px 3px rgba(11,53,90,.09);
    --mws-shadow:    0 4px 6px -1px rgba(11,53,90,.10), 0 2px 4px -2px rgba(11,53,90,.07);
    --mws-shadow-lg: 0 14px 32px -10px rgba(38,110,246,.28), 0 6px 14px -6px rgba(11,53,90,.14);
    --mws-ring:      0 0 0 3px rgba(38,110,246,.30);

    --mws-radius:     .75rem;
    --mws-radius-sm:  .5rem;
    --mws-radius-lg:  1rem;
    --mws-radius-pill:999px;

    --mws-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Let native controls (scrollbars, date pickers, form widgets) follow the theme */
:root { color-scheme: light; }
html.dark { color-scheme: dark; }

/* ---------- Design tokens: DARK ----------
   Rich navy base (from #0b355a) with #e8eaf6 text — soft, high-contrast, low eye-strain. */
html.dark {
    --mws-royal:        #4d8dff;
    --mws-royal-700:    #266ef6;
    --mws-primary:      #4d8dff;
    --mws-primary-600:  #4d8dff;
    --mws-primary-700:  #266ef6;
    --mws-blue:         #33bbff;
    --mws-blue-300:     #7fd4ff;
    --mws-blue-50:      #10233d;

    --mws-purple:       #9a6bff;
    --mws-purple-600:   #6d2aff;
    --mws-purple-50:    #1e1140;

    --mws-green:        #2fd39a;
    --mws-green-500:    #16b877;
    --mws-green-50:     #06251b;

    --mws-gold:         #ff8c42;
    --mws-gold-600:     #f47321;
    --mws-gold-50:      #3a2410;

    --mws-danger:       #ff5c78;
    --mws-warning:      #ff8c42;
    --mws-info:         #33bbff;

    --mws-bg:           #08192b;
    --mws-bg-elev:      #0c2138;
    --mws-surface:      #0f2742;
    --mws-surface-2:    #16324f;
    --mws-text:         #e8eaf6;
    --mws-text-muted:   #9fb1cf;
    --mws-border:       #21395a;
    --mws-border-strong:#2f4a70;

    --mws-navbar-bg:    #071726;
    --mws-navbar-text:  #b9c6e6;
    --mws-navbar-active:#ffffff;
    --mws-footer-bg:    #050f1c;

    --mws-shadow-sm: 0 1px 2px rgba(0,0,0,.45);
    --mws-shadow:    0 6px 14px rgba(0,0,0,.5);
    --mws-shadow-lg: 0 18px 44px -12px rgba(0,0,0,.65);
    --mws-ring:      0 0 0 3px rgba(77,141,255,.45);
}

/* ---------- Base ---------- */
* { scroll-behavior: smooth; }
body {
    font-family: var(--mws-font);
    background-color: var(--mws-bg);
    color: var(--mws-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .25s ease, color .25s ease;
}
h1,h2,h3,h4,h5,h6 { font-weight: 700; letter-spacing: -.01em; color: var(--mws-text); }
a { color: var(--mws-primary); text-decoration: none; }
a:hover { color: var(--mws-royal-700); }
.text-mws-muted { color: var(--mws-text-muted) !important; }
.text-mws-gold  { color: var(--mws-gold-600) !important; }
.text-mws-green { color: var(--mws-green) !important; }
.text-mws-primary { color: var(--mws-primary) !important; }
.bg-mws-surface { background: var(--mws-surface) !important; }
.bg-mws-tint    { background: var(--mws-blue-50) !important; }
.border-mws { border-color: var(--mws-border) !important; }
::selection { background: var(--mws-blue-300); color: #0f172a; }

/* Content container helper */
.mws-container { max-width: 1440px; }
@media (min-width: 1200px) { .container.mws-container { max-width: 1440px; } }

/* ---------- Announcement bar ---------- */
.mws-announce {
    background: linear-gradient(90deg, #0b355a 0%, #266ef6 52%, #6d2aff 100%);
    color: #fff; font-size: .82rem; font-weight: 600; letter-spacing: .01em;
    padding: .45rem 0; text-align: center;
}
.mws-announce .announce-close {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: rgba(255,255,255,.85); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.mws-announce .announce-close:hover { color: #fff; }

/* ---------- Category tabs (home) ---------- */
.mws-tabs { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.mws-tab {
    padding: .5rem 1.1rem; border-radius: var(--mws-radius-pill); font-weight: 700; font-size: .9rem;
    color: var(--mws-text); background: transparent; border: 1px solid transparent; white-space: nowrap; transition: all .18s;
}
.mws-tab:hover { color: var(--mws-primary); background: var(--mws-blue-50); }
.mws-tab.active { color: #fff; background: var(--mws-primary); }

/* ---------- Product-card quick actions & badges ---------- */
.product-card .card-badges { position: absolute; top: .6rem; left: .6rem; z-index: 3; display: flex; flex-direction: column; gap: .3rem; }
.card-badge { font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    padding: .22rem .5rem; border-radius: var(--mws-radius-pill); color: #fff; }
.card-badge.new { background: var(--mws-primary); }
.card-badge.hot { background: var(--mws-danger); }
.card-badge.sale { background: linear-gradient(135deg, var(--mws-gold), var(--mws-gold-600)); color: #2a1400; }
.product-card .quick-actions {
    position: absolute; top: .6rem; right: .6rem; z-index: 3; display: flex; flex-direction: column; gap: .4rem;
    opacity: 0; transform: translateX(8px); transition: all .2s ease;
}
.product-card:hover .quick-actions { opacity: 1; transform: none; }
.qa-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--mws-surface); color: var(--mws-text);
    box-shadow: var(--mws-shadow); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s;
}
.qa-btn:hover { background: var(--mws-primary); color: #fff; transform: scale(1.08); }
.qa-btn.liked { color: var(--mws-danger); }
.qa-btn.saved { color: var(--mws-gold-600); }
.product-card .quick-add {
    position: absolute; left: .6rem; right: .6rem; bottom: .6rem; z-index: 3; opacity: 0; transform: translateY(8px);
    transition: all .2s ease;
}
.product-card:hover .quick-add { opacity: 1; transform: none; }
@media (hover: none) { .product-card .quick-actions, .product-card .quick-add { opacity: 1; transform: none; } }

/* ---------- Navbar ---------- */
.mws-navbar {
    background: var(--mws-navbar-bg) !important;
    box-shadow: var(--mws-shadow);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #266ef6, #6d2aff 50%, #00aaff) 1;
}
.mws-navbar .navbar-brand {
    font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; color:#fff !important;
}
.mws-navbar .navbar-brand .brand-mark { color: var(--mws-gold); }
/* MWS text wordmark — the brand logo (no icon) */
.mws-wordmark {
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; letter-spacing: .06em; line-height: 1;
    color: #fff; background: linear-gradient(135deg, var(--mws-royal-700, #1e40af), var(--mws-primary, #2563eb));
    padding: .3em .5em; border-radius: .5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.mws-navbar .navbar-brand .mws-wordmark { font-size: 1.05rem; }
.mws-wordmark-sm { font-size: .8rem; padding: .25em .45em; vertical-align: middle; }
.mws-navbar .nav-link {
    color: var(--mws-navbar-text) !important;
    font-weight: 500; border-radius: var(--mws-radius-sm);
    padding: .45rem .8rem !important; position: relative; transition: color .18s, background .18s;
}
.mws-navbar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.08); }
.mws-navbar .nav-link.active { color: var(--mws-navbar-active) !important; }
.mws-navbar .nav-link.active::after {
    content:''; position:absolute; left:.8rem; right:.8rem; bottom:.1rem; height:3px;
    border-radius:3px; background: var(--mws-gold);
}
.mws-search {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color:#fff; border-radius: var(--mws-radius-pill);
}
.mws-search::placeholder { color: rgba(255,255,255,.6); }
.mws-search:focus {
    background: rgba(255,255,255,.18); color:#fff;
    border-color: var(--mws-gold); box-shadow: 0 0 0 3px rgba(212,175,55,.25);
}
.mws-navbar .btn-search { border-color: rgba(255,255,255,.25); color:#fff; border-radius: var(--mws-radius-pill); }
.mws-navbar .btn-search:hover { background: var(--mws-gold); border-color: var(--mws-gold); color:#0f172a; }
.cart-badge { position:absolute; top:-4px; right:-6px; font-size:.62rem; min-width:18px; height:18px;
    display:flex; align-items:center; justify-content:center; background: var(--mws-gold) !important; color:#0f172a !important; }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--mws-radius-sm); font-weight: 600; transition: all .18s ease; }
.btn-mws-primary {
    background: var(--mws-primary); border:1px solid var(--mws-primary); color:#fff;
}
.btn-mws-primary:hover { background: var(--mws-royal-700); border-color: var(--mws-royal-700); color:#fff;
    box-shadow: var(--mws-shadow); transform: translateY(-1px); }
.btn-mws-gold { background: linear-gradient(135deg,var(--mws-gold),var(--mws-gold-600)); border:none; color:#1a1400; font-weight:700; }
.btn-mws-gold:hover { filter: brightness(1.05); box-shadow: var(--mws-shadow); transform: translateY(-1px); color:#1a1400; }
.btn-mws-green { background: var(--mws-green); border:1px solid var(--mws-green); color:#fff; }
.btn-mws-green:hover { background:#15803d; border-color:#15803d; color:#fff; }
.btn-mws-outline {
    background: transparent; border:1.5px solid var(--mws-primary); color: var(--mws-primary);
}
.btn-mws-outline:hover { background: var(--mws-primary); color:#fff; }
.btn-mws-ghost { background: var(--mws-surface-2); border:1px solid var(--mws-border); color: var(--mws-text); }
.btn-mws-ghost:hover { border-color: var(--mws-primary); color: var(--mws-primary); }

/* ---------- Cards ---------- */
.mws-card {
    background: var(--mws-surface);
    border: 1px solid var(--mws-border);
    border-radius: var(--mws-radius);
    box-shadow: var(--mws-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.mws-card:hover { box-shadow: var(--mws-shadow-lg); transform: translateY(-3px); border-color: var(--mws-blue-300); }
.mws-card-flat { background: var(--mws-surface); border:1px solid var(--mws-border); border-radius: var(--mws-radius); }
.mws-card-body { padding: 1.25rem; }

/* Product card */
.product-card { overflow:hidden; height:100%; display:flex; flex-direction:column; }
.product-card .thumb { position:relative; aspect-ratio: 4/3; background: var(--mws-surface-2); overflow:hidden; }
.product-card .thumb img { width:100%; height:100%; object-fit:cover; transition: transform .35s ease; }
.product-card:hover .thumb img { transform: scale(1.06); }
.product-card .title { font-weight:600; color:var(--mws-text); line-height:1.35;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.product-card .price { font-weight:800; color:var(--mws-royal-700); font-size:1.05rem; }
html.dark .product-card .price { color: var(--mws-blue); }
.product-card .compare { text-decoration: line-through; color: var(--mws-text-muted); font-size:.85rem; }

/* Badges */
.badge-mws-gold   { background: var(--mws-gold); color:#1a1400; }
.badge-mws-green  { background: var(--mws-green); color:#fff; }
.badge-mws-blue   { background: var(--mws-blue-50); color: var(--mws-royal-700); border:1px solid var(--mws-blue-300); }
.discount-badge { position:absolute; top:.6rem; left:.6rem; z-index:2; font-weight:700;
    background: var(--mws-danger); color:#fff; border-radius: var(--mws-radius-pill); padding:.28rem .6rem; font-size:.72rem; }
.verified-badge { color: var(--mws-primary); }
/* Trust ticks — blue = identity Verified, bronze = Trusted service provider */
.verified-badge-blue   { color: #2563eb; }
.verified-badge-bronze { color: #cd7f32; }
.trust-tick { font-size: .8em; vertical-align: baseline; margin-left: .15rem; }

/* ---------- Category pills (horizontal scroll) ---------- */
.mws-pills { display:flex; gap:.6rem; overflow-x:auto; padding:.25rem .1rem .75rem; scrollbar-width:thin; }
.mws-pills::-webkit-scrollbar { height:6px; }
.mws-pills::-webkit-scrollbar-thumb { background: var(--mws-border-strong); border-radius:6px; }
.mws-pill {
    flex: 0 0 auto; display:inline-flex; align-items:center; gap:.4rem;
    padding:.5rem 1rem; border-radius: var(--mws-radius-pill);
    background: var(--mws-surface); border:1px solid var(--mws-border);
    color: var(--mws-text); font-weight:600; font-size:.9rem; white-space:nowrap;
    transition: all .18s ease; cursor:pointer;
}
.mws-pill:hover { border-color: var(--mws-primary); color: var(--mws-primary); transform: translateY(-1px); }
.mws-pill.active { background: var(--mws-primary); border-color: var(--mws-primary); color:#fff; }
.mws-pill.active:hover { color:#fff; }

/* ---------- Hero ---------- */
.mws-hero {
    position:relative; overflow:hidden; border-radius: var(--mws-radius-lg);
    background:
      radial-gradient(1100px 380px at 88% -12%, rgba(109,42,255,.38), transparent 60%),
      radial-gradient(820px 300px at 6% 118%, rgba(0,170,255,.28), transparent 55%),
      linear-gradient(135deg, #0b355a 0%, #123a86 42%, #266ef6 100%);
    color:#fff;
}
.mws-hero h1 { color:#fff; font-weight:800; letter-spacing:-.03em; }
.mws-hero .lead { color: rgba(255,255,255,.9); }
.mws-hero .hero-badge { background: rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.25);
    color:#fff; border-radius: var(--mws-radius-pill); padding:.35rem .85rem; font-size:.82rem; font-weight:600; }

/* Section header */
.section-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:1.1rem; gap:1rem; }
.section-head h2 { font-size:1.4rem; margin:0; }
.section-head .kicker { color: var(--mws-primary); font-weight:700; font-size:.78rem; letter-spacing:.08em; text-transform:uppercase; }

/* ---------- Stat tiles ---------- */
.stat-tile {
    background: var(--mws-surface); border:1px solid var(--mws-border);
    border-radius: var(--mws-radius); padding:1.15rem 1.25rem; box-shadow: var(--mws-shadow-sm);
    position:relative; overflow:hidden;
}
.stat-tile::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--mws-primary); }
.stat-tile.green::before { background: var(--mws-green); }
.stat-tile.gold::before  { background: var(--mws-gold); }
.stat-tile.royal::before { background: var(--mws-royal); }
.stat-tile .label { color: var(--mws-text-muted); font-size:.8rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.stat-tile .value { font-size:1.65rem; font-weight:800; color: var(--mws-text); line-height:1.1; margin-top:.25rem; }
.stat-tile .icon { position:absolute; right:1rem; top:1rem; font-size:1.4rem; opacity:.18; }

/* ---------- Pricing cards ---------- */
.plan-card { background: var(--mws-surface); border:1px solid var(--mws-border); border-radius: var(--mws-radius-lg);
    padding:1.75rem 1.5rem; height:100%; display:flex; flex-direction:column; transition: transform .2s, box-shadow .2s; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--mws-shadow-lg); }
.plan-card.popular { border:2px solid var(--mws-gold); box-shadow: var(--mws-shadow-lg); }
.plan-card .plan-price { font-size:2.25rem; font-weight:800; color: var(--mws-royal-700); }
html.dark .plan-card .plan-price { color: var(--mws-blue); }
.plan-card .popular-flag { background: linear-gradient(135deg,var(--mws-gold),var(--mws-gold-600)); color:#1a1400;
    font-weight:700; font-size:.72rem; padding:.3rem .8rem; border-radius: var(--mws-radius-pill); letter-spacing:.05em; }
.plan-feature { display:flex; gap:.6rem; align-items:flex-start; padding:.35rem 0; color: var(--mws-text); }
.plan-feature i { color: var(--mws-green); margin-top:.2rem; }
.plan-feature.off { color: var(--mws-text-muted); }
.plan-feature.off i { color: var(--mws-text-muted); }

/* ---------- Forms ---------- */
.form-control, .form-select {
    background: var(--mws-surface); border:1px solid var(--mws-border); color: var(--mws-text);
    border-radius: var(--mws-radius-sm);
}
.form-control::placeholder { color: var(--mws-text-muted); }
.form-control:focus, .form-select:focus {
    background: var(--mws-surface); color: var(--mws-text);
    border-color: var(--mws-primary); box-shadow: var(--mws-ring);
}
.form-label { font-weight:600; color: var(--mws-text); }
.form-text { color: var(--mws-text-muted); }

/* Auth card */
.auth-wrap { min-height: calc(100vh - 70px); display:flex; align-items:center; }
.auth-card { max-width:440px; width:100%; margin:auto; }

/* ---------- Tables / lists ---------- */
.table { --bs-table-bg: transparent; color: var(--mws-text); border-color: var(--mws-border); }
.table thead th { color: var(--mws-text-muted); text-transform:uppercase; font-size:.75rem; letter-spacing:.04em;
    border-bottom:1px solid var(--mws-border-strong); }
.table td, .table th { border-color: var(--mws-border); vertical-align: middle; }

/* Status pills */
.status-pill { font-size:.72rem; font-weight:700; padding:.25rem .6rem; border-radius: var(--mws-radius-pill); text-transform:capitalize; }
.status-pending   { background: var(--mws-gold-50); color: var(--mws-gold-600); }
.status-confirmed { background: var(--mws-blue-50); color: var(--mws-royal-700); }
.status-processing,.status-shipped,.status-out_for_delivery { background: var(--mws-blue-50); color: var(--mws-primary); }
.status-delivered { background: var(--mws-green-50); color: var(--mws-green); }
.status-cancelled,.status-refunded { background: #fee2e2; color: var(--mws-danger); }
html.dark .status-cancelled, html.dark .status-refunded { background: rgba(248,113,113,.15); }

/* ---------- Delivery token ---------- */
.delivery-token {
    font-family: 'JetBrains Mono','Courier New',monospace; font-size:1.7rem; font-weight:800;
    letter-spacing:.35em; padding:1rem 1.75rem; border-radius: var(--mws-radius);
    background: linear-gradient(135deg, #0b355a, #266ef6 70%, #6d2aff); color:#fff; text-align:center;
    display:inline-block; box-shadow: var(--mws-shadow);
}
.qr-frame { background:#fff; padding:.5rem; border-radius: var(--mws-radius); display:inline-block; box-shadow: var(--mws-shadow-sm); line-height:0; flex:0 0 auto; overflow:hidden; }
.qr-frame img, .qr-frame svg { display:block; width:88px; height:88px; }

/* ---------- Alerts ---------- */
.mws-alert { border:none; border-radius: var(--mws-radius); box-shadow: var(--mws-shadow-sm);
    border-left:4px solid var(--mws-primary); }
.alert-success.mws-alert { border-left-color: var(--mws-green); }
.alert-danger.mws-alert, .alert-error.mws-alert { border-left-color: var(--mws-danger); }
.alert-warning.mws-alert { border-left-color: var(--mws-warning); }

/* ---------- Footer ---------- */
.mws-footer { background: var(--mws-footer-bg); color:#b9c6e6; }
.mws-footer h5, .mws-footer h6 { color:#fff; }
.mws-footer a { color:#9db0d8; }
.mws-footer a:hover { color: var(--mws-gold); }
.mws-footer .social a { font-size:1.15rem; }

/* ---------- Like button ---------- */
.like-btn { cursor:pointer; transition: transform .18s; color: var(--mws-text-muted); background:none; border:none; }
.like-btn:hover { transform: scale(1.15); }
.like-btn.liked { color: var(--mws-danger); }

/* ---------- Empty state ---------- */
.empty-state { text-align:center; padding:3.5rem 1rem; color: var(--mws-text-muted); }
.empty-state i { font-size:3rem; opacity:.4; margin-bottom:1rem; color: var(--mws-primary); }

/* ---------- Dropdowns / modals (dark) ---------- */
.dropdown-menu { background: var(--mws-surface); border:1px solid var(--mws-border); box-shadow: var(--mws-shadow-lg);
    border-radius: var(--mws-radius); }
.dropdown-item { color: var(--mws-text); border-radius: var(--mws-radius-sm); }
.dropdown-item:hover { background: var(--mws-surface-2); color: var(--mws-primary); }
.modal-content { background: var(--mws-surface); border:1px solid var(--mws-border); border-radius: var(--mws-radius-lg); }
.page-link { background: var(--mws-surface); border-color: var(--mws-border); color: var(--mws-text); }
.page-link:hover { background: var(--mws-surface-2); color: var(--mws-primary); }
.page-item.active .page-link { background: var(--mws-primary); border-color: var(--mws-primary); }
.page-item.disabled .page-link { background: var(--mws-surface); border-color: var(--mws-border); color: var(--mws-text-muted); }

/* ---------- Utilities ---------- */
.hover-lift { transition: transform .2s ease, box-shadow .2s ease; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--mws-shadow-lg); }
.divider { height:1px; background: var(--mws-border); border:0; }
.rounded-mws { border-radius: var(--mws-radius) !important; }
.shadow-mws { box-shadow: var(--mws-shadow) !important; }

/* ---------- Dark-mode fixes for Bootstrap-owned surfaces ----------
   Bootstrap 5.3's own dark mode is switched via data-bs-theme on <html>; these
   rules cover the few components whose light palette still leaked through. */
html.dark .alert-success { background-color: rgba(52,211,153,.12); color: #86efac; border-color: rgba(52,211,153,.3); }
html.dark .alert-info    { background-color: rgba(96,165,250,.12); color: #93c5fd; border-color: rgba(96,165,250,.3); }
html.dark .alert-warning { background-color: rgba(240,193,75,.12);  color: #fcd34d; border-color: rgba(240,193,75,.3); }
html.dark .alert-danger  { background-color: rgba(248,113,113,.12); color: #fca5a5; border-color: rgba(248,113,113,.3); }
html.dark .alert-light   { background-color: var(--mws-surface-2); color: var(--mws-text); border-color: var(--mws-border); }
/* The default close button is a dark SVG — invert it so it's visible on dark surfaces */
html.dark .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html.dark .breadcrumb, html.dark .breadcrumb-item.active { color: var(--mws-text-muted); }
html.dark .page-link { background: var(--mws-surface); border-color: var(--mws-border); color: var(--mws-text); }
html.dark .page-item.disabled .page-link { background: var(--mws-surface-2); color: var(--mws-text-muted); }
html.dark .progress { background-color: var(--mws-surface-2); }
html.dark .dropdown-divider { border-color: var(--mws-border); }

/* ---------- Skeleton loading (region detection) ---------- */
@keyframes mws-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton-thumb, .skeleton-line {
    background: linear-gradient(90deg, var(--mws-surface-2) 25%, var(--mws-border) 37%, var(--mws-surface-2) 63%);
    background-size: 800px 100%; animation: mws-shimmer 1.4s ease-in-out infinite; border-radius: var(--mws-radius-sm);
}
.skeleton-thumb { aspect-ratio: 1/1; border-radius: .75rem .75rem 0 0; }
.skeleton-line { height: .7rem; margin-bottom: .5rem; }
.region-detecting { display:inline-flex; align-items:center; gap:.5rem; }

.code-chip {
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-weight: 700;
    letter-spacing: .08em; background: var(--mws-surface-2); color: var(--mws-primary);
    padding: .1rem .4rem; border-radius: var(--mws-radius-sm); cursor: pointer;
}

/* ---------- Backward-compat utility classes (used by templates) ---------- */
.mws-bg-secondary, .bg-mws-secondary { background-color: var(--mws-surface-2) !important; }
.mws-text { color: var(--mws-text) !important; }
.mws-primary, .bg-mws-primary { color: var(--mws-primary); }
.bg-mws-primary { background-color: var(--mws-primary) !important; color:#fff; }
.mws-gold { color: var(--mws-gold-600) !important; }
.mws-danger { color: var(--mws-danger) !important; }

/* ---------- Dashboard sidebar ---------- */
.mws-sidebar {
    width: 260px; min-height: calc(100vh - 70px);
    background: var(--mws-surface); border-right: 1px solid var(--mws-border);
    position: fixed; top: 70px; left: 0; overflow-y: auto; z-index: 1000;
    transition: transform .3s ease; padding: 1rem .5rem;
}
.mws-sidebar .nav-link { color: var(--mws-text-muted); padding:.65rem 1rem; border-radius: var(--mws-radius-sm);
    margin:.15rem .25rem; font-weight:500; transition: all .18s; }
.mws-sidebar .nav-link:hover { background: var(--mws-surface-2); color: var(--mws-primary); }
.mws-sidebar .nav-link.active { background: var(--mws-primary); color:#fff; }
.mws-sidebar .nav-link i { width: 22px; text-align:center; margin-right:.5rem; }
body:has(.mws-sidebar) .mws-main-content { margin-left: 260px; }
@media (max-width: 991.98px) {
    .mws-sidebar { transform: translateX(-100%); }
    .mws-sidebar.show { transform: translateX(0); }
    body:has(.mws-sidebar) .mws-main-content { margin-left: 0; }
}

/* ---------- Accent utilities (violet) ---------- */
.text-mws-purple { color: var(--mws-purple) !important; }
.badge-mws-purple { background: var(--mws-purple-50); color: var(--mws-purple-600); border:1px solid var(--mws-purple); }
.stat-tile.purple::before { background: var(--mws-purple); }
.btn-mws-brand {
    background: linear-gradient(135deg, var(--mws-primary), var(--mws-purple)); border:none; color:#fff; font-weight:700;
}
.btn-mws-brand:hover { filter: brightness(1.06); box-shadow: var(--mws-shadow); transform: translateY(-1px); color:#fff; }
.brand-gradient-text {
    background: linear-gradient(120deg, #266ef6, #6d2aff 55%, #00aaff);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

/* Language switcher */
.lang-menu .dropdown-item.active { background: var(--mws-surface-2); color: var(--mws-primary); font-weight:700; }
.mws-navbar .lang-toggle { color: var(--mws-navbar-text) !important; }
.mws-navbar .lang-toggle:hover { color:#fff !important; background: rgba(255,255,255,.08); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .mws-hero h1 { font-size: 1.9rem; }
    .section-head h2 { font-size: 1.2rem; }
    .mws-hero { padding: 1.75rem 1.25rem !important; }
}
@media (max-width: 767.98px) {
    .section-head { flex-direction: column; align-items: flex-start; gap: .35rem; }
    .section-head .btn, .section-head a.btn { align-self: stretch; }
    .table-responsive-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 575.98px) {
    .mws-card-body { padding: 1rem; }
    .delivery-token { font-size:1.25rem; letter-spacing:.25em; padding:.85rem 1rem; }
    .stat-tile .value { font-size:1.35rem; }
    .mws-hero h1 { font-size: 1.6rem; }
    .display-6 { font-size: 1.5rem; }
    .btn-lg { padding: .6rem 1rem; font-size: 1rem; }
    h2 { font-size: 1.3rem; }
}
/* Never let the page scroll sideways on small screens */
@media (max-width: 991.98px) { html, body { overflow-x: hidden; } }

/* ---------- Onboarding walkthrough (coach marks) ---------- */
.mws-tour-layer { position: fixed; inset: 0; z-index: 20000; display: none; }
.mws-tour-layer.show { display: block; }
.mws-tour-backdrop { position: absolute; inset: 0; background: rgba(6, 18, 34, .55); backdrop-filter: blur(1px); }
.mws-tour-ring {
    position: fixed; border-radius: var(--mws-radius-sm);
    box-shadow: 0 0 0 3px var(--mws-primary), 0 0 0 9999px rgba(6, 18, 34, .55);
    transition: all .25s ease; pointer-events: none; display: none;
}
.mws-tour-card {
    position: fixed; width: min(340px, calc(100vw - 24px)); background: var(--mws-surface);
    color: var(--mws-text); border: 1px solid var(--mws-border); border-radius: var(--mws-radius);
    box-shadow: var(--mws-shadow-lg); padding: 1rem 1.1rem; transition: top .2s ease, left .2s ease;
}
.mws-tour-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.mws-tour-step { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mws-primary); }
.mws-tour-x { background: none; border: 0; color: var(--mws-text-muted); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.mws-tour-x:hover { color: var(--mws-text); }
.mws-tour-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 .3rem; color: var(--mws-text); }
.mws-tour-body { font-size: .88rem; color: var(--mws-text-muted); line-height: 1.5; }
.mws-tour-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; gap: .5rem; }
.mws-tour-nav { display: inline-flex; gap: .4rem; }
.mws-tour-skip-link { background: none; border: 0; color: var(--mws-text-muted); font-size: .8rem; cursor: pointer; padding: 0; }
.mws-tour-skip-link:hover { color: var(--mws-text); text-decoration: underline; }
.mws-tour-btn { border-radius: var(--mws-radius-sm); font-weight: 600; font-size: .85rem; padding: .4rem .9rem; border: 1px solid transparent; cursor: pointer; }
.mws-tour-btn.primary { background: var(--mws-primary); border-color: var(--mws-primary); color: #fff; }
.mws-tour-btn.primary:hover { filter: brightness(1.05); }
.mws-tour-btn.ghost { background: var(--mws-surface-2); border-color: var(--mws-border); color: var(--mws-text); }
.mws-tour-btn.ghost:hover { border-color: var(--mws-primary); color: var(--mws-primary); }

/* Floating help ("?") button — bottom-left (toasts use bottom-right) */
.mws-tour-fab {
    position: fixed; left: 18px; bottom: 18px; z-index: 1500; display: none;
    width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--mws-primary), var(--mws-purple)); color: #fff;
    align-items: center; justify-content: center; font-size: 1.1rem;
    box-shadow: var(--mws-shadow-lg);
}
.mws-tour-fab:hover { transform: translateY(-2px); }
@media (max-width: 575.98px) { .mws-tour-fab { width: 42px; height: 42px; left: 12px; bottom: 12px; } }

/* ============================================================
   Auth landing — marketing split hero with a z-layered form card
   Used by templates/account/login.html + signup.html
   ============================================================ */
.auth-landing {
    position: relative;
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    isolation: isolate;                 /* own stacking context for z-index layers */
}
/* Layer 0 — decorative brand background */
.auth-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(60rem 60rem at -10% -20%, rgba(38,110,246,.28), transparent 55%),
        radial-gradient(50rem 50rem at 110% 10%, rgba(244,115,33,.18), transparent 55%),
        linear-gradient(135deg, var(--mws-royal-700), var(--mws-primary));
}
.auth-bg::after { content:""; position:absolute; inset:0;
    background-image:
        radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
    background-size: 22px 22px; opacity:.5; }
.auth-blob { position:absolute; border-radius:50%; filter: blur(6px); opacity:.35; z-index:0; }
.auth-blob.b1 { width:22rem; height:22rem; left:-6rem; bottom:-8rem; background:rgba(18,163,107,.55); }
.auth-blob.b2 { width:16rem; height:16rem; right:6%; bottom:-5rem; background:rgba(244,115,33,.45); }

.auth-grid { position: relative; z-index: 1; width:100%; max-width:1200px; margin:0 auto;
    display:grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items:center;
    padding: 3.5rem 1.25rem; }
@media (max-width: 900px){ .auth-grid { grid-template-columns:1fr; gap:1.75rem; padding:2rem 1rem; } }

/* Layer 1 — marketing pitch (sits over the gradient) */
.auth-pitch { color:#fff; z-index:1; }
.auth-pitch .mws-wordmark { font-size:1.15rem; }
.auth-pitch h1 { font-weight:800; font-size: clamp(1.9rem, 4vw, 3rem); line-height:1.08; letter-spacing:-.02em; margin:1.1rem 0 .75rem; }
.auth-pitch .lead { font-size:1.1rem; color:rgba(255,255,255,.88); max-width:34rem; }
.auth-features { list-style:none; padding:0; margin:1.75rem 0 0; display:grid; gap:.9rem; max-width:34rem; }
.auth-features li { display:flex; gap:.8rem; align-items:flex-start; }
.auth-features .fi { flex:0 0 auto; width:2.4rem; height:2.4rem; border-radius:.7rem;
    display:flex; align-items:center; justify-content:center; font-size:1rem;
    background:rgba(255,255,255,.16); color:#fff; backdrop-filter: blur(4px); }
.auth-features b { display:block; font-weight:700; }
.auth-features span { color:rgba(255,255,255,.82); font-size:.92rem; }
.auth-trust { display:flex; flex-wrap:wrap; gap:1.25rem 2rem; margin-top:2rem; color:rgba(255,255,255,.9); }
.auth-trust .num { font-weight:800; font-size:1.5rem; display:block; line-height:1; }
.auth-trust small { color:rgba(255,255,255,.72); }

/* Layer 2 — the elevated auth card (floats above everything) */
.auth-panel { z-index:2; }
.auth-card { background:var(--mws-surface); color:var(--mws-text);
    border-radius: var(--mws-radius-lg); padding: 2rem;
    box-shadow: 0 24px 60px -20px rgba(4,20,50,.55), 0 8px 22px -12px rgba(4,20,50,.4);
    border:1px solid var(--mws-border); }
@media (min-width: 901px){ .auth-card { padding: 2.5rem; } }
.auth-card h2 { font-weight:800; margin-bottom:.25rem; }
.auth-card .form-control { border-radius: var(--mws-radius-sm); }
.auth-badge { display:inline-flex; align-items:center; gap:.4rem; font-size:.78rem; font-weight:600;
    color:var(--mws-green); background:var(--mws-green-50); padding:.3rem .6rem; border-radius:999px; }

/* ============================================================
   UI v3 — Marketplace redesign (header, home, cards, mobile)
   Appended layer: overrides the v2 chrome without touching it,
   so every existing page inherits the new look.
   ============================================================ */

:root {
    --v3-blue:        #2563eb;
    --v3-blue-600:    #1d4ed8;
    --v3-blue-700:    #1e40af;
    --v3-blue-050:    #eff6ff;
    --v3-orange:      #f97316;
    --v3-orange-600:  #ea580c;
    --v3-ink:         #0f172a;
    --v3-muted:       #64748b;
    --v3-line:        #e6eaf2;
    --v3-page:        #f6f8fc;
    --v3-card:        #ffffff;
    --v3-navy:        #0b2447;
    --v3-star:        #f59e0b;
    --v3-r:           14px;
    --v3-head-h:      68px;
}
html.dark {
    --v3-blue:        #4d8dff;
    --v3-blue-600:    #3b82f6;
    --v3-blue-700:    #2563eb;
    --v3-blue-050:    #10233d;
    --v3-ink:         #e8eaf6;
    --v3-muted:       #93a3bd;
    --v3-line:        #1e3559;
    --v3-page:        #08182c;
    --v3-card:        #0e2340;
    --v3-navy:        #061426;
}

body { background: var(--v3-page); color: var(--v3-ink); }

/* ---------- Announcement bar ---------- */
.mws-announce {
    background: var(--v3-navy); color: #dbe6fb;
    font-size: .8125rem; padding: .5rem 0; letter-spacing: .01em;
}
.mws-announce .announce-close { color: #8fa8cc; }

/* ---------- Header ---------- */
.site-head {
    position: sticky; top: 0; z-index: 1030;
    background: var(--v3-card);
    border-bottom: 1px solid var(--v3-line);
}
.site-head .head-row { display: flex; align-items: center; gap: 1rem; height: var(--v3-head-h); }

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; flex: none; }
.brand-tile {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--v3-blue); color: #fff;
    display: grid; place-items: center;
    font-weight: 800; font-size: .82rem; letter-spacing: .02em;
}
.brand-name { font-weight: 800; color: var(--v3-ink); font-size: 1.02rem; white-space: nowrap; }

.head-search { flex: 1 1 300px; min-width: 210px; max-width: 340px; position: relative; }
.head-search input {
    width: 100%; height: 42px; border-radius: 999px;
    border: 1px solid var(--v3-line); background: #f1f4f9;
    padding: 0 2.6rem 0 1rem; font-size: .875rem; color: var(--v3-ink);
}
html.dark .head-search input { background: #0b1c33; }
.head-search input::placeholder { color: #94a3b8; }
.head-search input:focus { outline: none; border-color: var(--v3-blue); background: var(--v3-card); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.head-search button {
    position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: 0; border-radius: 50%;
    background: transparent; color: var(--v3-muted);
}
.head-search button:hover { color: var(--v3-blue); }

.head-nav { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; }
.head-link {
    position: relative; padding: .55rem .7rem; border-radius: 8px;
    font-size: .875rem; font-weight: 500; color: #475569; text-decoration: none; white-space: nowrap;
}
html.dark .head-link { color: #a9b8d1; }
.head-link:hover { color: var(--v3-blue); background: rgba(37,99,235,.06); }
.head-link.active { color: var(--v3-blue); font-weight: 600; }
.head-link.active::after {
    content: ''; position: absolute; left: .7rem; right: .7rem; bottom: -1px;
    height: 2.5px; border-radius: 3px; background: var(--v3-blue);
}
.head-cta {
    border: 1px solid var(--v3-line); border-radius: 999px;
    padding: .5rem 1rem; font-size: .8125rem; font-weight: 600;
    color: var(--v3-ink); text-decoration: none; white-space: nowrap;
}
.head-cta:hover { border-color: var(--v3-blue); color: var(--v3-blue); }

.head-tools { display: flex; align-items: center; gap: .15rem; margin-left: auto; }
.icon-btn {
    position: relative; width: 38px; height: 38px; border: 0; background: transparent;
    border-radius: 10px; color: #475569; display: grid; place-items: center; font-size: 1rem;
    text-decoration: none;
}
html.dark .icon-btn { color: #a9b8d1; }
.icon-btn:hover { background: rgba(37,99,235,.08); color: var(--v3-blue); }
.icon-btn .dot {
    position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: var(--v3-blue); color: #fff;
    font-size: .625rem; font-weight: 700; display: grid; place-items: center;
    border: 2px solid var(--v3-card);
}
.pill-select {
    display: flex; align-items: center; gap: .3rem; padding: .45rem .55rem;
    border-radius: 8px; font-size: .8125rem; font-weight: 500; color: #475569;
    background: transparent; border: 0; text-decoration: none; white-space: nowrap;
}
html.dark .pill-select { color: #a9b8d1; }
.pill-select:hover { background: rgba(37,99,235,.08); color: var(--v3-blue); }
.head-user { display: flex; align-items: center; gap: .45rem; padding: .3rem .5rem .3rem .3rem; border-radius: 999px; text-decoration: none; }
.head-user:hover { background: rgba(37,99,235,.08); }
.head-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--v3-blue-050); color: var(--v3-blue); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.head-user .nm { font-size: .8125rem; font-weight: 600; color: var(--v3-ink); }

/* ---------- Hero ---------- */
.hero3 {
    position: relative; overflow: hidden; border-radius: var(--v3-r);
    background: linear-gradient(112deg, #14306e 0%, #1b45a8 42%, #2563eb 100%);
    color: #fff; padding: 2.5rem;
}
.hero3 .hero-badge3 {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
    padding: .3rem .75rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
}
.hero3 h1 { font-size: 2.35rem; font-weight: 800; line-height: 1.15; margin: 1rem 0 .6rem; color: #fff; }
.hero3 p { color: #cfe0fb; font-size: .975rem; max-width: 34rem; margin-bottom: 1.4rem; }
.btn-orange {
    background: var(--v3-orange-600); border: 1px solid var(--v3-orange-600); color: #fff;
    border-radius: 9px; padding: .65rem 1.15rem; font-weight: 600; font-size: .9rem; text-decoration: none;
    display: inline-flex; align-items: center; gap: .45rem;
}
.btn-orange:hover { background: #c2410c; color: #fff; }
.btn-white {
    background: #fff; border: 1px solid #fff; color: #14306e;
    border-radius: 9px; padding: .65rem 1.15rem; font-weight: 600; font-size: .9rem; text-decoration: none;
    display: inline-flex; align-items: center; gap: .45rem;
}
.btn-white:hover { background: #eef4ff; color: #14306e; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; max-height: 260px; display: block; }

/* ---------- Trust strip ---------- */
.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1.15rem .25rem; }
.trust-item { display: flex; align-items: flex-start; gap: .65rem; }
.trust-item .ti {
    width: 30px; height: 30px; border-radius: 8px; flex: none;
    background: var(--v3-blue-050); color: var(--v3-blue);
    display: grid; place-items: center; font-size: .8rem;
}
.trust-item b { display: block; font-size: .8125rem; font-weight: 700; color: var(--v3-ink); }
.trust-item span { font-size: .75rem; color: var(--v3-muted); }

/* ---------- Category rail ---------- */
.cat-card {
    background: var(--v3-card); border: 1px solid var(--v3-line);
    border-radius: var(--v3-r); padding: .85rem 1rem; position: relative;
}
.cat-rail { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.cat-rail::-webkit-scrollbar { display: none; }
.cat-item {
    flex: none; width: 92px; padding: .5rem .25rem; border-radius: 10px;
    text-align: center; text-decoration: none; color: var(--v3-ink);
}
.cat-item:hover { background: #f4f7fc; color: var(--v3-ink); }
html.dark .cat-item:hover { background: #10233d; }
.cat-ico {
    width: 42px; height: 42px; margin: 0 auto .4rem; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.05rem; background: #eef2f9;
}
.cat-item.is-all .cat-ico { background: var(--v3-blue); color: #fff; border-radius: 12px; }
.cat-item.is-all .cat-lb { color: var(--v3-blue); font-weight: 700; }
.cat-lb { font-size: .70rem; font-weight: 500; line-height: 1.25; display: block;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-rail .cat-item:nth-child(6n+2) .cat-ico { background: #eaf7ee; }
.cat-rail .cat-item:nth-child(6n+3) .cat-ico { background: #fdeef4; }
.cat-rail .cat-item:nth-child(6n+4) .cat-ico { background: #eaf1fe; }
.cat-rail .cat-item:nth-child(6n+5) .cat-ico { background: #fff3e6; }
.cat-rail .cat-item:nth-child(6n+6) .cat-ico { background: #f0edfd; }
.rail-next {
    position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--v3-line);
    background: var(--v3-card); color: var(--v3-muted); display: grid; place-items: center;
}
.rail-next:hover { color: var(--v3-blue); border-color: var(--v3-blue); }

/* ---------- Section heads ---------- */
.sec3 { display: flex; align-items: flex-end; justify-content: space-between; margin: 2rem 0 .9rem; gap: 1rem; }
.sec3 .kick { font-size: .78rem; font-weight: 600; color: var(--v3-blue); margin-bottom: .1rem; }
.sec3 h2 { font-size: 1.25rem; font-weight: 800; color: var(--v3-ink); margin: 0; }
.sec3 a.more { font-size: .8125rem; font-weight: 600; color: var(--v3-blue); text-decoration: none; white-space: nowrap; }
.sec3 a.more:hover { text-decoration: underline; }

/* ---------- Product card (v3) — restyles every listing page ---------- */
.mws-card.product-card {
    background: var(--v3-card); border: 1px solid var(--v3-line);
    border-radius: var(--v3-r); overflow: hidden; box-shadow: none;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.mws-card.product-card:hover {
    border-color: #cfdcf3; box-shadow: 0 8px 24px -12px rgba(15,23,42,.18); transform: translateY(-2px);
}
.mws-card.product-card .thumb { aspect-ratio: 1/1; background: #f1f4f9; }
html.dark .mws-card.product-card .thumb { background: #0b1c33; }
.mws-card.product-card .pc-body { padding: .8rem .85rem .9rem; }
.mws-card.product-card .pc-title {
    display: block; font-size: .875rem; font-weight: 700; color: var(--v3-ink);
    text-decoration: none; line-height: 1.3; margin-bottom: .15rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mws-card.product-card .pc-title:hover { color: var(--v3-blue); }
.mws-card.product-card .pc-shop {
    font-size: .75rem; color: var(--v3-muted); margin-bottom: .5rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mws-card.product-card .pc-price { font-size: .95rem; font-weight: 800; color: var(--v3-ink); }
.mws-card.product-card .pc-rate { font-size: .75rem; color: var(--v3-muted); display: flex; align-items: center; gap: .25rem; }
.mws-card.product-card .pc-rate .fa-star { color: var(--v3-star); font-size: .7rem; }
.pc-heart {
    width: 30px; height: 30px; border: 0; background: transparent; border-radius: 50%;
    color: #94a3b8; display: grid; place-items: center; font-size: .9rem; flex: none;
}
.pc-heart:hover { color: var(--v3-orange-600); background: #fff1e9; }
.pc-heart.liked, .pc-heart.saved { color: #e11d48; }

/* ---------- Category tiles ---------- */
.cat-tile {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    border-radius: 12px; padding: .95rem 0 .95rem 1rem; text-decoration: none;
    min-height: 104px; overflow: hidden; border: 1px solid transparent;
}
.cat-tile b { display: block; font-size: .85rem; font-weight: 800; color: var(--v3-ink); line-height: 1.25; }
.cat-tile span { font-size: .75rem; font-weight: 600; color: var(--v3-blue); }
.cat-tile .tile-img { width: 84px; height: 84px; flex: none; object-fit: contain; }
.cat-tile .tile-ph { width: 84px; height: 84px; flex: none; display: grid; place-items: center; font-size: 1.6rem; opacity: .55; }
.tile-a { background: #fdeef3; } .tile-b { background: #eaf1fe; }
.tile-c { background: #fdeceb; } .tile-d { background: #eaf7ee; }
html.dark .tile-a,html.dark .tile-b,html.dark .tile-c,html.dark .tile-d { background: #10233d; }

/* ---------- Featured shop mini-card ---------- */
.shop-mini {
    display: block; text-align: center; text-decoration: none; padding: 1rem .5rem;
    background: var(--v3-card); border: 1px solid var(--v3-line); border-radius: 12px; height: 100%;
}
.shop-mini:hover { border-color: #cfdcf3; box-shadow: 0 8px 24px -14px rgba(15,23,42,.2); }
.shop-mini .av {
    width: 46px; height: 46px; margin: 0 auto .55rem; border-radius: 50%; overflow: hidden;
    display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
    background: var(--v3-blue-050); color: var(--v3-blue); position: relative;
}
.shop-mini .av img { width: 100%; height: 100%; object-fit: cover; }
.shop-mini .nm { font-size: .75rem; font-weight: 700; color: var(--v3-ink); line-height: 1.25;
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-mini .ct { font-size: .7rem; color: var(--v3-muted); }

/* ---------- Sell CTA ---------- */
.sell-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: var(--v3-blue-050); border: 1px solid #dbe7fe;
    border-radius: var(--v3-r); padding: 1.25rem 1.5rem;
}
html.dark .sell-cta { border-color: #1e3559; }
.sell-cta b { display: block; font-size: 1.05rem; font-weight: 800; color: var(--v3-blue-700); }
html.dark .sell-cta b { color: #93b8ff; }
.sell-cta p { margin: .15rem 0 0; font-size: .85rem; color: var(--v3-muted); }
.btn-blue {
    background: var(--v3-blue); border: 1px solid var(--v3-blue); color: #fff; border-radius: 9px;
    padding: .65rem 1.15rem; font-weight: 600; font-size: .875rem; text-decoration: none;
    display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
}
.btn-blue:hover { background: var(--v3-blue-600); color: #fff; }

/* ---------- Horizontal rails (mobile) ---------- */
.rail { display: flex; gap: .7rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; width: 150px; }
.rail.rail-shops > * { width: 96px; }

/* ---------- Mobile bottom tab bar ---------- */
.mws-tabbar { display: none; }
@media (max-width: 991.98px) {
    .mws-tabbar {
        display: grid; grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
        background: var(--v3-card); border-top: 1px solid var(--v3-line);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mws-tabbar a {
        display: flex; flex-direction: column; align-items: center; gap: .18rem;
        padding: .5rem 0 .45rem; text-decoration: none; color: var(--v3-muted); font-size: .625rem; font-weight: 600;
    }
    .mws-tabbar a i { font-size: 1.05rem; }
    .mws-tabbar a.active { color: var(--v3-blue); }
    body { padding-bottom: 62px; }
    .mws-tour-fab { bottom: 74px !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .head-link { padding: .55rem .5rem; font-size: .82rem; }
    .head-search { max-width: 240px; }
}
@media (max-width: 991.98px) {
    :root { --v3-head-h: 56px; }
    .site-head .head-row { gap: .5rem; }
    .brand-name { display: none; }
    /* Hero: text and art sit side-by-side on phones (art is the compact
       portrait SVG), so the card stays short instead of a tall stack. */
    .hero3 { padding: 1rem .9rem; border-radius: 12px; }
    .hero3 .row { align-items: center; }
    .hero3 .hero-badge3 { font-size: .66rem; padding: .24rem .55rem; }
    .hero3 h1 { font-size: 1.22rem; margin: .55rem 0 .35rem; letter-spacing: -.02em; }
    .hero3 p { font-size: .78rem; margin-bottom: .8rem; }
    .hero3 .btn-orange, .hero3 .btn-white { padding: .5rem .7rem; font-size: .78rem; width: 100%; justify-content: center; }
    .hero3 .d-flex.flex-wrap { gap: .45rem !important; }
    .hero-art { margin-top: 0; }
    .hero-art .art-tall { width: 100%; height: auto; max-height: 215px; margin-left: auto; }
    .trust-strip { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .cat-card { border: 0; background: transparent; padding: .25rem 0; }
    .cat-item { width: 74px; }
    .cat-ico { width: 44px; height: 44px; }
    .rail-next { display: none; }
    .sec3 { margin: 1.4rem 0 .7rem; }
    .sec3 h2 { font-size: 1.05rem; }
    .sell-cta { padding: 1rem; }
    .sell-cta b { font-size: .95rem; }
    .mws-card.product-card .pc-body { padding: .6rem .65rem .7rem; }
}
@media (max-width: 575.98px) {
    .trust-strip { display: none; }
    /* The mockup has no announcement strip on phones — it costs two lines of
       vertical space above the fold, and the QR message is repeated in the hero. */
    .mws-announce { display: none; }
    .hero3 h1 { font-size: 1.06rem; }
    .hero3 p { font-size: .72rem; margin-bottom: .7rem; }
    .hero3 .btn-orange, .hero3 .btn-white { font-size: .74rem; padding: .45rem .5rem; }
    .hero-art .art-tall { max-height: 190px; }
    .sec3 { margin: 1.15rem 0 .6rem; }
    .sec3 h2 { font-size: 1rem; }
    .cat-item { width: 68px; }
    .cat-ico { width: 40px; height: 40px; font-size: .95rem; }
    .cat-lb { font-size: .66rem; }
    .mws-card.product-card .pc-title { font-size: .8rem; }
    .mws-card.product-card .pc-price { font-size: .875rem; }
    .sell-cta { padding: .9rem; border-radius: 12px; }
    .container.mws-container { padding-left: .75rem; padding-right: .75rem; }
}

/* ---------- Grid on desktop, swipe rail on mobile ---------- */
.grid-rail { display: grid; gap: 1rem; }
.grid-rail-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-rail-shops { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 991.98px) {
    .grid-rail {
        display: flex; gap: .7rem; overflow-x: auto; scrollbar-width: none;
        padding-bottom: .3rem; scroll-snap-type: x proximity;
    }
    .grid-rail::-webkit-scrollbar { display: none; }
    .grid-rail > * { flex: none; width: 46vw; max-width: 190px; scroll-snap-align: start; }
    .grid-rail-shops > * { width: 27vw; max-width: 120px; }
}
.min-w-0 { min-width: 0; }

/* ---------- Header fit ----------
   The shell is capped at 1280px, so the header has the same room at every
   desktop width — these compact sizes therefore apply from lg up, not only on
   narrow screens. Rules of the layout:
     * the nav NEVER shrinks below its content (shrinking made its last item,
       "Get the app", spill over the language switcher);
     * the search is the single flexible item, with a floor so it can't collapse;
     * the wordmark drops out before anything can collide.                      */
.site-head .head-row { min-width: 0; flex-wrap: nowrap; gap: .5rem; }
.site-head .head-nav { flex: 0 0 auto; min-width: auto; flex-wrap: nowrap; }
.site-head .head-tools { flex: 0 0 auto; gap: 0; }
@media (min-width: 992px) {
    .site-head .head-search { flex: 1 1 260px; min-width: 190px; max-width: 320px; }
    .site-head .head-link { padding: .55rem .55rem; font-size: .84rem; }
    .site-head .head-cta { padding: .42rem .7rem; font-size: .78rem; margin-left: .35rem !important; }
    .site-head .pill-select { padding: .45rem .35rem; font-size: .78rem; }
    .site-head .icon-btn { width: 32px; height: 32px; font-size: .95rem; }
    .site-head .head-user .nm { font-size: .78rem; }
    .site-head .btn-blue { padding: .45rem .8rem !important; font-size: .8rem; }
}
/* Below ~1400px the wordmark is the first thing to go — it buys ~150px and
   keeps every interactive control visible and un-overlapped. */
@media (min-width: 992px) and (max-width: 1279.98px) {
    .site-head .brand-name { display: none; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .site-head .head-search { flex: 1 1 170px; min-width: 150px; max-width: 200px; }
    .site-head .head-link { padding: .55rem .35rem; font-size: .8rem; }
}

/* ---------- Grid on desktop, swipe rail on mobile ---------- */
.grid-rail { display: grid; gap: 1rem; }
.grid-rail-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-rail-shops { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 991.98px) {
    .grid-rail {
        display: flex; gap: .7rem; overflow-x: auto; scrollbar-width: none;
        padding-bottom: .3rem; scroll-snap-type: x proximity;
    }
    .grid-rail::-webkit-scrollbar { display: none; }
    .grid-rail > * { flex: none; width: 46vw; max-width: 190px; scroll-snap-align: start; }
    .grid-rail-shops > * { width: 27vw; max-width: 120px; }
}
.min-w-0 { min-width: 0; }

/* ---------- Header fit ----------
   The container is capped (see .mws-container), so the header always has the
   same room no matter how wide the screen is — these compact sizes therefore
   apply at every desktop width, not just narrow ones. Only the nav may shrink;
   the search keeps an explicit floor so it can never collapse. */
.site-head .head-row { min-width: 0; flex-wrap: nowrap; gap: .5rem; }
.site-head .head-nav { min-width: 0; flex: 0 1 auto; flex-wrap: nowrap; }
.site-head .head-tools { flex: 0 0 auto; gap: .1rem; }
@media (min-width: 992px) {
    .site-head .head-search { flex: 1 1 240px; min-width: 200px; max-width: 320px; }
    .site-head .head-link { padding: .55rem .5rem; font-size: .84rem; }
    .site-head .head-cta { padding: .45rem .8rem; font-size: .8rem; }
    .site-head .pill-select { padding: .45rem .4rem; font-size: .8rem; }
    .site-head .icon-btn { width: 34px; height: 34px; }
}
@media (min-width: 992px) and (max-width: 1279.98px) {
    .site-head .brand-name { display: none; }
    .site-head .head-search { flex: 1 1 190px; min-width: 170px; }
}
