/* Buyfo deals / category / search pages (2026 clean design) — on top of core.css */
.dl { padding-top: 22px; padding-bottom: 28px; }
.dl-404 { padding: 64px 16px; text-align: center; }
.dl-404 p { color: var(--c-muted); margin: 8px 0 22px; }
.dl-head h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.dl-head h1 em { font-style: normal; color: var(--c-brand); }
.dl-head p { margin: 6px 0 0; max-width: 760px; color: var(--c-muted); font-size: 14.5px; }
.dl-head p strong { color: var(--c-text); font-weight: 600; }

.dl-cats { display: flex; gap: 8px; margin: 18px 0 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dl-cats::-webkit-scrollbar { display: none; }
@media (max-width: 640px) { .dl-cats { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; } }

.dl-bar { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; }
.dl-ftog { height: 40px; padding: 0 14px; font-size: 14px; }
.dl-ftog b { min-width: 20px; height: 20px; border-radius: 999px; background: var(--c-fill); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.dl-count { color: var(--c-muted); font-size: 14px; }
.dl-count b { color: var(--c-text); }
.dl-sort { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--c-muted); }
.dl-sort select { height: 40px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--c-line); background: var(--c-surface); font-weight: 600; font-size: 14px; cursor: pointer; max-width: 190px; }
@media (max-width: 520px) { .dl-sort span { display: none; } .dl-count { display: none; } }

.dl-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.dl-af { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--c-brand-soft); color: var(--c-brand-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.dl-af:hover { background: color-mix(in srgb, var(--c-brand) 22%, var(--c-surface)); }
.dl-clear { margin-left: 4px; font-size: 13px; color: var(--c-muted); font-weight: 600; }

/* layout: filters + results */
.dl-layout { display: grid; gap: 24px; margin-top: 18px; align-items: start; }
@media (min-width: 1000px) {
  .dl-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .dl-ftog { display: none; }
  .dl-main .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1240px) { .dl-main .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.dl-side { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; }
@media (min-width: 1000px) { .dl-side { position: sticky; top: calc(var(--hdr-h) + 16px); max-height: calc(100vh - var(--hdr-h) - 32px); display: flex; flex-direction: column; } }
.dl-side-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; border-bottom: 1px solid var(--c-line); font-size: 15px; }
.dl-side-h .hbtn { display: none; }
.dl-side-b { padding: 4px 14px 14px; overflow-y: auto; }
.dl-side-f { display: none; }
.dl-fg { padding-top: 14px; }
.dl-fg + .dl-fg { border-top: 1px solid var(--c-line); margin-top: 12px; }
.dl-fg h3 { margin: 0 0 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
.dl-check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--c-text); text-decoration: none; }
.dl-check i { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--c-faint); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.dl-check.on i { background: var(--c-fill); border-color: var(--c-fill); }
.dl-check.on i::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.dl-check small { margin-left: auto; color: var(--c-faint); font-size: 12.5px; }
.dl-check:hover { color: var(--c-brand); }
.dl-brands { max-height: 240px; overflow-y: auto; }
.dl-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-pills .chip { height: 32px; padding: 0 11px; font-size: 13px; }
.dl-price { display: flex; gap: 6px; margin-top: 10px; }
.dl-price input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--c-line); background: var(--c-soft); font-size: 14px; }
.dl-price .btn-s { height: 38px; padding: 0 12px; }

/* phones: filters become a slide-up sheet */
.dl-backdrop { display: none; }
@media (max-width: 999px) {
  .dl-side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 130; max-height: 86vh; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; border: 0; box-shadow: 0 -12px 40px rgba(15, 23, 42, .25); transform: translateY(105%); transition: transform .25s ease; padding-bottom: env(safe-area-inset-bottom); }
  body.sheet-open .dl-side { transform: none; }
  .dl-side-h .hbtn { display: inline-flex; }
  .dl-side-f { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--c-line); }
  .dl-side-f .btn-p { flex: 1; }
  .dl-backdrop { position: fixed; inset: 0; z-index: 125; background: rgba(15, 23, 42, .45); }
  body.sheet-open .dl-backdrop { display: block; }
  body.sheet-open { overflow: hidden; }
}

/* empty + pagination + popular links */
.dl-empty { text-align: center; padding: 48px 20px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 18px; color: var(--c-muted); }
.dl-empty .ico { color: var(--c-faint); }
.dl-empty h2 { margin: 10px 0 4px; color: var(--c-text); font-size: 20px; }
.dl-empty p { margin: 0 auto 18px; max-width: 460px; }
.dl-pages { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.dl-pages a, .dl-pages span { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--c-text); }
.dl-pages a { border: 1px solid var(--c-line); background: var(--c-surface); }
.dl-pages a:hover { border-color: var(--c-brand); color: var(--c-brand); }
.dl-pages a.on { background: var(--c-text); color: var(--c-surface); border-color: var(--c-text); }
.dl-pages span { color: var(--c-faint); }
.ico.flip { transform: rotate(180deg); }
.dl-pop { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--c-line); }
.dl-pop h2 { margin: 0 0 10px; font-size: 15px; font-weight: 800; }
.dl-pop div { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.dl-pop a { color: var(--c-muted); font-size: 13.5px; text-decoration: none; }
.dl-pop a:hover { color: var(--c-brand); }
.dl-popular-h { margin-top: 30px; }

/* ---------- search within deals ---------- */
.dl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.dl-head > div { min-width: 0; flex: 1 1 420px; }
.dl-q { position: relative; display: flex; align-items: center; flex: 0 1 380px; }
.dl-q .ico { position: absolute; left: 13px; color: var(--c-faint); pointer-events: none; }
.dl-q input[type=search] { width: 100%; height: 44px; padding: 0 96px 0 38px; border-radius: 12px; border: 1px solid var(--c-line); background: var(--c-surface); font-size: 15px; outline: none; }
.dl-q input[type=search]:focus { border-color: var(--c-brand); box-shadow: 0 0 0 4px var(--c-brand-soft); }
.dl-q .btn-p { position: absolute; right: 4px; height: 36px; padding: 0 14px; font-size: 14px; }
@media (max-width: 640px) { .dl-q { flex-basis: 100%; } .dl-q input[type=search] { font-size: 16px; } }

/* ---------- category filter (grouped, collapsible) ---------- */
.dl-fg h3 { display: flex; align-items: center; justify-content: space-between; }
.dl-fg-clear { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--c-brand); font-weight: 700; text-decoration: none; }
.dl-grp { border-bottom: 1px solid var(--c-line); }
.dl-grp:last-child { border-bottom: 0; }
.dl-grp summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 0; font-size: 14px; font-weight: 700; cursor: pointer; }
.dl-grp summary::-webkit-details-marker { display: none; }
.dl-grp summary b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--c-fill); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.dl-grp summary small { margin-left: auto; color: var(--c-faint); font-weight: 600; font-size: 12.5px; }
.dl-grp summary .ico { color: var(--c-faint); transform: rotate(90deg); transition: transform .2s; }
.dl-grp[open] summary .ico { transform: rotate(-90deg); }
.dl-grp .dl-check { padding-left: 4px; }
.dl-grp > .dl-check:last-child { margin-bottom: 8px; }

/* ---------- hub: one band per category ---------- */
.hb { margin-top: 22px; padding: 18px; border-radius: 20px; background: var(--c-surface); border: 1px solid var(--c-line); }
.hb.is-lowest { background: linear-gradient(180deg, var(--c-brand-soft), var(--c-surface) 140px); border-color: color-mix(in srgb, var(--c-brand) 30%, var(--c-line)); }
.hb-h { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hb-stat { flex: 0 0 auto; padding: 8px 14px; border-radius: 12px; background: var(--c-fill); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.hb-t { flex: 1 1 200px; min-width: 0; }
.hb-t h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.hb-t p { margin: 1px 0 0; font-size: 13px; color: var(--c-muted); }
.hb-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--c-brand); text-decoration: none; white-space: nowrap; }
.hb-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.hb-links a { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--c-soft); color: var(--c-muted); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.hb-links a:hover { color: var(--c-brand); background: var(--c-brand-soft); }
.hb-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 46%); gap: 10px; margin-top: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.hb-row::-webkit-scrollbar { display: none; }
.hb-row > * { scroll-snap-align: start; }
@media (min-width: 640px) { .hb-row { grid-auto-columns: minmax(170px, 31%); } }
@media (min-width: 1000px) { .hb-row { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; overflow: visible; } }
@media (max-width: 640px) { .hb { padding: 14px; margin-left: -6px; margin-right: -6px; } .hb-stat { font-size: 13.5px; padding: 6px 11px; } .hb-t h2 { font-size: 18px; } .hb-all { order: 3; } }
.hb-more { text-align: center; margin-top: 26px; }
.dl-head.is-hub h1 { font-size: clamp(26px, 4.4vw, 38px); }

/* ---------- category strip: photo tiles ---------- */
.ct-wrap { position: relative; margin: 20px 0 0; }
.ct { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 2px 6px; }
.ct::-webkit-scrollbar { display: none; }
.ct-tile { flex: 0 0 auto; width: 96px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 10px; border-radius: 16px; text-decoration: none; color: var(--c-text); text-align: center; transition: background .15s, transform .15s; }
.ct-tile:hover { background: var(--c-surface); transform: translateY(-2px); }
.ct-img { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 1px solid var(--c-line); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 6px; box-shadow: 0 2px 8px rgba(15, 23, 42, .06); transition: border-color .15s, box-shadow .15s; }
.ct-img img { width: 50px; height: 50px; object-fit: contain; }
.ct-all { background: var(--c-brand-soft); color: var(--c-brand); border-color: transparent; }
.ct-ltr { font-size: 24px; font-weight: 800; color: var(--c-faint); }
.ct-tile b { font-size: 13px; font-weight: 600; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-tile small { font-size: 11.5px; color: var(--c-faint); }
.ct-tile.on { background: var(--c-surface); box-shadow: inset 0 -3px 0 var(--c-logo); }
.ct-tile.on .ct-img { border: 2.5px solid var(--c-brand); box-shadow: 0 0 0 4px var(--c-brand-soft); }
.ct-tile.on b { color: var(--c-brand); font-weight: 800; }
.ct-tile.on small { color: var(--c-brand); }
/* arrows + fade edges (desktop); swipe on phones */
.ct-arrow { display: none; }
@media (hover: hover) and (min-width: 768px) {
  .ct-arrow { display: flex; position: absolute; top: 34px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-text); align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--c-shadow-lg); transition: opacity .2s; }
  .ct-arrow.prev { left: -14px; } .ct-arrow.next { right: -14px; }
  .ct-arrow[disabled] { opacity: 0; pointer-events: none; }
  .ct-wrap::before, .ct-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 1; pointer-events: none; transition: opacity .2s; }
  .ct-wrap::before { left: 0; background: linear-gradient(90deg, var(--c-bg), transparent); }
  .ct-wrap::after { right: 0; background: linear-gradient(-90deg, var(--c-bg), transparent); }
  .ct-wrap.at-start::before, .ct-wrap.at-end::after { opacity: 0; }
}
@media (max-width: 640px) { .ct { margin: 0 -16px; padding-left: 12px; padding-right: 12px; } .ct-tile { width: 84px; } .ct-img { width: 58px; height: 58px; } .ct-img img { width: 44px; height: 44px; } }
@media (min-width: 1000px) { .ct-tile { width: 108px; } .ct-img { width: 74px; height: 74px; } .ct-img img { width: 58px; height: 58px; } .ct-tile b { font-size: 13.5px; } .ct-arrow { top: 38px; } }
.dl-head p a { color: var(--c-brand); }
.srch-filter { margin: 10px 0 0; }
.srch-filter .chip { display: inline-flex; align-items: center; gap: 8px; }
.srch-filter .chip a { color: var(--c-muted); text-decoration: none; font-weight: 700; }
