/* Rokban — public site. Colours and tone taken from the first ChatGPT mock-up the team liked. */

:root {
    --green: #073f35;
    --green-2: #0d5949;
    --green-dark: #0b3029;
    --ink: #172822;
    --gold: #f3b83f;
    --gold-2: #ffc958;
    --cream: #f4f5f1;
    --paper: #fff;
    --muted: #65746e;
    --line: #dce2de;
    --shadow: 0 2px 9px #173f3614;
    --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font: 15px/1.55 'DM Sans', 'Noto Sans Khmer', system-ui, sans-serif;
}

:lang(km), [lang="km"] { font-family: 'Noto Sans Khmer', 'DM Sans', sans-serif; line-height: 1.7; }

h1, h2, h3 { font-family: Manrope, 'Noto Sans Khmer', sans-serif; line-height: 1.2; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(1400px, calc(100% - 32px)); margin-inline: auto; }
.muted { color: var(--muted); font-size: .85em; }

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 22px; padding: 11px 20px;
    background: var(--green); color: #fff; font-weight: 700; cursor: pointer;
}
.button:hover { background: var(--green-2); }
.button.gold { background: var(--gold); color: var(--green-dark); }
.button.gold:hover { background: var(--gold-2); }
.button.light { background: #fff; color: var(--green); border-radius: 6px; }
.button.small { padding: 8px 12px; font-size: 13px; }

/* ---------- Header ---------- */

.market-header { position: sticky; top: 0; z-index: 30; background: var(--green); color: #fff; box-shadow: 0 2px 8px #001b1645; }
.header-main { display: flex; align-items: center; gap: 12px 20px; padding: 10px 0; flex-wrap: wrap; }
.logo img { display: block; height: 44px; width: auto; filter: brightness(0) invert(1); }
.search {
    order: 3; flex: 1 1 100%; display: flex; height: 46px; background: #fff; border-radius: 8px;
    border: 3px solid transparent; overflow: hidden;
}
.search:focus-within { border-color: var(--gold); }
.search input { flex: 1; min-width: 0; border: 0; padding: 0 14px; font-size: 15px; color: var(--ink); }
.search input:focus { outline: 0; }
.search button { border: 0; width: 56px; background: var(--gold); color: var(--green-dark); cursor: pointer; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.language { position: relative; }
.language summary {
    list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid #ffffff55; border-radius: 6px;
    font-size: 13px; font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 7px;
}
.language img { width: 22px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px #0000001f; flex: none; }
.language summary::-webkit-details-marker { display: none; }
.language-menu {
    position: absolute; right: 0; top: calc(100% + 6px); background: #fff; color: var(--ink);
    border-radius: 8px; box-shadow: 0 8px 24px #0003; min-width: 140px; overflow: hidden;
}
.language-menu a { display: flex; align-items: center; gap: 9px; padding: 10px 14px; white-space: nowrap; }
.language-menu b { width: 24px; font-size: 13px; }
.language-menu span { color: var(--muted); font-size: 13px; }
.language-menu a:hover, .language-menu a[aria-current] { background: var(--cream); font-weight: 700; }

.nav-row { background: var(--green-dark); }
.nav-row nav { display: flex; align-items: center; gap: 22px; height: 42px; font-size: 13px; overflow-x: auto; scrollbar-width: none; }
.nav-link { white-space: nowrap; padding: 10px 2px; border-bottom: 2px solid transparent; }
.nav-link:hover { border-color: var(--gold); }
.nav-promise { margin-left: auto; color: #b8cdc6; white-space: nowrap; }

.category-menu { position: static; }
.category-menu summary { list-style: none; cursor: pointer; font-weight: 700; white-space: nowrap; padding: 10px 0; }
.category-menu summary::-webkit-details-marker { display: none; }
.category-menu-panel {
    position: absolute; left: 0; right: 0; top: 100%; background: #fff; color: var(--ink);
    box-shadow: 0 12px 30px #0003; padding: 20px max(16px, calc((100% - 1400px) / 2));
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 28px;
    max-height: 70vh; overflow: auto;
}
.category-menu-panel section { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.category-menu-panel a:hover { color: var(--green-2); text-decoration: underline; }
.menu-root { font-weight: 800; font-size: 14px; margin-bottom: 3px; }

/* ---------- Home ---------- */

.hero {
    margin-top: 18px; padding: 28px 22px; border-radius: 14px; overflow: hidden;
    background: linear-gradient(115deg, #fff 0 60%, #e9efe8 60%);
    display: grid; gap: 20px;
}
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #4f695f; }
.hero h1 { font-size: clamp(30px, 4.4vw, 50px); letter-spacing: -1px; margin: 12px 0; color: var(--green); }
.hero-copy > p { color: var(--muted); max-width: 560px; }
.hero-search { display: flex; gap: 8px; margin: 18px 0 8px; max-width: 560px; }
.hero-search input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 22px; padding: 11px 16px; }
.hero-art { display: none; position: relative; min-height: 260px; }
.hero-product {
    position: absolute; background: #fff; border: 6px solid #fff; border-radius: 6px;
    box-shadow: 0 15px 28px #0b302926; object-fit: contain;
}
.hero-product.p1 { width: 190px; height: 220px; left: 6%; top: 20px; transform: rotate(-6deg); }
.hero-product.p2 { width: 160px; height: 190px; right: 8%; top: 70px; transform: rotate(7deg); }
.hero-product.p3 { width: 130px; height: 150px; left: 40%; bottom: 0; transform: rotate(-2deg); }

.promise { background: #fff; border-block: 1px solid var(--line); margin-top: 20px; }
.promise .wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 6vw; padding: 14px 0; font-size: 14px; }

.section { padding-block: 30px 10px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 22px; color: var(--green); }
.see-all { font-weight: 700; color: var(--green-2); white-space: nowrap; }


/* ---------- Product cards ---------- */

.product-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.product-card { padding: 12px; border-right: 1px solid #e8ece9; border-bottom: 1px solid #e8ece9; display: flex; flex-direction: column; min-width: 0; }
.product-photo { position: relative; display: block; aspect-ratio: 1; background: #f7f8f6; border-radius: 6px; overflow: hidden; }
/* Small and tucked in the corner: announces without covering the product. */
.badge-new { position: absolute; top: 6px; right: 6px; z-index: 1; background: var(--gold); color: var(--green-dark);
    font: 800 10px/1 Manrope, 'Noto Sans Khmer', sans-serif; letter-spacing: .04em; text-transform: uppercase;
    padding: 4px 7px; border-radius: 999px; box-shadow: 0 1px 3px #0003; pointer-events: none; }
.product-photo img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s; }
.product-photo:hover img { transform: scale(1.04); }
.product-shop { margin-top: 10px; font-size: 11px; color: #557067; }
.product-card h3 { font: 500 14px/1.35 Manrope, 'Noto Sans Khmer', sans-serif; margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card h3 a:hover { color: #a45418; text-decoration: underline; }
.product-price { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.product-price strong { font-size: 18px; white-space: nowrap; }
.price-from { font-size: 12px; color: var(--muted); }
.product-price .price-from + strong { margin-left: -4px; }
.product-price s { color: var(--muted); font-size: 13px; }
.product-variants { margin-top: 4px; font-size: 12px; color: #557067; }

/* ---------- Shops ---------- */

.shop-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.shop-chip { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.shop-chip:hover { border-color: var(--green); }
.shop-chip img, .shop-initial { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.shop-initial { display: grid; place-items: center; background: var(--green); color: #fff; font-weight: 800; font-size: 20px; }
.shop-chip small { display: block; color: var(--muted); }

.seller {
    margin-block: 34px; padding: 26px; border-radius: 14px; background: var(--green); color: #fff;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.seller h2 { margin: 0 0 6px; }
.seller p { margin: 0; color: #d6e2de; }

/* ---------- Footer ---------- */

.site-footer { background: var(--green); color: #e9dec8; margin-top: 40px; padding: 28px 0; text-align: center; }
.site-footer .logo img { height: 36px; margin: 0 auto 8px; }
.site-footer p { margin: 4px 0; }
.site-footer .muted { color: #b8cdc6; }

/* ---------- Theme cards (home: collections and main categories) ---------- */

.theme-row { display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 6px; scrollbar-width: none; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-card { scroll-snap-align: start; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); min-width: 0; transition: border-color .2s, box-shadow .2s; }
.theme-card:hover { border-color: var(--green); box-shadow: 0 6px 18px #173f3624; }
.theme-visual { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1; overflow: hidden; background: #f7f8f6; }
.theme-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.theme-visual img:only-child { grid-column: 1 / -1; grid-row: 1 / 3; }
.theme-visual .stand-in { object-fit: contain; background: #fff; }
.theme-card:hover .theme-visual img { transform: scale(1.04); }
.theme-name { padding: 12px 14px 14px; font: 700 16px/1.25 Manrope, 'Noto Sans Khmer', sans-serif; color: var(--green); }
.theme-card:hover .theme-name { color: #a45418; }

/* Category and collection pages: the banner under the breadcrumbs. */
.listing-banner { position: relative; display: grid; border-radius: 16px; overflow: hidden; background: var(--green); color: #fff; margin: 8px 0 18px; }
.listing-banner img { grid-area: 1 / 1; width: 100%; height: 190px; object-fit: cover; }
.listing-banner-copy { grid-area: 1 / 1; align-self: end; padding: 60px 18px 18px; }
.listing-banner.with-image .listing-banner-copy { background: linear-gradient(transparent, #0b3029e6 55%); }
.listing-banner h1 { margin: 0 0 6px; font-size: clamp(24px, 3.2vw, 38px); color: #fff; }
.listing-banner p { margin: 0 0 6px; max-width: 640px; color: #e6efe9; font-size: 15px; line-height: 1.45; }
.listing-count { font-size: 12px; color: #b8cdc6; }

/* ---------- Listing (search, categories) ---------- */

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); padding: 16px 0 4px; }
.breadcrumbs a:hover { color: var(--green-2); text-decoration: underline; }
.listing-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 14px; }
.listing-head h1, .listing-head h2 { margin: 0; color: var(--green); }
.listing-head h1 { font-size: clamp(24px, 3vw, 34px); }
.listing-body { display: grid; gap: 18px; }
/* Filters: a full-screen panel on phones, a sticky column from 980px. */
.filters { position: fixed; inset: 0; z-index: 60; background: var(--cream); display: none; flex-direction: column; }
.filters.open, .filters:target { display: flex; }
body.filters-lock { overflow: hidden; }
.filters-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--green); color: #fff; font-size: 17px; }
.filters-close { color: #fff; font-size: 20px; padding: 2px 8px; }
#filter-form { flex: 1; overflow-y: auto; padding: 4px 16px 0; }
.filter-group { border-bottom: 1px solid var(--line); padding: 14px 0; }
.filter-group h3 { margin: 0 0 10px; font: 700 13px/1.2 Manrope, 'Noto Sans Khmer', sans-serif; text-transform: uppercase; letter-spacing: .04em; color: var(--green); }
.filter-categories a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 14px; }
.filter-categories .nav-up { color: var(--muted); font-size: 13px; }
.filter-categories .nav-current { display: block; padding: 6px 0; font-weight: 800; color: var(--ink); font-size: 14px; }
.filter-categories .nav-child { padding-left: 12px; }
.filter-categories a:hover span:first-child { color: #a45418; text-decoration: underline; }
.count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.filter-check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.filter-check .count { margin-left: auto; }
.filter-check input { width: 18px; height: 18px; accent-color: var(--green); flex: none; margin: 0; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #0000002e; flex: none; }
.swatch.unknown { background: conic-gradient(#c9302c, #f2cf3a, #3d8b4f, #2f6fce, #7d4ea3, #c9302c); }
.filter-more summary { cursor: pointer; color: var(--green-2); font-size: 13px; font-weight: 700; padding: 6px 0; list-style: none; }
.filter-more summary::-webkit-details-marker { display: none; }
.filter-more summary::after { content: ' ▾'; }
.filter-more[open] summary { display: none; }
.size-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.size-choice input { position: absolute; opacity: 0; pointer-events: none; }
.size-choice span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 36px; padding: 0 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; }
.size-choice span:hover { border-color: var(--green); }
.size-choice input:checked + span { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.size-choice input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Price slider: two range inputs on one track; only the thumbs catch the finger. */
.price-values { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.price-values span { color: var(--muted); font-weight: 400; }
.price-track { position: relative; height: 36px; margin: 0 12px; }
.price-track::before { content: ''; position: absolute; left: 0; right: 0; top: 16px; height: 4px; border-radius: 2px; background: var(--line); }
.price-fill { position: absolute; top: 16px; height: 4px; border-radius: 2px; background: var(--green); }
.price-track input { position: absolute; left: -12px; width: calc(100% + 24px); top: 0; height: 36px; margin: 0; background: none;
    -webkit-appearance: none; appearance: none; pointer-events: none; z-index: 2; }
.price-track input::-webkit-slider-runnable-track { background: none; height: 36px; }
.price-track input::-moz-range-track { background: none; }
.price-track input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 26px; height: 26px; margin-top: 5px; border-radius: 50%;
    background: #fff; border: 3px solid var(--green); box-shadow: 0 1px 4px #0003; cursor: grab; }
.price-track input::-moz-range-thumb { pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--green);
    box-shadow: 0 1px 4px #0003; cursor: grab; }
.price-track input:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--gold); }

.filter-sort { display: none; }
.filter-sort select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; font: inherit; font-size: 14px; }
.filters-actions { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0 16px; background: var(--cream); }
.filters-actions .button { flex: 1; justify-content: center; }

.subcategory-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.subcategory-chips a { flex: none; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px 12px; }
.listing-tools { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 10px; }
.filters-open { margin-right: auto; padding: 7px 14px; gap: 6px; }
.badge { background: var(--gold); color: var(--ink); border-radius: 10px; font-size: 12px; padding: 0 7px; font-weight: 800; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.active-filters a { font-size: 13px; background: #fff; border: 1px solid var(--green); color: var(--green); border-radius: 16px; padding: 5px 10px; font-weight: 600; }
.active-filters a span { margin-left: 4px; font-size: 11px; }
.active-filters a:hover { background: var(--cream); }
.active-filters .clear { border-color: transparent; background: none; text-decoration: underline; font-weight: 400; }
.sort label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sort select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; }
.empty { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; padding: 50px 20px; }
.empty h2 { margin-top: 0; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0; font-size: 14px; }
.page-link { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 8px 16px; font-weight: 600; }
.page-link:hover { border-color: var(--green); }
.page-link.disabled { color: #b3bcb8; }
.page-status { color: var(--muted); }

/* ---------- Product page ---------- */

.product-layout { display: grid; gap: 22px; margin-top: 10px; }
.gallery { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.gallery-main { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-main img { flex: 0 0 100%; aspect-ratio: 1; object-fit: contain; scroll-snap-align: center; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #f7f8f6; }
.sold-by { margin: 0; color: var(--muted); }
.sold-by a { color: var(--green); font-weight: 700; }
.product-details h1 { font-size: clamp(26px, 3.4vw, 40px); margin: 8px 0; color: var(--ink); }
.language-note { font-size: 12px; color: var(--muted); background: #fff; border-left: 3px solid var(--gold); padding: 6px 10px; }
.machine-note { font-size: 12px; color: var(--muted); background: #fff; border-left: 3px solid var(--gold); padding: 6px 10px; margin: 4px 0 8px; }
.machine-note summary { cursor: pointer; list-style: none; }
.machine-note summary::-webkit-details-marker { display: none; }
.machine-note summary u { color: var(--green-2); }
.machine-note .original { margin-top: 8px; font-size: 14px; color: var(--ink); }
.machine-note .original p { margin: 6px 0 0; color: #314c47; }
.price-block { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 16px; }
.price-block strong { font-size: 30px; }
.price-block s { color: var(--muted); }
.variant-row { margin: 0 0 14px; }
.variant-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.variant-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-choice { min-width: 44px; min-height: 40px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink); }
.variant-choice:hover { border-color: var(--green); }
.variant-choice.active { border: 2px solid var(--green); padding: 7px 13px; font-weight: 700; background: var(--cream); }
.order-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.order-box h2 { margin: 0; font-size: 16px; }
.share-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.share-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.share-button { font: 600 13px/1 inherit; font-family: inherit; padding: 8px 12px; border-radius: 999px; background: #fff;
    border: 1px solid var(--line); color: var(--green); cursor: pointer; }
.share-button:hover { border-color: var(--green); }
.share-native { background: var(--green); color: #fff; border-color: var(--green); }
.order-button { justify-content: space-between; border-radius: 10px; }
.button.outline { background: #fff; color: var(--green); border: 1px solid var(--green); }
.button.outline:hover { background: var(--cream); }
.description h2 { font-size: 18px; margin-top: 24px; }
.description p { color: #314c47; white-space: normal; }

/* ---------- Shop page ---------- */

.shop-header { display: flex; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 18px 0; }
.shop-header h1 { margin: 0; color: var(--green); }
.shop-logo, .shop-initial.big { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; }
.shop-initial.big { font-size: 34px; }

/* ---------- Larger screens ---------- */

@media (min-width: 700px) {
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .theme-row { grid-auto-columns: 30%; }
    .theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .listing-banner img { height: 240px; }
    .hero { padding: 36px 44px; }
}

@media (min-width: 980px) {
    .header-main { flex-wrap: nowrap; height: 76px; padding: 0; }
    .search { order: 0; flex: 1 1 auto; max-width: 820px; }
    .logo img { height: 52px; }
    .hero { grid-template-columns: 1.15fr .85fr; align-items: center; }
    .hero-art { display: block; }
    .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .theme-row { grid-auto-columns: calc((100% - 48px) / 5); }
    .listing-banner { grid-template-columns: 1fr 1fr; background: var(--green); }
    .listing-banner img { grid-area: 1 / 2; height: 260px; }
    .listing-banner-copy { grid-area: 1 / 1; align-self: center; padding: 28px 36px; }
    .listing-banner.with-image .listing-banner-copy { background: none; }
    .listing-body { grid-template-columns: 240px 1fr; align-items: start; }
    .listing-body:not(:has(.filters)) { grid-template-columns: 1fr; }
    /* As tall as the product list (grid row), longer if it needs to; never an inner scroll. */
    .filters { display: flex; position: static; inset: auto; z-index: auto; align-self: stretch;
        background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
    .filters-top { display: none; }
    /* The filters follow the scroll while they fit on screen (JS removes .fits when they don't:
       a sticky block taller than the window would hide its own bottom). */
    #filter-form { padding: 0 16px; overflow: visible; display: flex; flex-direction: column; flex: none; align-self: stretch; }
    #filter-form.fits { position: sticky; top: 132px; align-self: flex-start; width: 100%; }
    .filters { flex-direction: column; }
    .filter-group:last-of-type { border-bottom: 0; }
    .filters-actions { position: static; background: #fff; padding: 10px 0 14px; border-top: 1px solid var(--line); }
    .filters-actions .button.gold { display: none; } /* changes apply at once on large screens */
    .filters-actions:not(:has(.outline)) { display: none; }
    .filters-open, .subcategory-chips { display: none; }
    .filter-sort { display: block; border-bottom: 1px solid var(--line); }
    .listing-body:has(.filters) .listing-tools { display: none; } /* the order moved into the sidebar */
    .listing-main .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .listing-body:not(:has(.filters)) .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .product-layout { grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 40px; }
    .gallery { position: sticky; top: 140px; }
}

/* ---------- Error pages ---------- */

.error-page { background: var(--cream); }
.error-box { max-width: 620px; text-align: center; padding: 60px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.error-code { margin: 0; font: 800 64px/1 Manrope, sans-serif; color: var(--gold); }
.error-box h1 { margin: 0; color: var(--green); }
.error-box .hero-search { width: 100%; }

/* ---------- Seller space (phone first) ---------- */

.seller-page { max-width: 640px; padding-block: 18px 40px; display: flex; flex-direction: column; gap: 14px; }
.seller-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.seller-card h1 { margin: 0 0 6px; font-size: 24px; color: var(--green); }
.seller-card h2 { margin: 0 0 6px; font-size: 18px; color: var(--green); }
.seller-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink); min-width: 0; flex: 1; }
.field input, .field select, .field textarea { font: inherit; font-weight: 400; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line);
    border-radius: 10px; background: #fff; width: 100%; box-sizing: border-box; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: var(--green); }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.button.wide { width: 100%; justify-content: center; padding: 13px; font-size: 16px; }
.form-error { margin: -4px 0 0; color: #b3261e; font-size: 13px; }
.flash { margin: 0; background: #e8f3ec; border: 1px solid #b9dcc6; color: var(--green); border-radius: 10px; padding: 10px 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.telegram-login { display: flex; justify-content: center; min-height: 44px; margin-top: 12px; }
.seller-switch { margin: 14px 0 0; font-size: 14px; text-align: center; }
.seller-switch a, .seller-card a:not(.button) { color: var(--green-2); font-weight: 700; }
.channels { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.channels legend { font-weight: 800; color: var(--green); margin-bottom: 4px; }
.channel-row { display: flex; align-items: flex-end; gap: 10px; }
.primary-choice { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); padding-bottom: 10px; }
.primary-choice input { width: 20px; height: 20px; accent-color: var(--green); margin: 0; }
.logo-preview { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }
.seller-nav { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.seller-nav a { flex: none; }
.seller-nav a, .seller-nav button { font: 700 14px/1 inherit; font-family: inherit; padding: 9px 14px; border-radius: 999px; background: #fff;
    border: 1px solid var(--line); color: var(--green); cursor: pointer; }
.seller-nav a.active { background: var(--green); color: #fff; border-color: var(--green); }
.seller-nav form { margin-left: auto; flex: none; }
.seller-nav button { color: var(--muted); border: 0; background: none; padding: 9px 4px; text-decoration: underline; font-weight: 400; }
.shop-line { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.shop-line .shop-logo, .shop-line .shop-initial.big { width: 64px; height: 64px; font-size: 26px; }
.status-pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.status-pending { background: #fff4d6; color: #7a5200; }
.status-active { background: #e2f3e8; color: #17603a; }
.status-suspended { background: #fde3e1; color: #9b1c14; }

.seller-products { display: flex; flex-direction: column; gap: 8px; }
.seller-product { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.seller-product .thumb { width: 64px; height: 64px; border-radius: 8px; background: #f7f8f6; overflow: hidden; flex: none; }
.seller-product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.seller-product .info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; font-size: 14px; }
.seller-product .info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.seller-product .info .status-pill { align-self: flex-start; }
.seller-product .chevron { font-size: 24px; color: var(--muted); }
.photos { border: 0; padding: 0; margin: 0; }
.photos legend { font-weight: 800; color: var(--green); margin-bottom: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #f7f8f6; border: 1px solid var(--line); display: block; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .remove { position: absolute; left: 0; right: 0; bottom: 0; background: #000a; color: #fff; font-size: 11px; padding: 4px; display: flex; gap: 4px; align-items: center; }
.photo.add { display: grid; place-items: center; text-align: center; font-size: 12px; font-weight: 700; color: var(--green); border-style: dashed; cursor: pointer; }
.photo.add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.price-row .currency { flex: 0 0 120px; }
.category-steps { display: flex; flex-direction: column; gap: 8px; }
.category-steps select { font: inherit; font-weight: 400; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.small { font-size: 12px; margin: 0; }
.delete-form { text-align: center; }
.link-danger { background: none; border: 0; color: #b3261e; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }

.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.period { display: flex; gap: 4px; }
.period a { font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--green) !important; }
.period a.active { background: var(--green); color: #fff !important; border-color: var(--green); }
.stat-total { margin: 10px 0; color: var(--muted); }
.stat-total strong { display: block; font: 800 34px/1.1 Manrope, sans-serif; color: var(--green); }
.day-bars { display: flex; align-items: flex-end; gap: 2px; height: 70px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.day-bars span { flex: 1; background: var(--gold); border-radius: 2px 2px 0 0; min-width: 2px; }
.day-bars span.zero { background: var(--line); }
.stats h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--green); margin: 16px 0 6px; }
.stat-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-row { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 5px 0; border-bottom: 1px solid #eef1ef; font-size: 14px; }
.stat-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed-test { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.feed-samples { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.feed-samples span { display: flex; flex-direction: column; gap: 3px; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.feed-samples img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #f7f8f6; border-radius: 6px; }
.rejections summary { cursor: pointer; font-size: 13px; color: var(--green-2); font-weight: 700; margin: 6px 0; }

/* Seller space: light header (logo, title, language, back to the site). */
.seller-header .header-main { flex-wrap: nowrap; height: 64px; padding-block: 0; }
.seller-header .logo img { height: 40px; width: auto; }
.seller-title { font: 800 15px/1.2 Manrope, 'Noto Sans Khmer', sans-serif; color: #fff; white-space: nowrap; margin-right: auto;
    padding-left: 12px; border-left: 1px solid #ffffff40; }
.seller-header .button.small { white-space: nowrap; }
@media (max-width: 480px) {
    .seller-header .header-main { gap: 8px; }
    .seller-title { font-size: 13px; padding-left: 8px; }
    .seller-header .language summary span { display: none; } /* the flag says it */
    .seller-header .button.small { padding: 7px 10px; font-size: 12px; }
}

.handle-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.handle-input > span { display: flex; align-items: center; padding: 0 4px 0 12px; background: var(--cream); color: var(--muted); font-weight: 600; font-size: 15px; white-space: nowrap; }
.handle-input input { border: 0 !important; border-radius: 0 !important; padding-left: 4px !important; min-width: 0; }
.handle-input:focus-within { outline: 2px solid var(--gold); border-color: var(--green); }
.handle-status { margin: -4px 0 0; }
.handle-status.ok { color: #17603a; font-weight: 700; }
.short-url { margin: 4px 0 10px; font: 800 20px/1.3 Manrope, sans-serif; word-break: break-all; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.qr-block { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.qr-block img { width: 160px; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qr-block div { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 6px 0 10px; font-size: 13px; }
.footer-links a { color: #d7e6e0; text-decoration: underline; }
.legal-page { max-width: 760px; padding-block: 20px 50px; line-height: 1.65; color: #24372f; }
.legal-page h1 { color: var(--green); margin: 10px 0 4px; }
.legal-page h2 { color: var(--green); font-size: 20px; margin: 28px 0 8px; }
.legal-page h3 { font-size: 16px; margin: 18px 0 6px; }
.legal-page .updated { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.legal-page .lead { font-size: 17px; background: #fff; border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 0 8px 8px 0; }
.legal-page a { color: var(--green-2); font-weight: 600; text-decoration: underline; }
.legal-page code { background: #eef1ef; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin: 4px 0; }
