/* ============================================================
   ReformMart – design system
   Light/dark themes, storefront + admin, mobile-first
   ============================================================ */

:root {
    --primary: #0A5C4E;
    --primary-dark: #064439;
    --primary-light: #E2F0ED;
    --accent: #D4A853;
    --accent-dark: #B8862E;
    --accent-light: #FDF6E7;
    --green: #1B9E77;
    --red: #D64545;
    --amber: #C77E1B;
    --blue: #2F6FED;

    --bg: #F6F8F8;
    --surface: #FFFFFF;
    --surface-2: #F1F5F4;
    --border: #E2E8E7;
    --text: #1F2937;
    --text-soft: #4B5563;
    --text-muted: #8A94A6;
    --shadow-sm: 0 1px 3px rgba(15, 40, 35, .08);
    --shadow-md: 0 6px 18px -4px rgba(15, 40, 35, .12);
    --shadow-lg: 0 18px 40px -12px rgba(15, 40, 35, .18);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 999px;
    --sidebar-w: 300px;
    --header-h: 68px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

[data-theme="dark"] {
    --primary: #17A98C;
    --primary-dark: #0E7A64;
    --primary-light: #0E2A25;
    --accent: #E5BC6E;
    --accent-dark: #C99A3F;
    --accent-light: #2A2313;
    --green: #2FD3A5;
    --red: #F07070;
    --amber: #F0B24C;
    --blue: #6E9BFF;

    --bg: #0D1413;
    --surface: #131C1A;
    --surface-2: #1A2624;
    --border: #24332F;
    --text: #E8EEEC;
    --text-soft: #B7C4C0;
    --text-muted: #7C8B87;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .55);
    --shadow-lg: 0 20px 44px -12px rgba(0, 0, 0, .6);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --white: #FFFFFF;
    --gray-50: #101816;
    --gray-100: #16211E;
    --gray-200: #24332F;
    --gray-300: #4A5A55;
    --gray-400: #7C8B87;
    --gray-500: #9AA8A4;
    --gray-600: #B7C4C0;
    --gray-700: #D5DEDB;
    --gray-800: #EAF1EF;
    --gray-900: #F6F8F8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.ico { width: 20px; height: 20px; flex: none; }
.skip-link { position: absolute; left: -9999px; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- Typography helpers ---------- */
.section { padding: 56px 0; }
.section-tight { padding: 36px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.section-title .accent { color: var(--accent); }
.section-sub { color: var(--text-muted); font-size: .95rem; margin-top: 4px; }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-dark); background: var(--accent-light); padding: 5px 12px; border-radius: var(--radius-full); margin-bottom: 12px; }
[data-theme="dark"] .eyebrow { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 600; font-size: .92rem; line-height: 1;
    padding: 13px 22px; border-radius: var(--radius-md);
    border: 1.5px solid transparent; transition: all .18s ease;
    text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(10, 92, 78, .55); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-gold { background: var(--accent); color: #241a05; box-shadow: 0 6px 14px -6px rgba(212, 168, 83, .6); }
.btn-gold:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-dark { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline-dark:hover { border-color: var(--text-muted); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-ghost { background: var(--surface-2); color: var(--text-soft); }
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 9px 15px; font-size: .84rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 30px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-md);
    background: transparent; border: 1.5px solid transparent; color: var(--text-soft);
    position: relative; transition: all .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .ico { width: 21px; height: 21px; }

/* ---------- Top bar ---------- */
.top-bar { background: #0B1512; color: #A8BDB6; font-size: .78rem; }
[data-theme="dark"] .top-bar { background: #08100E; }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; padding-top: 7px; padding-bottom: 7px; gap: 12px; }
.top-bar a { color: #A8BDB6; }
.top-bar a:hover { color: var(--accent); }
.top-bar .dot { opacity: .4; }
.top-bar-left { display: none; }
@media (min-width: 900px) { .top-bar-left { display: block; } .top-bar-left strong { color: #E8EEEC; } }

/* ---------- Header / nav ---------- */
.site-header {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 60;
}
.nav-row { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--accent); font-weight: 800; font-size: 1.35rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px -6px rgba(10, 92, 78, .5);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.22rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.brand-name b { color: var(--primary); }
.brand-tag { font-size: .64rem; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }

.main-nav { display: none; gap: 4px; margin-left: 8px; }
@media (min-width: 1080px) {
    .main-nav { display: flex; }
    .main-nav a {
        padding: 9px 13px; border-radius: var(--radius-md);
        font-weight: 600; font-size: .92rem; color: var(--text-soft);
    }
    .main-nav a:hover { color: var(--text); background: var(--surface-2); }
    .main-nav a.active { color: var(--primary); background: var(--primary-light); }
}

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-search { display: none; }
@media (min-width: 1240px) {
    .nav-search {
        display: flex; align-items: center; background: var(--surface-2);
        border: 1.5px solid var(--border); border-radius: var(--radius-full);
        padding: 3px 4px 3px 14px; width: 200px; transition: all .2s;
    }
    .nav-search:focus-within { width: 250px; border-color: var(--primary); }
    .nav-search input { border: 0; background: transparent; outline: none; color: var(--text); font-size: .88rem; width: 100%; }
    .nav-search button { border: 0; background: transparent; color: var(--text-muted); width: 30px; height: 30px; border-radius: 50%; }
    .nav-search button:hover { color: var(--primary); }
}

.cart-btn { border: 1.5px solid var(--border); background: var(--surface); }
.cart-count {
    position: absolute; top: -5px; right: -5px;
    min-width: 19px; height: 19px; padding: 0 5px;
    background: var(--accent); color: #241a05; border-radius: var(--radius-full);
    font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--surface);
}

.user-menu { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 9px;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius-full); padding: 4px 12px 4px 4px;
    color: var(--text); font-weight: 600; font-size: .88rem; transition: all .15s;
}
.user-chip:hover { border-color: var(--primary); }
.user-chip-name { display: none; }
@media (min-width: 560px) { .user-chip-name { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .8rem; }
.caret { width: 14px; height: 14px; }

.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    min-width: 210px; padding: 6px; display: none; z-index: 80;
    animation: popIn .16s ease;
}
.user-menu.open .user-dropdown { display: block; }
.dd-item { display: block; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; color: var(--text-soft); }
.dd-item:hover { background: var(--surface-2); color: var(--text); }
.dd-danger:hover { background: #FDECEC; color: var(--red); }
[data-theme="dark"] .dd-danger:hover { background: rgba(214, 69, 69, .12); }
.dd-sep { height: 1px; background: var(--border); margin: 6px 8px; }

.nav-burger { display: inline-flex; }
@media (min-width: 1080px) { .nav-burger { display: none; } }

.mobile-nav { display: none; border-bottom: 1px solid var(--border); background: var(--surface); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 13px 24px; font-weight: 600; color: var(--text-soft); border-top: 1px solid var(--border); }
.mobile-nav a.active, .mobile-nav a:hover { color: var(--primary); background: var(--surface-2); }

/* ---------- Page layout with AdSense sidebar ---------- */
.page-with-sidebar {
    display: block;
    max-width: 1240px; margin: 0 auto; padding: 0 20px;
}
.page-main { width: 100%; min-width: 0; }
.site-sidebar { width: 100%; }

@media (min-width: 992px) {
    .page-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.page-with-sidebar:has(> .page-sidebar) { grid-template-columns: minmax(0, 1fr) var(--sidebar-w); }
    .site-sidebar { position: sticky; top: calc(var(--header-h) + 20px); }
}

/* ---------- Sidebar cards ---------- */
.sidebar-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px;
    margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.widget-title { font-size: 1rem; font-weight: 800; margin-bottom: 14px; letter-spacing: -.01em; }
.widget-cta { display: block; text-align: center; font-weight: 700; font-size: .85rem; margin-top: 12px; color: var(--primary); }

/* AdSense card */
.ad-card { border: 1.5px solid var(--border); background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent-light) 30%, var(--surface))); }
.ad-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ad-label {
    font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-muted); background: var(--surface-2);
    padding: 3px 10px; border-radius: var(--radius-full);
}
.ad-region { font-size: .64rem; color: var(--text-muted); font-weight: 600; }
.ad-slot {
    min-height: 250px; display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border-radius: var(--radius-md);
    border: 1px dashed var(--border); overflow: hidden;
}
.ad-slot ins { width: 100%; }
.ad-fineprint { margin-top: 10px; font-size: .66rem; color: var(--text-muted); text-align: center; }

/* Trending widget */
.trending-list { display: flex; flex-direction: column; gap: 4px; }
.trending-item { display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: var(--radius-md); transition: background .15s; }
.trending-item:hover { background: var(--surface-2); }
.trending-rank { font-weight: 800; font-size: .85rem; color: var(--text-muted); width: 16px; text-align: center; }
.trending-thumb { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; display: flex; align-items: center; justify-content: center; }
.trending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.trending-meta { display: flex; flex-direction: column; min-width: 0; }
.trending-name { font-size: .86rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trending-price { font-size: .8rem; font-weight: 700; color: var(--primary); }

/* Newsletter */
.newsletter-card { background: linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 100%); border: 0; color: #EAF4F1; }
.newsletter-card .widget-title { color: #fff; }
.newsletter-copy { font-size: .85rem; opacity: .85; margin-bottom: 14px; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
    flex: 1; min-width: 0; border: 1.5px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12);
    border-radius: var(--radius-md); padding: 10px 12px; color: #fff; font-size: .86rem; outline: none;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.55); }
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-thanks { font-size: .88rem; font-weight: 600; }

/* Impact card */
.impact-card { text-align: center; background: var(--accent-light); }
.impact-num { font-size: 1.9rem; font-weight: 800; color: var(--accent-dark); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .impact-num { color: var(--accent); }
.impact-card p { font-size: .8rem; color: var(--text-soft); margin: 6px 0 12px; }
.impact-foot { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
        radial-gradient(900px 420px at -10% 110%, color-mix(in srgb, var(--primary) 30%, transparent), transparent 55%),
        linear-gradient(160deg, var(--primary-dark), var(--primary) 55%, #0E6B5A);
    color: #F2F8F6; padding: 72px 0 84px; position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 26px 26px; pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: grid; gap: 40px; align-items: center; }
@media (min-width: 992px) { .hero-inner { grid-template-columns: 1.15fr .85fr; } }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
.hero h1 .gold { color: var(--accent); }
.hero p.lead { margin: 18px 0 30px; font-size: 1.06rem; color: rgba(242, 248, 246, .88); max-width: 54ch; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 42px; flex-wrap: wrap; }
.hero-stat .n { font-size: 1.7rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-stat .l { font-size: .8rem; color: rgba(242, 248, 246, .75); }
.hero-art { position: relative; }
.hero-card {
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--radius-xl); backdrop-filter: blur(8px);
    padding: 20px; display: grid; gap: 12px; max-width: 380px; margin-left: auto;
    animation: floaty 6s ease-in-out infinite;
}
.hero-card .hc-row { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.12); border-radius: var(--radius-md); padding: 10px 12px; }
.hc-thumb { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex: none; background: rgba(255,255,255,.15); }
.hc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hc-meta .t { font-size: .85rem; font-weight: 700; }
.hc-meta .s { font-size: .74rem; color: rgba(242,248,246,.75); }
.hc-price { margin-left: auto; font-weight: 800; color: var(--accent); }
.hero-live-pill {
    position: absolute; top: -14px; left: -8px; z-index: 2;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius-full); padding: 8px 14px; font-size: .76rem; font-weight: 700;
    box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px;
}

/* ---------- Category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-tile {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 22px 16px; text-align: center; transition: all .18s; color: var(--text);
    box-shadow: var(--shadow-sm);
}
.cat-tile:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-md); }
.cat-ico { font-size: 1.9rem; margin-bottom: 10px; }
.cat-tile .n { font-weight: 700; font-size: .95rem; }
.cat-tile .c { font-size: .78rem; color: var(--text-muted); }

/* ---------- Product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
.product-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; transition: all .2s ease; position: relative; display: flex; flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.pc-media { position: relative; aspect-ratio: 1 / .92; overflow: hidden; background: var(--surface-2); }
.pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.product-card:hover .pc-media img { transform: scale(1.06); }
.pc-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.pc-fav {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 34px; height: 34px; border-radius: 50%; border: 0;
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; color: var(--text-muted);
    box-shadow: var(--shadow-sm); transition: all .15s;
}
.pc-fav:hover { color: var(--red); transform: scale(1.08); }
.pc-fav.active { color: var(--red); }
.pc-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-cat { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.pc-name { font-weight: 700; font-size: .97rem; line-height: 1.3; color: var(--text); }
.pc-name:hover { color: var(--primary); }
.pc-maker { font-size: .76rem; color: var(--text-muted); }
.pc-rating { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-soft); }
.stars { color: var(--accent); letter-spacing: 1px; font-size: .85rem; }
.pc-price-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.pc-price { font-weight: 800; font-size: 1.08rem; color: var(--primary); }
.pc-add { padding: 9px 13px; font-size: .82rem; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    padding: 4px 9px; border-radius: var(--radius-full); white-space: nowrap;
}
.badge-green { background: #DFF3EA; color: #17795B; }
.badge-blue { background: #E3ECFD; color: #2352C9; }
.badge-amber { background: #FBF0DB; color: #96610F; }
.badge-red { background: #FBE4E4; color: #A93333; }
.badge-gray { background: var(--surface-2); color: var(--text-soft); }
[data-theme="dark"] .badge-green { background: rgba(27, 158, 119, .18); color: #4FE0B4; }
[data-theme="dark"] .badge-blue { background: rgba(47, 111, 237, .2); color: #8FB0FF; }
[data-theme="dark"] .badge-amber { background: rgba(199, 126, 27, .2); color: #F2C069; }
[data-theme="dark"] .badge-red { background: rgba(214, 69, 69, .2); color: #F49B9B; }
.badge-live { background: #FBE4E4; color: #A93333; animation: pulseBg 2s infinite; }
[data-theme="dark"] .badge-live { background: rgba(214,69,69,.2); color: #F49B9B; }
.badge-sold { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-dark); }
[data-theme="dark"] .badge-sold { color: var(--accent); }

/* ---------- Filters / toolbar ---------- */
.shop-toolbar {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 16px; margin-bottom: 24px; display: grid; gap: 12px;
    grid-template-columns: 1fr; box-shadow: var(--shadow-sm);
}
@media (min-width: 900px) { .shop-toolbar { grid-template-columns: 2fr 1fr 1fr auto auto; align-items: end; } }
.toolbar-field label { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.toolbar-field input, .toolbar-field select {
    width: 100%; padding: 10px 13px; border-radius: var(--radius-md);
    border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text);
    font-size: .9rem; outline: none; transition: border-color .15s;
}
.toolbar-field input:focus, .toolbar-field select:focus { border-color: var(--primary); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 7px; margin: 34px 0 10px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 38px; height: 38px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md); border: 1.5px solid var(--border);
    background: var(--surface); font-weight: 600; font-size: .88rem; color: var(--text-soft);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .dots { border: 0; background: transparent; }

/* ---------- Product detail ---------- */
.breadcrumb { font-size: .82rem; color: var(--text-muted); margin: 22px 0 6px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.pd-grid { display: grid; gap: 28px; margin-top: 18px; }
@media (min-width: 992px) { .pd-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.pd-media {
    position: sticky; top: calc(var(--header-h) + 20px);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
    overflow: hidden; box-shadow: var(--shadow-md);
}
.pd-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; max-height: 620px; }
.pd-media .pc-badges { position: absolute; }
.pd-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.pd-meta-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.pd-price { font-size: 2rem; font-weight: 800; color: var(--primary); margin: 14px 0 4px; }
.pd-price small { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.pd-desc { color: var(--text-soft); margin: 16px 0; }
.pd-buy-row { display: flex; gap: 12px; align-items: stretch; margin: 18px 0; flex-wrap: wrap; }
.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.qty-stepper button { width: 40px; height: 46px; border: 0; background: var(--surface-2); font-size: 1.15rem; color: var(--text); }
.qty-stepper button:hover { background: var(--border); }
.qty-stepper input { width: 48px; text-align: center; border: 0; outline: none; font-weight: 700; font-size: .95rem; background: transparent; color: var(--text); }
.pd-trust { display: grid; gap: 8px; margin: 18px 0; }
.pd-trust div { display: flex; gap: 9px; align-items: center; font-size: .87rem; color: var(--text-soft); }
.pd-specs { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 22px; }
.pd-specs summary { padding: 14px 18px; font-weight: 700; cursor: pointer; list-style: none; }
.pd-specs summary::-webkit-details-marker { display: none; }
.pd-specs .spec-body { padding: 4px 18px 18px; display: grid; gap: 8px; }
.spec-row { display: flex; justify-content: space-between; gap: 14px; font-size: .88rem; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.spec-row .k { color: var(--text-muted); }
.spec-row .v { font-weight: 600; text-align: right; }

/* Reviews */
.reviews-box { margin-top: 26px; }
.review-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 15px 17px; margin-bottom: 12px; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.review-head .avatar { width: 34px; height: 34px; }
.review-name { font-weight: 700; font-size: .9rem; }
.review-date { font-size: .76rem; color: var(--text-muted); }
.review-text { font-size: .9rem; color: var(--text-soft); }
.review-form { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: 18px; margin-top: 18px; }
.star-picker { display: flex; gap: 4px; }
.star-picker button { font-size: 1.5rem; border: 0; background: transparent; color: var(--border); transition: transform .1s; }
.star-picker button:hover { transform: scale(1.15); }
.star-picker button.on { color: var(--accent); }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 460px; margin: 48px auto; padding: 0 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 34px 32px; }
.auth-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: .92rem; margin-bottom: 24px; }
.auth-card .field { margin-bottom: 16px; }
.auth-alt { text-align: center; font-size: .88rem; color: var(--text-muted); margin-top: 18px; }
.demo-box {
    margin-top: 22px; border: 1.5px dashed var(--accent);
    background: var(--accent-light); border-radius: var(--radius-md); padding: 14px 16px;
}
.demo-box h4 { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); margin-bottom: 8px; }
[data-theme="dark"] .demo-box h4 { color: var(--accent); }
.demo-cred { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; padding: 5px 0; color: var(--text-soft); }
.demo-cred code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .8rem; color: var(--text); background: var(--surface); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); }
.demo-btn-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; color: var(--text-soft); }
.field label .req { color: var(--red); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="date"], .field input[type="tel"],
.field select, .field textarea {
    width: 100%; padding: 11px 14px; border-radius: var(--radius-md);
    border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text);
    font-size: .93rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); background: var(--surface);
}
.field .hint { font-size: .76rem; color: var(--text-muted); margin-top: 5px; }
.field .error { font-size: .78rem; color: var(--red); margin-top: 5px; font-weight: 600; }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.form-grid { display: grid; gap: 0 18px; }
@media (min-width: 700px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.form-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: .9rem; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--primary); }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: auto; box-shadow: var(--shadow-sm); }
table.table { width: 100%; border-collapse: collapse; font-size: .89rem; min-width: 640px; }
.table th {
    text-align: left; padding: 13px 16px; font-size: .72rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted);
    border-bottom: 1.5px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.table .row-thumb { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; }
.table .t-strong { font-weight: 700; }
.table .t-soft { color: var(--text-muted); font-size: .82rem; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-actions .btn, .table-actions a { padding: 7px 11px; font-size: .78rem; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stat-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card .s-top { display: flex; justify-content: space-between; align-items: center; }
.stat-card .s-label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.stat-card .s-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--surface-2); }
.stat-card .s-num { font-size: 1.62rem; font-weight: 800; letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat-card .s-sub { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }
.stat-card .s-sub .up { color: var(--green); font-weight: 700; }
.stat-card .s-sub .down { color: var(--red); font-weight: 700; }
.stat-card.gold { background: linear-gradient(140deg, var(--primary-dark), var(--primary)); border: 0; color: #fff; }
.stat-card.gold .s-label, .stat-card.gold .s-sub { color: rgba(255,255,255,.75); }
.stat-card.gold .s-num { color: var(--accent); }
.stat-card.gold .s-ico { background: rgba(255,255,255,.14); }

/* ---------- Cards / panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-title { font-weight: 800; font-size: 1.02rem; }
.panel-body { padding: 20px; }
.panel-body.flush { padding: 0; }
.grid-2 { display: grid; gap: 20px; }
@media (min-width: 992px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-2-1 { display: grid; gap: 20px; }
@media (min-width: 992px) { .grid-2-1 { grid-template-columns: 1.6fr 1fr; } }
.grid-1-2 { display: grid; gap: 20px; }
@media (min-width: 992px) { .grid-1-2 { grid-template-columns: 1fr 1.6fr; } }
.stack { display: grid; gap: 20px; }

/* ---------- Chart (canvas) ---------- */
.chart-box { position: relative; }
.chart-box canvas { width: 100%; height: 260px; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: .8rem; color: var(--text-soft); margin-top: 10px; flex-wrap: wrap; }
.chart-legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* ---------- Empty / error states ---------- */
.empty-state { text-align: center; padding: 52px 20px; }
.empty-state .e-ico { font-size: 2.8rem; margin-bottom: 14px; }
.empty-state h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: .92rem; max-width: 40ch; margin: 0 auto 18px; }
.error-banner {
    background: #FBE4E4; border: 1px solid #F2B8B8; color: #8E2B2B;
    border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 20px; font-size: .92rem; font-weight: 600;
}
[data-theme="dark"] .error-banner { background: rgba(214,69,69,.14); border-color: rgba(214,69,69,.35); color: #F49B9B; }
.success-banner {
    background: #DFF3EA; border: 1px solid #B4E2D2; color: #14684E;
    border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 20px; font-size: .92rem; font-weight: 600;
}
[data-theme="dark"] .success-banner { background: rgba(27,158,119,.15); border-color: rgba(27,158,119,.4); color: #4FE0B4; }

/* ---------- Flash & toasts ---------- */
.flash-wrap { margin-top: 16px; }
.flash {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 13px 18px; border-radius: var(--radius-md); font-size: .92rem; font-weight: 600;
    border: 1px solid; margin-bottom: 10px;
}
.flash-success { background: #DFF3EA; border-color: #B4E2D2; color: #14684E; }
.flash-error { background: #FBE4E4; border-color: #F2B8B8; color: #8E2B2B; }
.flash-warning { background: #FBF0DB; border-color: #F0D9AE; color: #7A5410; }
.flash-info { background: #E3ECFD; border-color: #C3D4F9; color: #2352C9; }
[data-theme="dark"] .flash-success { background: rgba(27,158,119,.16); border-color: rgba(27,158,119,.4); color: #4FE0B4; }
[data-theme="dark"] .flash-error { background: rgba(214,69,69,.16); border-color: rgba(214,69,69,.4); color: #F49B9B; }
[data-theme="dark"] .flash-warning { background: rgba(199,126,27,.16); border-color: rgba(199,126,27,.4); color: #F2C069; }
[data-theme="dark"] .flash-info { background: rgba(47,111,237,.16); border-color: rgba(47,111,237,.4); color: #8FB0FF; }
.flash-close { border: 0; background: transparent; color: inherit; font-size: 1.2rem; opacity: .6; }
.flash-close:hover { opacity: 1; }

.toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--green);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 13px 16px;
    font-size: .88rem; font-weight: 600; display: flex; gap: 10px; align-items: flex-start;
    animation: slideIn .3s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast .t-ico { font-size: 1.05rem; }

/* ---------- Live purchase pop-up ---------- */
.purchase-pop {
    position: fixed; bottom: 22px; left: 22px; z-index: 290;
    opacity: 0; transform: translateY(16px); pointer-events: none;
    transition: all .4s cubic-bezier(.21, 1.02, .55, 1);
}
.purchase-pop.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.purchase-pop-inner {
    display: flex; gap: 12px; align-items: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 12px 16px; max-width: 330px;
}
.purchase-ico { font-size: 1.5rem; }
.purchase-txt { display: flex; flex-direction: column; line-height: 1.35; font-size: .84rem; color: var(--text-soft); }
.purchase-txt strong { color: var(--text); font-size: .9rem; }
.purchase-when { font-size: .72rem; color: var(--text-muted); }
.purchase-close { border: 0; background: transparent; color: var(--text-muted); font-size: 1.2rem; }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(8, 16, 14, .55); backdrop-filter: blur(3px);
    z-index: 400; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease; }
.modal-box {
    background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 480px; max-height: 88vh; overflow: auto;
    animation: popIn .22s cubic-bezier(.2, 1.2, .4, 1);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 1.12rem; font-weight: 800; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }

/* ---------- Skeleton loading ---------- */
.skeleton {
    position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-md);
}
.skeleton::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent);
    animation: shimmer 1.4s infinite;
}
.skel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.skel-card .s-img { aspect-ratio: 1 / .9; }
.skel-card .s-line { height: 12px; margin: 12px 15px; }
.skel-card .s-line.w60 { width: 60%; }
.skel-card .s-line.w40 { width: 40%; }

/* ---------- Footer ---------- */
.site-footer { background: #0B1512; color: #9FB4AD; margin-top: 60px; font-size: .9rem; }
[data-theme="dark"] .site-footer { background: #08100E; }
.footer-grid { display: grid; gap: 34px; padding: 52px 20px 40px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand-name { color: #fff; }
.footer-brand-name b { color: var(--accent); }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #9FB4AD; }
.footer-col a:hover { color: var(--accent); }
.footer-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.f-badge { font-size: .72rem; font-weight: 700; background: rgba(255,255,255,.08); padding: 5px 11px; border-radius: var(--radius-full); color: #CFE2DC; }
.footer-legal { margin-top: 14px; font-size: .82rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.09); }
.footer-bottom-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; font-size: .78rem; color: #7E938C; }
.footer-pay { letter-spacing: .04em; }

/* ---------- Admin layout ---------- */
.admin-body { background: #0D1413; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side {
    background: #0B1211; border-right: 1px solid #1C2A26;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid #1C2A26; }
.admin-brand .brand-mark { width: 38px; height: 38px; font-size: 1.15rem; }
.admin-brand-txt { font-size: 1.05rem; font-weight: 800; color: #E8EEEC; display: flex; flex-direction: column; line-height: 1.15; }
.admin-brand-txt b { color: var(--accent); }
.admin-brand-txt small { font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7C8B87; }
.admin-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.admin-nav-group { font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #5A6B66; padding: 14px 10px 6px; }
.admin-nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 2px;
    border-radius: 10px; color: #A8BDB6; font-size: .9rem; font-weight: 600;
    border: 1px solid transparent;
}
.admin-nav a span { width: 20px; text-align: center; }
.admin-nav a:hover { background: #13201D; color: #E8EEEC; }
.admin-nav a.active { background: linear-gradient(90deg, rgba(23,169,140,.18), rgba(23,169,140,.06)); color: #4FE0B4; border-color: rgba(23,169,140,.3); }
.nav-badge { margin-left: auto; font-size: .58rem; font-weight: 800; letter-spacing: .1em; color: #F49B9B; background: rgba(214,69,69,.18); border-radius: 6px; padding: 2px 7px; animation: pulseBg 2s infinite; font-style: normal; }
.admin-nav-ext { opacity: .8; }
.admin-side-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid #1C2A26; }
.admin-side-foot .avatar { width: 36px; height: 36px; }
.admin-side-user { flex: 1; min-width: 0; line-height: 1.25; color: #E8EEEC; }
.admin-side-user small { color: #7C8B87; font-size: .72rem; display: block; }
.admin-side-foot .icon-btn { color: #7C8B87; border: 1px solid #1C2A26; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 26px; border-bottom: 1px solid #1C2A26; background: rgba(11,18,17,.85); backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 40;
}
.admin-title { font-size: 1.12rem; font-weight: 800; color: #E8EEEC; letter-spacing: -.01em; }
.admin-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live-pill {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: .68rem; font-weight: 800; letter-spacing: .1em; color: #4FE0B4;
    background: rgba(23,169,140,.14); border: 1px solid rgba(23,169,140,.35);
    padding: 5px 12px; border-radius: var(--radius-full);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2FD3A5; animation: pulse 1.6s infinite; }
.admin-notif { position: relative; font-size: 1.15rem; cursor: default; }
.notif-count {
    position: absolute; top: -6px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--red); color: #fff; border-radius: 9px; font-size: .64rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.admin-content { padding: 26px; flex: 1; }
.admin-content .flash { margin-bottom: 0; margin-left: -26px; margin-right: -26px; margin-top: -26px; border-radius: 0; border-left: 0; border-right: 0; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: fixed; left: -270px; width: 260px; z-index: 200; transition: left .25s ease; height: 100vh; }
    .admin-side.open { left: 0; box-shadow: var(--shadow-lg); }
    .admin-burger { display: inline-flex !important; }
}
.admin-burger { display: none; }

/* Admin theme overrides (dark-first) */
.admin-body {
    --bg: #0D1413; --surface: #131C1A; --surface-2: #1A2624; --border: #24332F;
    --text: #E8EEEC; --text-soft: #B7C4C0; --text-muted: #7C8B87;
    --primary: #17A98C; --primary-dark: #0E7A64; --primary-light: #0E2A25;
    --accent: #E5BC6E; --accent-dark: #C99A3F; --accent-light: #2A2313;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs a {
    padding: 11px 16px; font-weight: 700; font-size: .9rem; color: var(--text-muted);
    border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); margin: 22px 0; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: .8em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; }
.row-flex { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 28px; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.small { font-size: .84rem; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .86em; }
.hidden { display: none !important; }
.center { text-align: center; }

.reveal { animation: fadeUp .5s ease both; }
.reveal-d1 { animation-delay: .08s; } .reveal-d2 { animation-delay: .16s; } .reveal-d3 { animation-delay: .24s; }

/* ---------- Keyframes ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pulseBg { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes countPop { 0% { transform: scale(1); } 40% { transform: scale(1.12); color: var(--accent); } 100% { transform: scale(1); } }
.count-pop { animation: countPop .5s ease; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 991px) {
    .hero { padding: 52px 0 60px; }
    .section { padding: 40px 0; }
    .site-sidebar { margin-top: 34px; }
    .site-sidebar .ad-slot { min-height: 220px; }
}
@media (max-width: 640px) {
    .pd-grid { gap: 20px; }
    .pd-media { position: static; }
    .pd-title { font-size: 1.4rem; }
    .pd-price { font-size: 1.6rem; margin: 10px 0 2px; }
    .pd-buy-row { gap: 8px; }
    .pd-buy-row .btn { flex: 1 1 auto; text-align: center; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .pc-body { padding: 11px 12px 13px; }
    .toast-stack { left: 12px; right: 12px; max-width: none; }
    .purchase-pop { left: 12px; right: 12px; }
    .purchase-pop-inner { max-width: none; }
    .admin-content { padding: 16px; }
}

@media print {
    .top-bar, .site-header, .site-sidebar, .site-footer, .toast-stack, .purchase-pop { display: none !important; }
}

/* ============================================================
   Dynamic page loader (top progress bar + spinner)
   ============================================================ */
#pageLoader {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 10000;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
    background: transparent;
}
#pageLoader.ready { opacity: 1; }
#pageLoader .pl-bar {
    height: 100%;
    width: 0;
    margin-left: 0;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 8px rgba(212, 168, 83, .55);
}
#pageLoader.active .pl-bar {
    animation: pl-indeterminate 1.15s cubic-bezier(.44, 0, .34, 1) infinite;
}
@keyframes pl-indeterminate {
    0%   { width: 0;    margin-left: 0; }
    45%  { width: 55%;  margin-left: 20%; }
    100% { width: 0;    margin-left: 100%; }
}
#pageLoader .pl-spin {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    display: none;
    background: var(--surface);
}
#pageLoader.active .pl-spin { display: block; animation: pl-spin .7s linear infinite; }
@keyframes pl-spin { to { transform: translateX(-50%) rotate(360deg); } }

/* Ad slot: keep a visible reserved space until an ad is served */
.ad-slot { min-height: 260px; display: flex; align-items: stretch; }
.ad-slot ins.adsbygoogle { flex: 1; }
.ad-fallback {
    flex: 1;
    margin: 0;
    padding: 18px 16px 16px;
    border-radius: var(--radius-md);
    background:
        radial-gradient(120% 90% at 100% 0%, var(--accent-light) 0%, transparent 55%),
        linear-gradient(160deg, var(--surface-2), var(--surface));
    border: 1.5px dashed var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}
.ad-fallback[hidden] { display: none; }
.ad-fallback .af-brand { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); }
.ad-fallback .af-title { font-size: 1.02rem; font-weight: 800; line-height: 1.35; color: var(--text); }
.ad-fallback .af-copy { font-size: .82rem; color: var(--text-soft); line-height: 1.45; }
.ad-fallback .af-cta {
    align-self: flex-start;
    font-size: .8rem; font-weight: 700;
    color: #fff; background: var(--primary);
    padding: 8px 14px; border-radius: var(--radius-full);
    text-decoration: none;
}
.ad-fallback .af-cta:hover { background: var(--primary-dark); }

/* ============================================================
   CSMS-style login card (matches original design)
   ============================================================ */
.csms-brand { text-align: center; margin-bottom: 18px; }
.csms-logo {
    font-size: 1.9rem; font-weight: 800; letter-spacing: .02em;
    color: var(--primary); line-height: 1.1;
}
.csms-tag { color: var(--text-muted); font-size: .85rem; margin: 2px 0 0; }
.csms-heading { font-size: 1.02rem; font-weight: 700; text-align: center; margin: 0 0 14px; }
.google-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 12px 16px;
    font-size: .95rem; font-weight: 600; color: var(--text);
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius-md); cursor: pointer;
    transition: all .18s ease;
}
.google-btn:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.or-divider {
    position: relative; display: flex; align-items: center;
    margin: 18px 0; color: var(--text-muted); font-size: .78rem;
}
.or-divider::before { content: ""; flex: 1; height: 1px; background: var(--border); }
.or-divider span { padding: 0 12px; background: var(--surface); font-weight: 600; }
.input-lg {
    width: 100%; padding: 13px 15px; font-size: .98rem;
    border: 1.5px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input-lg:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.field.invalid .input-lg { border-color: var(--red); }
.csms-links { text-align: center; margin-top: 18px; font-size: .9rem; }
.csms-links a { font-weight: 600; }
.csms-links .dot { margin: 0 8px; color: var(--text-muted); }
.csms-legal { text-align: center; font-size: .78rem; color: var(--text-muted); margin: 12px 0 0; line-height: 1.5; }
.csms-legal a { font-weight: 600; }

/* ============================================================
   Control Center – admin dashboard (original CSMS style)
   ============================================================ */
.cc-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.cc-title { display: flex; align-items: center; gap: 10px; }
.cc-title h1 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.cc-ico { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.cc-title .cc-ico { background: var(--primary-light); }
.cc-welcome { margin: 0; font-size: .92rem; color: var(--text-soft); }
.cc-welcome b { color: var(--text); }
.cc-date { font-size: .85rem; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; border-radius: var(--radius-full); }
.role-badge {
    display: inline-block; margin-left: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    background: var(--primary-light); color: var(--primary-dark);
}
.cc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 22px; }
.cc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cc-card-head h5 { margin: 0; font-size: 1.02rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cc-card-head small { color: var(--text-muted); font-size: .78rem; }
.count-pill { font-size: .68rem; font-weight: 800; background: var(--surface-2); color: var(--text-soft); padding: 3px 9px; border-radius: 999px; }
.cc-table-wrap { overflow-x: auto; }
.cc-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.cc-table thead th {
    text-align: left; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
    color: var(--text-muted); padding: 9px 12px; border-bottom: 2px solid var(--border);
}
.cc-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cc-table tbody tr:last-child td { border-bottom: 0; }
.cc-table tbody tr { transition: background .15s ease; }
.cc-table tbody tr:hover { background: var(--surface-2); }
.cc-table .total-cell { color: var(--green); font-weight: 800; white-space: nowrap; }
.cc-table .date-cell { color: var(--text-muted); white-space: nowrap; }
.cc-empty { text-align: center; color: var(--text-muted); padding: 26px 0 !important; }
.pill-btn {
    display: inline-block; padding: 6px 13px; border-radius: 999px;
    background: var(--primary); color: #fff !important; font-size: .74rem; font-weight: 700;
    transition: background .15s ease; white-space: nowrap;
}
.pill-btn:hover { background: var(--primary-dark); }
.status-select {
    font-size: .78rem; font-weight: 700; padding: 6px 10px;
    border: 1.5px solid var(--border); border-radius: 9px;
    background: var(--surface); color: var(--text); cursor: pointer; max-width: 150px;
}
.status-select:focus { outline: none; border-color: var(--primary); }
.inline-form { margin: 0; }
.cc-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.cc-stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); padding: 16px 14px; text-align: center;
    border-top: 3px solid var(--tint, var(--border));
    transition: transform .2s ease, box-shadow .2s ease;
}
.cc-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cc-stat .cc-stat-ico { font-size: 1.35rem; }
.cc-stat-tag {
    display: inline-block; margin-top: 6px; font-size: .64rem; font-weight: 800;
    letter-spacing: .09em; text-transform: uppercase; color: var(--tint, var(--text-muted));
    background: var(--surface-2); padding: 3px 10px; border-radius: 999px;
}
.cc-stat-num { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.cc-stat p { margin: 0; font-size: .76rem; color: var(--text-soft); line-height: 1.35; }
.cc-stat-revenue .cc-stat-num { color: var(--primary); }
.cc-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.action-btn {
    display: flex; align-items: center; gap: 11px; padding: 13px 14px;
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
    text-decoration: none; color: var(--text);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--tint, var(--primary)); }
.action-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; color: #fff; flex: none; }
.action-text { display: flex; flex-direction: column; gap: 1px; }
.action-text b { font-size: .86rem; }
.action-text small { font-size: .7rem; color: var(--text-muted); }

@media (max-width: 1100px) { .cc-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) {
    .cc-stats { grid-template-columns: repeat(2, 1fr); }
    .cc-header { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) { .cc-stats { grid-template-columns: 1fr; } }

/* ============================================================
   base_public.html design system (original portal chrome)
   Appended last so it overrides earlier custom header rules.
   ============================================================ */
.top-bar {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 0.5rem 0;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--gray-800);
}
.top-bar a { color: var(--gray-300); text-decoration: none; transition: color 0.2s; }
.top-bar a:hover { color: var(--accent); }
.top-bar .social-link {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gray-800);
    border-radius: var(--radius-full);
    margin-left: 0.5rem;
    transition: all 0.2s;
}
.top-bar .social-link:hover { background: var(--accent); color: var(--gray-900); }

.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-xs);
    margin-bottom: 0;
}
.navbar-brand {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary) !important;
    letter-spacing: -0.5px;
    text-decoration: none;
    margin-left: 0.5rem;
}
.navbar-brand span { color: #B8860B; }
.navbar .nav-link {
    color: var(--gray-700) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-full);
    transition: all 0.2s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-light);
}
.navbar .nav-link i { margin-right: 0.3rem; font-size: 0.85rem; }

.search-form { position: relative; width: 250px; }
.search-form input {
    width: 100%;
    padding: 0.6rem 1rem;
    padding-right: 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    background: var(--gray-50);
    transition: all 0.2s;
}
.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-form button {
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    padding: 0.5rem;
    cursor: pointer;
}
.search-form button:hover { color: var(--primary); }

.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    color: var(--gray-700);
    transition: all 0.2s;
    text-decoration: none;
}
.cart-link:hover { background: var(--primary); color: white; }
.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent);
    color: var(--gray-900);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
    border: 2px solid white;
    min-width: 18px;
    text-align: center;
}

.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
}
.user-dropdown .dropdown-toggle:hover { background: var(--primary-light); color: var(--primary); }
.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}
.user-dropdown .dropdown-menu {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    min-width: 200px;
    border: 1px solid var(--gray-200);
}
.user-dropdown .dropdown-item {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.user-dropdown .dropdown-item i { width: 1.2rem; color: var(--gray-500); }
.user-dropdown .dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.user-dropdown .dropdown-item:hover i { color: var(--primary); }

.breadcrumb-section {
    background: var(--gray-50);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}
.breadcrumb-section .breadcrumb { margin: 0; background: transparent; }
.breadcrumb-section .breadcrumb-item { font-size: 0.85rem; }
.breadcrumb-section .breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-section .breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-section .breadcrumb-item.active { color: var(--gray-600); }
.breadcrumb-section .breadcrumb-item + .breadcrumb-item::before { color: var(--gray-400); content: "›"; }

.messages-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
}
.messages-container .alert {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.2rem;
    background: white;
    border-left: 4px solid;
    font-size: 0.9rem;
    animation: rmSlideIn 0.3s ease;
}
@keyframes rmSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.messages-container .alert-success { border-left-color: var(--primary); }
.messages-container .alert-danger, .messages-container .alert-error { border-left-color: #DC2626; }
.messages-container .alert-warning { border-left-color: #F59E0B; }
.messages-container .alert-info { border-left-color: #3B82F6; }

.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}
.footer h5 {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.footer-links a:hover { color: var(--accent); padding-left: 5px; }
.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gray-800);
    border-radius: var(--radius-full);
    color: var(--gray-400);
    margin-right: 0.5rem;
    transition: all 0.2s;
}
.footer-social a:hover { background: var(--accent); color: var(--gray-900); }
.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 2rem;
    margin-top: 3rem;
    font-size: 0.85rem;
}
.footer-bottom a { color: var(--gray-400); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }

@media (max-width: 992px) {
    .search-form { width: 100%; margin: 0.5rem 0; }
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: var(--radius-lg);
        margin-top: 0.5rem;
        border: 1px solid var(--gray-200);
    }
}
@media (max-width: 768px) {
    .top-bar .container { flex-direction: column; gap: 0.3rem; text-align: center; }
    .navbar-brand { font-size: 1.5rem; }
    .user-dropdown .dropdown-toggle span:not(.user-avatar) { display: none; }
}

/* ============================================================
   PRO UX LAYER — preloader, scroll reveals, micro-interactions,
   fly-to-cart, back-to-top, sticky buy bar, polish details
   ============================================================ */

::selection { background: var(--accent); color: var(--gray-900); }

/* slim brand scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 8px; border: 2px solid var(--surface-2); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* ---------- Brand preloader ---------- */
#rmPreloader {
    position: fixed; inset: 0; z-index: 40000;
    background: var(--surface);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0;
    transition: opacity .5s ease, visibility .5s ease;
}
#rmPreloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
#rmPreloader .pl-badge {
    width: 76px; height: 76px; border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
    animation: pl-breathe 2s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(20, 92, 50, .25);
}
#rmPreloader .pl-badge svg { width: 44px; height: 44px; display: block; }
@keyframes pl-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.055); } }
#rmPreloader .pl-word { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin-bottom: 2px; }
#rmPreloader .pl-word b { color: var(--primary); }
#rmPreloader .pl-tag { font-size: .95rem; color: var(--text-muted); margin-bottom: 22px; }
#rmPreloader .pl-bar {
    width: min(340px, 72vw); height: 14px; border-radius: 999px;
    background: var(--gray-200); position: relative;
}
[data-theme="dark"] #rmPreloader .pl-bar { background: #2e3a33; }
#rmPreloader .pl-fill {
    height: 100%; width: 0%; min-width: 14px; border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #1e7a45);
    position: relative; transition: width .25s ease;
}
#rmPreloader .pl-sprout { position: absolute; right: -7px; top: -17px; width: 22px; height: 22px; display: block; }
#rmPreloader .pl-sub { font-size: .8rem; color: var(--text-muted); margin-top: 14px; }
#rmPreloader .pl-pct { color: var(--primary); font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
    #rmPreloader .pl-badge { animation: none; }
    #rmPreloader .pl-fill { transition: none; }
}

/* ---------- Page enter ---------- */
body.rm-entered #main-content { animation: pageIn .55s cubic-bezier(.22,.61,.36,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Scroll reveal system ---------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); transition-delay: var(--rvd, 0s); will-change: opacity, transform; }
.rv-left { transform: translateX(-30px); }
.rv-right { transform: translateX(30px); }
.rv-zoom { transform: scale(.94); }
.rv.in { opacity: 1; transform: none; }
/* animated underline for section titles */
.rv-title { position: relative; display: inline-block; }
.rv-title::after {
    content: ""; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%) scaleX(0);
    width: 64px; height: 4px; border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: transform .8s cubic-bezier(.22,.61,.36,1) .25s;
}
.rv.in .rv-title::after, .rv-title.in::after { transform: translateX(-50%) scaleX(1); }

/* ---------- Back to top ---------- */
#toTop {
    position: fixed; right: 22px; bottom: 22px; z-index: 9990;
    width: 46px; height: 46px; border: none; border-radius: 50%;
    background: var(--primary); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(14px);
    transition: all .35s cubic-bezier(.22,.61,.36,1);
}
#toTop.show { opacity: 1; visibility: visible; transform: none; }
#toTop:hover { background: var(--primary-dark); transform: translateY(-4px); }
#toTop svg { width: 20px; height: 20px; }

/* ---------- Fly-to-cart ---------- */
.fly-dot {
    position: fixed; z-index: 30000;
    width: 16px; height: 16px; margin: -8px 0 0 -8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--accent), var(--primary));
    box-shadow: 0 4px 14px rgba(10, 92, 78, .45);
    pointer-events: none;
    transition: transform .8s cubic-bezier(.5,.05,.7,.5), opacity .8s ease;
}
@keyframes cartBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.45); }
    60% { transform: scale(.9); }
    100% { transform: scale(1); }
}
.cart-bounce { animation: cartBounce .55s ease; }

/* ---------- Image lazy fade ---------- */
img.rm-img { opacity: 0; transition: opacity .65s ease; }
img.rm-img.rm-loaded { opacity: 1; }

/* ---------- Button micro-interactions ---------- */
.btn, .btn-add, .btn-deal, .btn-service, .btn-modal, .btn-ncs, .action-btn, .qty-btn, .newsletter-btn, .icon-btn {
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}
.btn:active, .btn-add:active, .btn-deal:active, .btn-service:active, .btn-modal:active, .btn-ncs:active, .action-btn:active, .icon-btn:active { transform: scale(.965); }
.btn:focus-visible, .btn-add:focus-visible, input:focus-visible, button:focus-visible, a:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}

/* ---------- Sticky mobile buy bar (product detail) ---------- */
.m-buy-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9980;
    display: none;
    align-items: center; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(15, 40, 35, .14);
    transform: translateY(0);
    transition: transform .4s cubic-bezier(.22,.61,.36,1);
}
.m-buy-bar img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; flex: none; }
.m-buy-bar .mbb-name { font-size: .8rem; font-weight: 700; line-height: 1.2; max-width: 40%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m-buy-bar .mbb-price { font-size: 1rem; font-weight: 800; color: var(--primary); white-space: nowrap; }
.m-buy-bar .btn { flex: none; }
@media (max-width: 768px) {
    .m-buy-bar { display: flex; }
    .m-buy-bar .hide-sm { display: none; }
    body.has-mbuy { padding-bottom: 76px; }
}

/* ---------- Details / summary polish ---------- */
details summary { cursor: pointer; list-style: none; position: relative; padding-right: 2rem; font-weight: 700; }
details summary::-webkit-details-marker { display: none; }
details summary::after {
    content: ""; position: absolute; right: .35rem; top: 50%;
    width: 9px; height: 9px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform .3s ease;
}
details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }

/* ---------- Table row hover (public tables) ---------- */
table.table tbody tr { transition: background .15s ease; }
table.table tbody tr:hover { background: var(--surface-2); }

/* ---------- Star button hover ---------- */
.star-btn { transition: transform .15s ease, color .15s ease; }
.star-btn:hover { transform: scale(1.25) rotate(8deg); }

/* ---------- Trending item hover ---------- */
.trending-item { transition: transform .2s ease, box-shadow .2s ease; }
.trending-item:hover { transform: translateX(4px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .rv { opacity: 1; transform: none; }
    #rmPreloader { display: none; }
}

/* ==================== DELIVERY MAP WIDGET (round 4) ==================== */
.dm .dm-map {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    z-index: 1;
}
.dm .dm-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.dm .dm-loc {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    min-width: 0;
}
.dm .dm-geo {
    padding: 9px 14px;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}
.dm .dm-geo:hover:not(:disabled) { background: var(--primary); color: #fff; }
.dm .dm-geo:disabled { opacity: .6; cursor: wait; }
.dm .dm-info {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.dm .dm-info.show { display: grid; }
.dm .dm-info > div {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.dm .dm-info span { font-size: .78rem; color: var(--text-muted); }
.dm .dm-info b { font-size: .85rem; text-align: right; }
.dm .dm-fee { color: var(--primary) !important; }
.dm .dm-summary {
    display: none;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--success-soft, #e8f3ed);
    color: var(--primary);
    font-size: .85rem;
    font-weight: 700;
}
.dm .dm-saved-note {
    display: none;
    margin-top: 8px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--success, #15803d);
}
.dm .dm-track-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
    font-size: .82rem;
    color: var(--text-muted);
}
.dm .dm-track-meta b { color: var(--text); }
.dm-pin { background: none; border: none; }
.dm-pin span {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.dm-pin--facility span { background: #145c32; }
.dm-pin--customer span { background: #f59e0b; }
@media (max-width: 575px) {
    .dm .dm-info { grid-template-columns: 1fr; }
    .dm .dm-controls { flex-direction: column; }
}

/* ==================== LIVE SEARCH SUGGESTIONS (round 4) ==================== */
.search-wrap { position: relative; }
.search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 320px;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1080;
    overflow: hidden;
}
.search-suggest .ss-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--surface-2);
    transition: background .15s;
}
.search-suggest .ss-item:last-child { border-bottom: 0; }
.search-suggest .ss-item:hover, .search-suggest .ss-item.active { background: var(--surface-2); }
.search-suggest .ss-img {
    width: 38px; height: 38px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-2);
}
.search-suggest .ss-name { font-size: .86rem; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggest .ss-price { font-size: .82rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.search-suggest .ss-empty { padding: 14px; font-size: .84rem; color: var(--text-muted); }

[data-theme="dark"] .dm-summary { background: rgba(46,168,122,.12); color:#4fe0b4; }
