/* ==========================================================================
   AU Supermarket Specials — Design System (clean & refined)
   Warm neutral surfaces, one deep-green accent, sale red used sparingly.
   ========================================================================== */

:root {
    --bg: #f6f5f1;
    --surface: #ffffff;
    --surface-2: #f1f0eb;
    --surface-3: #e9e7e1;
    --ink: #1b1b19;
    --ink-2: #57564f;
    --ink-3: #8f8d85;
    --line: #e6e4dd;
    --line-strong: #d6d3ca;
    --accent: #1d6b47;
    --accent-ink: #ffffff;
    --accent-soft: #e7f1ea;
    --accent-text: #1d6b47;
    --sale: #d23b2a;
    --sale-soft: #fcebe8;
    --next: #b86e00;
    --next-soft: #fbf1df;
    --woolies: #178841;
    --coles: #e01a22;
    --aldi: #1f3f8f;
    --shadow-sm: 0 1px 2px rgba(27, 27, 25, 0.04);
    --shadow-md: 0 1px 2px rgba(27, 27, 25, 0.04), 0 8px 24px -12px rgba(27, 27, 25, 0.14);
    --shadow-lg: 0 24px 60px -20px rgba(27, 27, 25, 0.28);
    --radius: 16px;
    --radius-sm: 10px;
    color-scheme: light;
}

html.dark {
    --bg: #121211;
    --surface: #1b1b1a;
    --surface-2: #242422;
    --surface-3: #2e2e2b;
    --ink: #f3f2ed;
    --ink-2: #b5b3ab;
    --ink-3: #7f7d76;
    --line: #2b2b29;
    --line-strong: #3a3a37;
    --accent: #5cbf8c;
    --accent-ink: #0d1f16;
    --accent-soft: #1b2c23;
    --accent-text: #7fd3a6;
    --sale: #ff7a67;
    --sale-soft: #3a1f1b;
    --next: #f0b457;
    --next-soft: #33281a;
    --woolies: #3fb56b;
    --coles: #ff5a5f;
    --aldi: #7f9cf0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
}

/* ---------- Base ---------- */
html, body { background: var(--bg); }
body {
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Noto Sans TC', 'Noto Sans CJK TC', 'Microsoft JhengHei', system-ui, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: 0.005em;
}
::selection { background: var(--accent); color: var(--accent-ink); }
.num { font-family: 'Inter', system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.t-ink { color: var(--ink); }
.t-ink-2 { color: var(--ink-2); }
.t-ink-3 { color: var(--ink-3); }
.t-accent { color: var(--accent-text); }
.t-sale { color: var(--sale); }
.bg-surface { background: var(--surface); }
.bg-surface-2 { background: var(--surface-2); }
.b-line { border-color: var(--line); }
.divider { height: 1px; background: var(--line); }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, background .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.icon-btn {
    width: 38px; height: 38px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-2); background: transparent; border: 1px solid var(--line);
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.96); }

.lang-group { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); }
.lang-btn {
    padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
    color: var(--ink-3); transition: all .15s ease; white-space: nowrap;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.lang-select {
    appearance: none; -webkit-appearance: none;
    height: 38px; padding: 0 28px 0 12px; border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--ink);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238f8d85' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
    border: 1px solid var(--line);
}

.cart-btn {
    height: 38px; padding: 0 14px 0 13px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ink); color: var(--bg);
    font-size: 13px; font-weight: 600;
    transition: transform .1s ease, opacity .15s ease;
}
.cart-btn:hover { opacity: .9; }
.cart-btn:active { transform: scale(.97); }
.cart-count {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg); color: var(--ink); font-size: 11px; font-weight: 700;
}

/* ---------- Hero ---------- */
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.hero-title { font-size: clamp(28px, 6vw, 44px); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.hero-sub { font-size: 14px; color: var(--ink-2); }
.status-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); display: inline-block; }
.period-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--accent-text); }
.period-chip.is-next { color: var(--next); }
.period-chip.is-next .status-dot { background: var(--next); box-shadow: 0 0 0 4px var(--next-soft); }

.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stat-divider { width: 1px; align-self: stretch; background: var(--line); }
@media (max-width: 640px) {
    .stat-value { font-size: 19px; }
    .stat-label { font-size: 11px; }
    .stat-divider { display: none; }
}
.store-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex-shrink: 0; }
.dot-woolies { background: var(--woolies); }
.dot-coles { background: var(--coles); }
.dot-aldi { background: var(--aldi); }

/* ---------- Segmented controls ---------- */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-2); max-width: 100%; }
.seg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--ink-2);
    transition: all .18s ease; white-space: nowrap;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-md); }
.seg-btn .seg-meta { font-size: 11px; font-weight: 500; color: var(--ink-3); }
.seg-btn .seg-tag {
    font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
    background: var(--next-soft); color: var(--next);
}
.seg-lg .seg-btn { padding: 10px 20px; font-size: 14px; }

/* ---------- Announcement ---------- */
.notice {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.notice-toggle { flex: 1; min-width: 0; text-align: left; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.notice-icon {
    width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--next-soft); color: var(--next); font-size: 13px;
}
.notice-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--next-soft); color: var(--next); white-space: nowrap; }
.notice-chevron { transition: transform .2s ease; color: var(--ink-3); }
.notice.is-open .notice-chevron { transform: rotate(180deg); }
.notice-body { display: none; padding: 0 16px 16px 60px; }
.notice.is-open .notice-body { display: block; }
@media (max-width: 640px) { .notice-body { padding-left: 16px; } }

/* ---------- Category nav ---------- */
.cat-nav {
    position: sticky; z-index: 30;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--line);
}
.cat-scroller { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; scroll-padding: 16px; }
@media (min-width: 1024px) { .cat-scroller { flex-wrap: wrap; overflow: visible; } }


.chip {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
    height: 36px; padding: 0 14px 0 11px; border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
    background: var(--surface); border: 1px solid var(--line);
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip:active { transform: scale(.97); }
.chip .chip-emoji { font-size: 15px; line-height: 1; }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }

/* ---------- Toolbar ---------- */
.toolbar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.search-field {
    width: 100%; height: 46px; padding: 0 40px 0 44px; border-radius: 12px;
    font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid transparent;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.search-field::placeholder { color: var(--ink-3); }
.search-field:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.store-tab .store-dot { margin-right: 2px; }
.store-tab.is-active[data-store="Woolworths"] { color: var(--woolies); }
.store-tab.is-active[data-store="Coles"] { color: var(--coles); }
.store-tab.is-active[data-store="ALDI"] { color: var(--aldi); }
.toggle-pill {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
    transition: all .15s ease; white-space: nowrap;
}
.toggle-pill:hover { color: var(--ink); border-color: var(--line-strong); }
.toggle-pill.is-on { background: var(--sale); color: #fff; border-color: var(--sale); font-weight: 600; }
.toggle-pill .fa-fire { color: var(--sale); }
.toggle-pill.is-on .fa-fire { color: #fff; }
.select-pill {
    appearance: none; -webkit-appearance: none; height: 38px; padding: 0 32px 0 14px; border-radius: 999px;
    font-size: 13px; font-weight: 500; color: var(--ink); border: 1px solid var(--line);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238f8d85' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 13px center;
    cursor: pointer;
}
.select-pill:focus { outline: none; border-color: var(--accent); }
.result-badge { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.result-badge.is-next { background: var(--next-soft); color: var(--next); }

/* ---------- Product card ---------- */
.p-card {
    position: relative; display: flex; flex-direction: column;
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden; cursor: pointer;
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
@media (hover: hover) {
    .p-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: transparent; }
    .p-card:hover .p-img { transform: scale(1.05); }
}
.p-card:active { transform: scale(.985); }
.p-media {
    position: relative; aspect-ratio: 1 / 1; background: #fff;
    display: flex; align-items: center; justify-content: center; padding: 14%;
    border-bottom: 1px solid var(--line);
}
html.dark .p-media { background: #f4f3ef; border-bottom-color: transparent; }
.p-media img.p-img { position: relative; z-index: 1; max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .5s cubic-bezier(.2,.7,.2,1); }

.p-half { position: absolute; z-index: 2; top: 8px; left: 8px; width: 30%; max-width: 58px; min-width: 38px; aspect-ratio: 1/1; pointer-events: none; }
.p-half img { width: 100%; height: 100%; object-fit: contain; }
.p-flag {
    position: absolute; z-index: 2; top: 10px; right: 10px;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
    background: rgba(255,255,255,.92); color: #8a5a00; box-shadow: 0 0 0 1px rgba(0,0,0,.06);
}
.p-flag.half { right: auto; left: 10px; background: var(--sale); color: #fff; box-shadow: none; }
.p-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.p-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); min-width: 0; }
.p-meta .p-store { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-2); flex-shrink: 0; }
.p-meta .sep { opacity: .5; }
.p-meta .p-cat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-title {
    font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em;
}
.p-subtitle {
    font-size: 12px; line-height: 1.4; color: var(--ink-3);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em;
}
.p-compare {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px;
    background: var(--surface-2); color: var(--ink-2);
}
.p-compare.is-cheaper { background: var(--accent-soft); color: var(--accent-text); }
.p-price-row { margin-top: auto; padding-top: 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.p-price { display: flex; align-items: baseline; gap: 1px; color: var(--ink); line-height: 1; }
.p-price .cur { font-size: 14px; font-weight: 600; align-self: flex-start; margin-top: 3px; }
.p-price .dol { font-size: 28px; font-weight: 700; letter-spacing: -0.04em; }
.p-price .cts { font-size: 14px; font-weight: 600; align-self: flex-start; margin-top: 3px; }
.p-price .unit { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.p-price.is-sale { color: var(--sale); }
.p-was { font-size: 11px; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.p-was s { text-decoration-thickness: 1px; }
.p-save { font-weight: 600; color: var(--sale); }
.p-unit { font-size: 11px; color: var(--ink-3); }
.p-add {
    width: 38px; height: 38px; border-radius: 999px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
    transition: background .15s ease, color .15s ease, transform .1s ease, border-color .15s ease;
}
.p-add:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.p-add:active { transform: scale(.92); }
@media (max-width: 640px) {
    .p-body { padding: 10px 11px 12px; gap: 5px; }
    .p-title { font-size: 13px; }
    .p-price .dol { font-size: 24px; }
    .p-add { width: 34px; height: 34px; }
    .p-media { padding: 12%; }
}

/* ---------- Surfaces: drawer / modal / misc ---------- */
.panel { background: var(--surface); color: var(--ink); }
.panel-2 { background: var(--surface-2); }
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border-radius: 999px;
    background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600;
    transition: opacity .15s ease, transform .1s ease;
}
.btn-primary:hover { opacity: .9; }
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 18px; border-radius: 999px;
    background: transparent; color: var(--ink-2); border: 1px solid var(--line); font-size: 14px; font-weight: 500;
    transition: all .15s ease;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.list-section { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.list-item { background: var(--surface); border-radius: 12px; padding: 10px; display: flex; align-items: center; gap: 10px; }
.store-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.tag { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.is-next { background: var(--next-soft); color: var(--next); }
.tag.is-sale { background: var(--sale-soft); color: var(--sale); }
.tag.is-accent { background: var(--accent-soft); color: var(--accent-text); }
.to-top {
    position: fixed; bottom: 22px; right: 18px; z-index: 40; width: 44px; height: 44px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-md);
    transition: all .3s ease;
}
.to-top:hover { background: var(--ink); color: var(--bg); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s ease infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }


/* ==========================================================================
   Mobile-first readability & smoothness
   ========================================================================== */
/* Offscreen cards skip layout/paint until scrolled near: smoother long lists */
.p-card { content-visibility: auto; contain-intrinsic-size: auto 340px; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { overscroll-behavior-y: none; }
button, a, select, input, .chip, .p-card { touch-action: manipulation; }

@media (max-width: 767px) {
    /* Frosted-glass blur is expensive to repaint while scrolling on phones: use solid bars */
    .site-header, .cat-nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
    .site-header { border-bottom-color: var(--line); }

    /* Comfortable reading sizes */
    body { font-size: 15px; }
    .hero-title { font-size: 30px; }
    .hero-sub { font-size: 13px; line-height: 1.6; }
    .p-meta { font-size: 11.5px; }
    .p-title { font-size: 14.5px; line-height: 1.42; }
    .p-subtitle { font-size: 12px; }
    .p-was, .p-unit { font-size: 11.5px; }

    /* Bigger touch targets (>= 40px) */
    .chip { height: 40px; font-size: 14px; padding: 0 15px 0 12px; }
    .seg-btn { padding: 10px 15px; font-size: 14px; }
    .toggle-pill, .select-pill { height: 42px; font-size: 14px; }
    .p-add { width: 40px; height: 40px; }
    .icon-btn, .lang-select, .cart-btn { height: 40px; }
    .icon-btn { width: 40px; }
    .lang-btn { padding: 7px 12px; }
    .notice-toggle { padding: 12px 14px; }
}

@media (max-width: 380px) {
    .p-price .dol { font-size: 22px; }
    .p-body { padding: 9px 10px 11px; }
    .chip { font-size: 13.5px; }
}


/* ==========================================================================
   RWD safety: nothing may ever be wider than the phone screen
   ========================================================================== */
html, body { max-width: 100%; overflow-x: clip; }
body > * { min-width: 0; max-width: 100%; }
img { max-width: 100%; }

@media (max-width: 767px) {
    /* Week toggle: two equal halves that always fit the screen */
    .seg-lg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .seg-lg .seg-btn { min-width: 0; padding: 10px 8px; gap: 6px; }
    .seg-lg .seg-btn > span:not(.seg-tag) { overflow: hidden; text-overflow: ellipsis; }
    /* Store filter: scrolls sideways inside itself, never widens the page */
    #storeTabs { width: 100%; }
    .hero-sub { overflow-wrap: anywhere; }
    .stat { flex-shrink: 0; }
    #statsRow { flex-wrap: wrap; overflow: visible; row-gap: 14px; column-gap: 22px; }
}
@media (max-width: 400px) {
    .seg-lg .seg-tag { display: none; }
    .seg-lg .seg-btn i { display: none; }
}


/* ==========================================================================
   Category menu: two rows (upper + lower), swipe sideways, tucks away on scroll
   ========================================================================== */
.cat-grid {
    display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: max-content;
    gap: 8px; overflow-x: auto; padding: 10px 0; scroll-padding: 16px; overscroll-behavior-x: contain;
}
.cat-grid .chip { height: 40px; padding: 0 14px 0 6px; border-radius: 12px; gap: 9px; }
.chip-icon {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1;
    border: 1px solid transparent;
}
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
html.dark .chip.is-active { color: #0d1f16; }
.chip.is-active .chip-icon { background: rgba(255,255,255,.22) !important; border-color: rgba(255,255,255,.35) !important; }
@media (max-width: 767px) {
    .cat-nav { top: 64px; }
    .cat-grid .chip { height: 42px; font-size: 14px; }
}

/* ---------- Category arrows: show there is more to the right ---------- */
.cat-wrap { position: relative; }
.cat-arrow {
    position: absolute; top: 0; bottom: 0; width: 52px; z-index: 2;
    display: flex; align-items: center; border: 0; cursor: pointer;
    color: var(--ink); font-size: 13px; transition: opacity .2s ease;
}
.cat-arrow i {
    width: 32px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md);
}
.cat-arrow-right { right: -4px; justify-content: flex-end; background: linear-gradient(to right, transparent, var(--bg) 55%); }
.cat-arrow-left { left: -4px; justify-content: flex-start; background: linear-gradient(to left, transparent, var(--bg) 55%); }
.cat-arrow.is-hidden { opacity: 0; pointer-events: none; }
@keyframes catNudge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
.cat-arrow-right:not(.is-hidden) i { animation: catNudge 1.6s ease-in-out 3; }

/* ---------- Store filter: all four always visible on phones ---------- */
@media (max-width: 767px) {
    .store-seg { display: grid; grid-template-columns: .95fr 1.25fr .9fr .8fr; width: 100%; gap: 2px; }
    .store-seg .seg-btn { min-width: 0; padding: 9px 4px; font-size: 13px; gap: 5px; }
    .store-seg .store-dot { width: 7px; height: 7px; margin-right: 0; }
}
@media (max-width: 360px) {
    .store-seg .seg-btn { font-size: 12px; padding: 9px 2px; gap: 4px; }
    .store-seg .store-dot { display: none; }
}
