/* ============================================================
   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: 1200px; }

/* ---------- 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; }
