/* WootFind — palette inspired by Woot.com (lime + deep green), Figtree type */
:root {
  --lime: #58cd5d;
  --lime-2: #7ddc80;
  --lime-soft: #e9f8e9;
  --forest: #05413a;
  --forest-2: #0a5c52;
  --ink: #121212;
  --ink-2: #3d4242;
  --muted: #6b7070;
  --line: #e3e6e6;
  --bg: #f4f6f4;
  --card: #ffffff;
  --red: #9e182d;
  --red-soft: #fbe9ec;
  --yellow: #fff261;
  --orange: #ffb100;
  --link: #297a94;
  --prime: #1a8cd8;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --radius: 14px;
  --font: "Figtree", Helvetica, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --lime-soft: #15301a;
  --ink: #eef2ee;
  --ink-2: #c8cfcb;
  --muted: #95a09b;
  --line: #2a3330;
  --bg: #0f1412;
  --card: #18201d;
  --red-soft: #3a1820;
  --link: #6cc3dd;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lime-soft: #15301a; --ink: #eef2ee; --ink-2: #c8cfcb; --muted: #95a09b; --line: #2a3330;
    --bg: #0f1412; --card: #18201d; --red-soft: #3a1820; --link: #6cc3dd;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 8px 30px rgba(0,0,0,.5); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); font-weight: 500; }
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
button, input, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.hp { position: absolute !important; left: -9999px !important; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 800; cursor: pointer; text-decoration: none !important; transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-2); }
.btn-buy { background: var(--lime); color: var(--forest); width: 100%; }
.btn-buy:hover { background: var(--lime-2); box-shadow: 0 2px 10px rgba(88,205,93,.4); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-xl { padding: 14px 24px; font-size: 1.05rem; }
.linkbtn { background: none; border: 0; color: var(--link); cursor: pointer; padding: 0; font-weight: 700; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.iconbtn:hover { background: rgba(0,0,0,.08); }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--forest); color: #fff; font-size: .75rem; }

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--lime); color: var(--forest); box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--forest); text-decoration: none !important; flex: none; }
.logo-word { font-size: 1.45rem; font-weight: 900; letter-spacing: -.03em; color: var(--forest); }
.logo-word b { font-weight: 900; color: #fff; text-shadow: 0 1px 0 rgba(5,65,58,.35); }
.logo-footer .logo-word b { color: var(--lime); text-shadow: none; }
.searchbox { flex: 1; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 4px 4px 4px 14px; box-shadow: inset 0 0 0 2px rgba(5,65,58,.12); max-width: 760px; }
.searchbox:focus-within { box-shadow: inset 0 0 0 2px var(--forest), 0 0 0 4px rgba(255,255,255,.4); }
.searchbox .ico { color: #6b7070; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 8px 0; color: #121212; font-weight: 600; }
.searchbox input::placeholder { color: #8a8f8f; font-weight: 500; }
.kbd { font: 700 .75rem var(--font); color: #8a8f8f; border: 1.5px solid #d8dcdc; border-radius: 6px; padding: 0 6px; }
.btn-search { background: var(--forest); color: #fff; padding: 8px 18px; }
.top-actions { display: flex; gap: 2px; margin-left: auto; }
.badge-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 999px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.catbar { background: var(--forest); }
.catbar-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; height: 40px; align-items: center; }
.catbar-inner::-webkit-scrollbar { display: none; }
.catbar a { color: #e6f6e6; font-weight: 700; font-size: .9rem; padding: 6px 12px; border-radius: 999px; white-space: nowrap; text-decoration: none; }
.catbar a:hover, .catbar a.on { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 400px at 80% -10%, rgba(255,242,97,.35), transparent 60%), linear-gradient(180deg, var(--lime) 0%, #8fe092 100%); color: var(--forest); padding: 48px 0 56px; }
:root[data-theme="dark"] .hero { background: linear-gradient(180deg, #1d4d22 0%, #0f1412 100%); color: #eaf7ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: linear-gradient(180deg, #1d4d22 0%, #0f1412 100%); color: #eaf7ea; } }
.hero-inner { text-align: center; max-width: 860px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.55); padding: 6px 14px; border-radius: 999px; margin: 0 0 18px; }
:root[data-theme="dark"] .eyebrow { background: rgba(255,255,255,.08); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(158,24,45,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(158,24,45,0); } 100% { box-shadow: 0 0 0 0 rgba(158,24,45,0); } }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-weight: 900; letter-spacing: -.03em; margin-bottom: 12px; }
.hero .hl { background: linear-gradient(transparent 62%, var(--yellow) 62%); padding: 0 4px; }
:root[data-theme="dark"] .hero .hl { background: none; color: var(--lime); }
.lede { font-size: 1.15rem; max-width: 620px; margin: 0 auto 26px; color: inherit; opacity: .9; }
.hero-search { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: var(--shadow-lg); max-width: 680px; margin: 0 auto; }
.hero-search .ico { color: #6b7070; width: 22px; height: 22px; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 1.15rem; font-weight: 600; padding: 10px 0; color: #121212; background: transparent; }
.hero-search .btn { padding: 14px 26px; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chips a, .chips button { background: rgba(255,255,255,.7); color: var(--forest); border: 0; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none; }
.chips a:hover, .chips button:hover { background: #fff; }
.chips a small { opacity: .65; font-weight: 600; margin-left: 4px; }
:root[data-theme="dark"] .chips a, :root[data-theme="dark"] .chips button { background: rgba(255,255,255,.1); color: #e8f5e8; }
/* Same dark treatment when dark mode comes from the OS setting rather than the site toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eyebrow { background: rgba(255,255,255,.08); }
  :root:not([data-theme="light"]) .hero .hl { background: none; color: var(--lime); }
  :root:not([data-theme="light"]) .chips a, :root:not([data-theme="light"]) .chips button { background: rgba(255,255,255,.1); color: #e8f5e8; }
  :root:not([data-theme="light"]) .tag-time,
  :root:not([data-theme="light"]) .tag-cond,
  :root:not([data-theme="light"]) .fcat.on,
  :root:not([data-theme="light"]) .seg button.on,
  :root:not([data-theme="light"]) .verdict.good { color: var(--lime); }
  :root:not([data-theme="light"]) .notice { background: #3a3510; color: #f3e9a4; }
  :root:not([data-theme="light"]) .ended-banner { color: #ffb3c0; }
  :root:not([data-theme="light"]) .save { color: #ff8fa3; }
  :root:not([data-theme="light"]) .countdown { background: #3a2a0a; color: #ffcf73; }
  :root:not([data-theme="light"]) .chart .line { stroke: var(--lime); }
}

.wootoff { background: var(--yellow); color: #121212; padding: 10px 0; font-weight: 600; text-align: center; }
.wootoff a { color: var(--red); font-weight: 800; }

/* ---------- Home sections ---------- */
.home { padding-top: 28px; padding-bottom: 20px; }
.section { margin: 0 0 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 1.45rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head .emoji { font-size: 1.3rem; }
.section-head a { font-weight: 800; white-space: nowrap; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; border: 1.5px solid transparent; transition: border-color .15s, transform .15s; }
.cat-tile:hover { border-color: var(--lime); transform: translateY(-2px); }
.cat-tile .ce { font-size: 1.6rem; }
.cat-tile b { font-weight: 800; }
.cat-tile span { color: var(--muted); font-size: .85rem; }
.grid-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); overflow-x: auto; gap: 14px; padding-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.grid-row > * { scroll-snap-align: start; }
@media (min-width: 1100px) { .grid-row { grid-auto-columns: calc((100% - 5 * 14px) / 6); } }

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.sk-card { height: 360px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--line) 50%, var(--card) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .15s, transform .15s; min-width: 0; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-media { position: relative; display: block; aspect-ratio: 1; background: #fff; padding: 12px; }
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.noimg { width: 100%; height: 100%; border-radius: 10px; background: var(--lime-soft) url("../img/logo-mark.svg") center/30% no-repeat; opacity: .7; }
.noimg.big { aspect-ratio: 1; }
.card-tags { position: absolute; top: 8px; left: 8px; right: 44px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; line-height: 1.3; white-space: nowrap; }
.tag-off { background: var(--red); color: #fff; }
.tag-lg { position: absolute; top: 12px; left: 12px; font-size: .95rem; padding: 6px 12px; }
.tag-time { background: var(--lime-soft); color: var(--forest); }
.tag-time.soon { background: #fff1d6; color: #8a5300; }
:root[data-theme="dark"] .tag-time { color: var(--lime); }
.tag-sold { background: #333; color: #fff; }
.tag-drop { background: var(--yellow); color: #121212; }
.tag-low { background: var(--forest); color: #fff; }
.tag-hot { background: #ffe1d6; color: #9a2c00; }
.tag-new { background: #e1f1ff; color: #0b5394; }
.tag-cond { background: var(--lime-soft); color: var(--forest); }
.tag-wootoff { background: var(--yellow); color: #121212; }
.tag-prime { background: #e1f1ff; color: #0b5394; }
.tag-app { background: #efe6ff; color: #5b2ca8; }
:root[data-theme="dark"] .tag-cond { color: var(--lime); }
.watch { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 999px; background: rgba(255,255,255,.92); border: 0; display: grid; place-items: center; cursor: pointer; color: #6b7070; box-shadow: 0 1px 4px rgba(0,0,0,.12); z-index: 2; }
.watch svg { width: 18px; height: 18px; }
.watch:hover { color: var(--red); }
.watch.on { color: var(--red); }
.watch.on svg { fill: currentColor; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.cond { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title { font-size: .95rem; font-weight: 700; margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-title a { color: var(--ink); }
.card-title mark { background: rgba(255,242,97,.7); color: inherit; border-radius: 2px; }
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.price { font-size: 1.25rem; font-weight: 900; color: var(--ink); letter-spacing: -.01em; }
.list { color: var(--muted); font-size: .85rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.card .btn-buy { margin-top: 4px; padding: 9px 12px; }
.card.is-sold .card-media img { opacity: .45; filter: grayscale(.6); }
.card.is-sold .btn-buy { background: var(--line); color: var(--muted); }

/* list view */
.grid.list { grid-template-columns: 1fr; gap: 10px; }
.grid.list .card { flex-direction: row; }
.grid.list .card-media { width: 150px; flex: none; aspect-ratio: auto; }
.grid.list .card-body { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 16px; }
.grid.list .card-title { flex: 1 1 320px; -webkit-line-clamp: 2; min-height: 0; font-size: 1.02rem; }
.grid.list .cond { flex-basis: 100%; }
.grid.list .price-row { margin: 0; flex: none; }
.grid.list .card-meta { flex: none; }
.grid.list .btn-buy { width: auto; flex: none; margin: 0; }
@media (max-width: 640px) {
  .grid.list .card-media { width: 110px; }
  .grid.list .card-body { flex-direction: column; align-items: stretch; }
  .grid.list .card-title { flex: none; }
}

/* ---------- Search layout ---------- */
.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding-top: 22px; padding-bottom: 40px; align-items: start; }
.filters { position: sticky; top: 120px; max-height: calc(100vh - 136px); overflow-y: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; scrollbar-width: thin; }
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.filters-head h2 { font-size: 1.1rem; margin: 0; }
.filters-close { display: none; }
.fgroup { border-top: 1px solid var(--line); padding: 14px 0; }
.fgroup h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.fcats { display: flex; flex-direction: column; gap: 2px; }
.fcat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; font-weight: 600; color: var(--ink); }
.fcat:hover { background: var(--bg); }
.fcat.on { background: var(--lime-soft); color: var(--forest); font-weight: 800; }
:root[data-theme="dark"] .fcat.on { color: var(--lime); }
.fcat span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.fsubs { padding-left: 12px; display: flex; flex-direction: column; border-left: 2px solid var(--line); margin: 2px 0 6px 10px; }
.fsubs .fcat { font-size: .88rem; padding: 4px 8px; }
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs label { display: flex; align-items: center; flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 8px; background: var(--bg); }
.price-inputs label span { color: var(--muted); }
.price-inputs input { width: 100%; border: 0; background: transparent; padding: 8px 4px; outline: 0; }
.price-inputs .dash { color: var(--muted); font-size: .85rem; }
.chips-sm { justify-content: flex-start; margin-top: 10px; gap: 6px; }
.chips-sm button { background: var(--bg); color: var(--ink); font-size: .8rem; padding: 4px 10px; border: 1.5px solid var(--line); }
.chips-sm button.on { background: var(--lime-soft); border-color: var(--lime); color: var(--forest); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 8px; padding: 6px 4px; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--forest); box-shadow: var(--shadow); }
:root[data-theme="dark"] .seg button.on { color: var(--lime); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.checks input { width: 18px; height: 18px; accent-color: var(--forest); }

.results-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.count { margin: 0; font-weight: 700; color: var(--ink-2); flex: 1; }
.count b { color: var(--ink); }
.results-tools { display: flex; gap: 8px; align-items: center; }
.sort select { appearance: none; border: 1.5px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7070' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center/16px no-repeat; border-radius: 999px; padding: 8px 36px 8px 14px; font-weight: 700; cursor: pointer; }
.viewtoggle { display: flex; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 2px; }
.viewtoggle button { border: 0; background: none; width: 34px; height: 32px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.viewtoggle button.on { background: var(--lime-soft); color: var(--forest); }
.viewtoggle svg { width: 16px; height: 16px; }
.filters-open { display: none; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.active-chips:empty { display: none; }
.achip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .85rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.achip:hover { border-color: var(--red); }
.achip svg { width: 14px; height: 14px; }
.notice { background: #fff8d6; color: #5c4a00; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600; }
:root[data-theme="dark"] .notice { background: #3a3510; color: #f3e9a4; }
.empty { text-align: center; padding: 48px 16px; }
.empty img { margin: 0 auto 12px; }
.more { display: flex; justify-content: center; padding: 24px 0 8px; }

/* ---------- Alerts CTA ---------- */
.alert-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; justify-content: space-between; background: var(--forest); color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-top: 28px; }
.alert-cta h2 { font-size: 1.3rem; margin-bottom: 4px; }
.alert-cta p { margin: 0; opacity: .85; }
.alert-form { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 380px; justify-content: flex-end; }
.alert-form input { flex: 1 1 160px; min-width: 0; border: 0; border-radius: 999px; padding: 11px 16px; color: #121212; background: #fff; }
.alert-form input[name="max_price"] { flex: 0 1 150px; }
.alert-form .btn-primary { background: var(--lime); color: var(--forest); }
.alert-form .btn-primary:hover { background: var(--lime-2); }
.form-msg { flex-basis: 100%; margin: 0; font-weight: 700; }
.saved-email { flex-basis: 100%; margin: 0; font-size: .82rem; opacity: .8; text-align: right; }
.saved-email .linkbtn { color: inherit; font-size: inherit; text-decoration: underline; }
.form-error { color: var(--red); font-weight: 700; }

/* ---------- Deal page ---------- */
.deal { padding-top: 18px; padding-bottom: 40px; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: .9rem; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.ended-banner { background: var(--red-soft); color: var(--red); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
:root[data-theme="dark"] .ended-banner { color: #ffb3c0; }
.deal-top { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.gallery-main { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; aspect-ratio: 1; display: grid; place-items: center; }
.gallery-main img { max-height: 100%; width: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: none; width: 72px; height: 72px; border-radius: 10px; border: 2px solid transparent; background: #fff; padding: 4px; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.on { border-color: var(--lime); }
.deal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.deal-tags .tag { font-size: .8rem; padding: 4px 10px; }
.deal-title { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 900; }
.deal-sub { color: var(--ink-2); font-size: 1.05rem; margin-top: -4px; }
.price-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0; }
.price-main { font-size: 2.4rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.price-was { color: var(--muted); font-weight: 600; margin-top: 4px; }
.save { color: var(--red); }
:root[data-theme="dark"] .save { color: #ff8fa3; }
.countdown { margin-top: 10px; font-weight: 700; color: #8a5300; background: #fff1d6; display: inline-block; padding: 4px 12px; border-radius: 999px; }
:root[data-theme="dark"] .countdown { background: #3a2a0a; color: #ffcf73; }
.stock { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 700; font-size: .9rem; }
.stock-bar { flex: 1; max-width: 220px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.stock-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--orange)); }
.verdict { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: .95rem; }
.verdict.good { background: var(--lime-soft); color: var(--forest); }
:root[data-theme="dark"] .verdict.good { color: var(--lime); }
.verdict.meh { background: var(--bg); color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cta-row .btn-buy { flex: 1 1 220px; width: auto; }
.watch-toggle.on { color: var(--red); border-color: var(--red); }
.fine { font-size: .8rem; color: var(--muted); margin: 12px 0 0; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.facts li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: 24px; }
.panel h2 { font-size: 1.25rem; }
.alert-inline { background: var(--forest); }
.table-wrap { overflow-x: auto; }
.variants { width: 100%; border-collapse: collapse; font-size: .95rem; }
.variants th, .variants td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.variants th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.variants .num { text-align: right; white-space: nowrap; }
.variants tr.current td { background: var(--lime-soft); }
.chart { width: 100%; height: auto; max-height: 240px; margin: 8px 0 12px; stroke: none; stroke-width: 0; }
.chart text { stroke: none; }
.chart .line { fill: none; stroke: var(--forest); stroke-width: 2.5; }
:root[data-theme="dark"] .chart .line { stroke: var(--lime); }
.chart .dot { fill: var(--lime); stroke: var(--forest); stroke-width: 2; }
.chart .gl { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .gt { fill: var(--muted); font-size: 11px; font-family: var(--font); font-weight: 600; }
.hist-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.hist-stats div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.hist-stats span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.hist-stats b { font-size: 1.2rem; }
.prose { line-height: 1.65; }
.prose h2 { margin-top: 1em; }
.prose ul { padding-left: 1.2em; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.prose code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
.page-narrow { max-width: 760px; padding-top: 40px; padding-bottom: 60px; }

/* ---------- Drawer & toast ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer.open { opacity: 1; pointer-events: auto; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--card); padding: 18px; overflow-y: auto; transform: translateX(100%); transition: transform .25s; }
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; }
.watch-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.witem { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg); }
.witem img, .witem .noimg { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; }
.witem a.t { font-weight: 700; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; }
.witem .meta { font-size: .85rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.witem.ended { opacity: .6; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 120px); background: var(--ink); color: var(--card); padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 80; transition: transform .25s; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.footer { background: var(--forest); color: #d6eedb; margin-top: 40px; padding: 32px 0 16px; }
.footer a { color: #fff; }
.footer .muted { color: #a9cfb1; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-inner > div { max-width: 360px; }
.footer .logo-word { color: #fff; }
.footer-links { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 32px; align-content: start; font-weight: 700; }
.disclosure { border-top: 1px solid rgba(255,255,255,.15); margin-top: 24px; padding-top: 16px; font-size: .8rem; color: #a9cfb1; }

/* ---------- Admin ---------- */
.admin { padding-top: 24px; padding-bottom: 40px; }
.admin-status { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: .95rem; }
.admin-status.ok { background: var(--lime-soft); }
.admin-status.bad { background: var(--red-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; }
.stat span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.stat b { font-size: 1.6rem; font-weight: 900; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.bar { flex: 1; max-width: 48px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar i { display: block; width: 100%; background: var(--lime); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar span { font-size: .6rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 20px; }
.admin-login { display: flex; gap: 8px; }
.form-ok { color: var(--forest); font-weight: 700; }
.settings-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 24px; align-items: start; }
.setting, .setting-preview { display: flex; flex-direction: column; gap: 4px; }
.setting-label { font-weight: 800; font-size: .9rem; }
.setting input { padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); }
.setting input:focus { outline: none; border-color: var(--forest); }
.setting-help { font-size: .8rem; color: var(--muted); }
.preview-bar { display: flex; align-items: center; gap: 8px; background: var(--lime); border-radius: 10px; padding: 10px 14px; }
.settings-form .btn { grid-column: 1 / -1; justify-self: start; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; position: sticky; top: 108px; z-index: 5; background: var(--bg); padding: 6px 0; }
.admin-nav a { background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: .85rem; color: var(--ink); text-decoration: none; }
.admin-nav a:hover { border-color: var(--forest); }
.pill.bad { background: var(--red); }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions .btn { padding: 7px 14px; font-size: .85rem; }
.radio { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; margin-top: 4px; }
.radio input { margin-top: 4px; accent-color: var(--forest); }
.flash { background: var(--bg); padding: 8px 12px; border-radius: 8px; word-break: break-all; }
.cmd-block { margin-top: 10px; }
.cmd-head { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; margin-bottom: 4px; }
.cmd-block pre, .log pre { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12px/1.5 Consolas, "SFMono-Regular", Menlo, monospace; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; }
.log { border-top: 1px solid var(--line); padding: 10px 0; }
.log summary { cursor: pointer; }
.log pre { margin-top: 8px; }
.manage-link-form { justify-content: flex-start; max-width: 520px; background: var(--forest); padding: 14px; border-radius: var(--radius); }
.manage-link-form .form-msg { color: #fff; }
.manage .alert-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.alert-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-left: 4px solid var(--lime); }
.alert-row.is-paused { border-left-color: var(--line); opacity: .85; }
.alert-row.is-unconfirmed { border-left-color: var(--orange); }
.alert-main { flex: 1 1 320px; min-width: 0; }
.alert-q { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; }
.alert-price { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .9rem; }
.alert-price input { width: 90px; padding: 5px 8px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); }
.alert-actions { display: flex; gap: 8px; align-items: center; }
.alert-actions .btn { padding: 7px 14px; font-size: .85rem; }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.alert-add { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-add input { flex: 1 1 200px; padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); }
.alert-add input[name="max_price"] { flex: 0 1 150px; }
.manage-all { display: flex; gap: 20px; margin-top: 18px; }
.linkbtn.danger { color: var(--red); }
.health td { vertical-align: top; }
.health .hs { width: 28px; font-size: 1.1rem; }
.health code { word-break: break-all; }
.panel h2 .tag { vertical-align: middle; margin-left: 8px; font-size: .75rem; }
.admin-login input { flex: 1; padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: fixed; inset: 0 auto 0 0; top: 0; width: min(340px, 88%); max-height: none; height: 100%; z-index: 70; border-radius: 0; transform: translateX(-105%); transition: transform .25s; }
  .filters.open { transform: none; box-shadow: var(--shadow-lg); }
  .filters-close { display: inline-grid; }
  .filters-open { display: inline-flex; }
  body.filters-locked { overflow: hidden; }
  body.filters-locked::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 65; }
  .deal-top { grid-template-columns: 1fr; gap: 16px; }
  .hist-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; gap: 8px 10px; }
  .searchbox { order: 3; flex-basis: 100%; }
  .btn-search, .kbd { display: none; }
  .logo-word { font-size: 1.3rem; }
  .hero { padding: 32px 0 36px; }
  .hero-search { padding-left: 14px; }
  .hero-search .btn { padding: 12px 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-row { grid-auto-columns: 46%; }
  .card-body { padding: 10px; }
  .price { font-size: 1.1rem; }
  .results-bar .count { flex-basis: 100%; order: 3; }
  .price-main { font-size: 2rem; }
  .alert-cta { padding: 18px; }
  .alert-form { justify-content: stretch; }
  .alert-form .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
