/* Sasta Finds. Loaded after the classic site's CSS (Bootstrap + styles.css, for the shared navbar and footer), so
   everything is scoped to .tool (and .lb for the pop-up) and avoids Bootstrap's class names (.btn, .row, .alert,
   .badge, .progress, .card). Every control is a 38px pill so the filter panel reads as one system. */
[hidden] { display: none !important; }

body.tool-page { display: flex; flex-direction: column; min-height: 100vh; }
body.tool-page > main { flex: 1 0 auto; width: 100%; }

.tool { max-width: 1280px; margin: 0 auto; padding: 120px 1rem 2rem; --line: rgba(255, 255, 255, .14);
    --muted: rgba(255, 255, 255, .6); --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --h: 38px; }

.tool-head { text-align: center; margin-bottom: 1.8rem; }
.tool-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 400; text-transform: uppercase; margin: 0 0 .5rem; }
.tool-head .lead-line { color: var(--muted); margin: 0 auto; max-width: 46rem; }
.tool-head .status { color: var(--muted); font-size: .8rem; margin: .7rem 0 0; letter-spacing: 1.5px; text-transform: uppercase; }
.tool-head .status.bad { color: var(--bad); text-transform: none; letter-spacing: 0; }

/* ---------- Filter panel ---------- */
.tool .bar { border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 1.1rem; }
.tool .search { display: flex; align-items: center; gap: .55rem; height: var(--h); margin: 0; padding: 0 1rem; background: #000;
    border: 1px solid var(--line); border-radius: 999px; color: var(--muted); transition: border-color .2s ease, box-shadow .2s ease; }
.tool .search:focus-within { border-color: rgba(255, 255, 255, .7); box-shadow: 0 0 18px rgba(255, 255, 255, .18); }
.tool .search .bi { font-size: .95rem; }
.tool .search input { flex: 1; min-width: 0; background: none; border: 0; color: #fff; font: inherit; font-size: 14px; outline: none; }
.tool .search input::placeholder { color: rgba(255, 255, 255, .35); }
.tool .search input::-webkit-search-cancel-button { filter: invert(1); cursor: pointer; }

.tool .groups { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: flex-start; }
.tool .groups + .groups { margin-top: 1.1rem; }
.tool .group { display: flex; flex-direction: column; gap: .45rem; }
.tool .group.grow { flex: 1 1 16rem; }
.tool .group.price { flex: 1 1 14rem; max-width: 22rem; }
.tool .glabel { font-size: 10.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); margin: 0; line-height: 1; height: 11px; white-space: nowrap; }
.tool .glabel strong { color: #fff; font-weight: 400; letter-spacing: .5px; text-transform: none; font-size: 12.5px; margin-left: .35rem; }

/* Chips */
.tool .chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.tool .chip { height: var(--h); display: inline-flex; align-items: center; border: 1px solid var(--line); background: transparent; color: var(--muted);
    border-radius: 999px; padding: 0 .95rem; font: inherit; font-size: 13px; cursor: pointer; transition: box-shadow .2s ease, color .2s ease, border-color .2s ease; }
.tool .chip:hover, .tool .chip:focus-visible { color: #fff; border-color: rgba(255, 255, 255, .5); outline: none; }
.tool .chip.active { color: #000; background: #fff; border-color: #fff; }

/* Two-handle price range: two overlapping native sliders over one drawn track */
.tool .range2 { position: relative; width: 100%; min-width: 12rem; height: var(--h); }
.tool .range2 .track { position: absolute; left: 8px; right: 8px; top: 50%; height: 3px; transform: translateY(-50%); background: rgba(255, 255, 255, .18); border-radius: 3px; }
.tool .range2 .fill { position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); background: #fff; border-radius: 3px; box-shadow: 0 0 8px rgba(255, 255, 255, .5); }
.tool .range2 input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: none; pointer-events: none;
    -webkit-appearance: none; appearance: none; outline: none; }
.tool .range2 input::-webkit-slider-runnable-track { background: transparent; height: 3px; }
.tool .range2 input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; margin-top: -6.5px; border-radius: 50%;
    background: #fff; border: 0; cursor: pointer; box-shadow: 0 0 0 2px #000; }
.tool .range2 input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px #000, 0 0 12px #fff; }
.tool .range2 input::-moz-range-track { background: transparent; height: 3px; }
.tool .range2 input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; cursor: pointer; box-shadow: 0 0 0 2px #000; }

/* Selects: native element, own chevron */
.tool .sel { position: relative; }
.tool .sel select { -webkit-appearance: none; appearance: none; height: var(--h); min-width: 10rem; max-width: 15rem; padding: 0 2.4rem 0 1rem; margin: 0;
    background: #000; color: #fff; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer;
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden; transition: border-color .2s ease; }
.tool .sel select:hover { border-color: rgba(255, 255, 255, .5); }
.tool .sel select:focus { outline: none; border-color: rgba(255, 255, 255, .7); }
.tool .sel::after { content: ""; position: absolute; right: 1.05rem; top: 50%; width: .5rem; height: .5rem; border-right: 1.5px solid rgba(255, 255, 255, .7);
    border-bottom: 1.5px solid rgba(255, 255, 255, .7); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.tool .sel select option { background: #000; color: #fff; }

/* On-sale switch */
.tool .switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; height: var(--h); margin: 0; cursor: pointer; color: var(--muted); font-size: 14px; }
.tool .switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tool .switch .knob { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid var(--line);
    transition: background .2s ease, box-shadow .2s ease; }
.tool .switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s ease, background .2s ease; }
.tool .switch input:checked + .knob { background: #fff; border-color: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, .5); }
.tool .switch input:checked + .knob::after { transform: translateX(16px); background: #000; }
.tool .switch input:checked ~ .stext { color: #fff; }
.tool .switch input:focus-visible + .knob { outline: 2px solid #fff; outline-offset: 2px; }
.tool .switch .n { opacity: .6; font-size: .82rem; }

/* ---------- Toolbar above the grid ---------- */
.tool .toolbar { display: flex; align-items: center; gap: 1rem; margin: 0 .2rem .9rem; min-height: 2rem; }
.tool .count { color: var(--muted); font-size: .78rem; letter-spacing: 1.5px; text-transform: uppercase; margin: 0; }
.tool .linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .85rem; text-decoration: underline;
    text-underline-offset: 3px; cursor: pointer; }
.tool .linkish:hover, .tool .linkish:focus-visible { color: #fff; outline: none; }
.tool .layout { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.tool .cols { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tool .cbtn { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.1rem; display: grid; place-items: center; cursor: pointer; }
.tool .cbtn:hover, .tool .cbtn:focus-visible { color: #000; background: #fff; outline: none; }
.tool .cbtn:disabled { opacity: .3; cursor: default; background: transparent; color: var(--muted); }
.tool .cval { min-width: 1.6rem; text-align: center; font-size: 12.5px; color: #fff; }
.tool .cval::after { content: " / row"; color: var(--muted); }
.tool .view { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tool .vbtn { height: 28px; display: inline-flex; align-items: center; gap: .25rem; padding: 0 .8rem; border: 0; border-radius: 999px; background: transparent;
    color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; transition: color .2s ease; }
.tool .vbtn .bi { font-size: 1rem; }
.tool .vbtn:hover, .tool .vbtn:focus-visible { color: #fff; outline: none; }
.tool .vbtn.active { background: #fff; color: #000; }

/* ---------- Grid of finds ---------- */
.tool .grid { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: .9rem; }
.tool .grid.dense { gap: .6rem; }
.tool .grid.dense .title { font-size: .78rem; }
.tool .grid.dense .price b { font-size: .92rem; }
.tool .find { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px;
    overflow: hidden; background: #000; transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease; }
.tool .find:hover, .tool .find:focus-within { border-color: rgba(255, 255, 255, .5); box-shadow: 0 10px 30px rgba(255, 255, 255, .35); transform: translateY(-3px); }
.tool .find .go { display: flex; flex-direction: column; flex: 1; color: #fff; text-decoration: none; }
.tool .find .go:hover, .tool .find .go:focus-visible { color: #fff; text-decoration: none; outline: none; }
.tool .pic { position: relative; aspect-ratio: 1; background: #141414; overflow: hidden; }
.tool .pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.tool .find:hover .pic img { transform: scale(1.04); }
.tool .pic .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .25); font-size: 2rem; }
.tool .off { position: absolute; top: .5rem; left: .5rem; background: #fff; color: #000; font-size: 11.5px; letter-spacing: 1px;
    border-radius: 999px; padding: .15rem .5rem; }
.tool .from { position: absolute; bottom: .5rem; left: .5rem; right: .5rem; display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.tool .from span { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); color: #fff; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase;
    border-radius: 999px; padding: .15rem .5rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool .body { padding: .65rem .75rem .75rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.tool .title { font-size: .86rem; line-height: 1.3; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool .price { margin-top: auto; display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.tool .price b { font-weight: 700; font-size: 1.02rem; }
.tool .price s { color: var(--muted); font-size: .8rem; }
.tool .meta { color: var(--muted); font-size: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; margin: 0; }
.tool .meta .bi-star-fill { color: var(--warn); font-size: .7rem; }
/* Quick look button, shown on hover (always on touch screens) */
.tool .peek { position: absolute; top: .5rem; right: .5rem; width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7);
    color: #fff; display: grid; place-items: center; font-size: .95rem; cursor: pointer; opacity: 0; transition: opacity .2s ease, box-shadow .2s ease; backdrop-filter: blur(4px); }
.tool .find:hover .peek, .tool .peek:focus-visible { opacity: 1; outline: none; }
.tool .peek:hover, .tool .peek:focus-visible { box-shadow: 0 0 14px rgba(255, 255, 255, .7); background: #fff; color: #000; }
@media (hover: none) { .tool .peek { opacity: 1; } }

.tool .empty { color: var(--muted); text-align: center; padding: 3rem 1rem; margin: 0; }
.tool .more { text-align: center; margin: 1.5rem 0; }
.tool .more:empty { display: none; }
.tool .tbtn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; margin: 0; padding: .6rem 1.4rem;
    border: 1px solid #fff; border-radius: 999px; background: transparent; color: #fff; font: inherit; font-size: 13px;
    letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: box-shadow .3s ease; }
.tool .tbtn:hover, .tool .tbtn:focus-visible { box-shadow: 0 0 22px rgba(255, 255, 255, .45); outline: none; }

/* Pager (Pages mode) */
.tool .pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem; margin: 1.6rem 0 .5rem; }
.tool .pager button { min-width: 38px; height: var(--h); padding: 0 .7rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted);
    font: inherit; font-size: 13.5px; cursor: pointer; transition: box-shadow .2s ease, color .2s ease; }
.tool .pager button:hover, .tool .pager button:focus-visible { color: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, .35); outline: none; }
.tool .pager button.cur { background: #fff; color: #000; border-color: #fff; }
.tool .pager button:disabled { opacity: .3; cursor: default; box-shadow: none; }
.tool .pager .dots { color: var(--muted); padding: 0 .3rem; }

/* ---------- Quick look lightbox: the image floats large on a dark backdrop, a slim strip of facts under it ---------- */
body.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: rgba(0, 0, 0, .93); backdrop-filter: blur(10px); color: #fff;
    animation: lb-in .18s ease-out; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-close, .lb-nav { position: absolute; z-index: 2; width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .55);
    color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 1.1rem; transition: box-shadow .2s ease, background .2s ease; }
.lb-close { top: 1.1rem; right: 1.2rem; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 1.2rem; } .lb-nav.next { right: 1.2rem; }
.lb-close:hover, .lb-nav:hover, .lb-close:focus-visible, .lb-nav:focus-visible { background: #fff; color: #000; box-shadow: 0 0 22px rgba(255, 255, 255, .5); outline: none; }
.lb-nav:disabled { opacity: .2; cursor: default; box-shadow: none; background: rgba(0, 0, 0, .55); color: #fff; }
.lb-stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; padding: 4.5rem 5.5rem 0; overflow: hidden; }
.lb-pic { position: relative; max-width: 100%; min-height: 0; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); animation: lb-pic .25s ease-out; }
.lb-pic img:first-child { display: block; max-width: 100%; max-height: calc(100vh - 300px); object-fit: contain; border-radius: 8px; background: #111; } /* JS refines max-height to the real free space */
/* The large variant loads into this layer and fades in over the thumbnail (same picture, so no jump) */
.lb-pic .hi { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.lb-pic .hi.on { opacity: 1; }
@keyframes lb-pic { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lb-thumbs { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.lb-thumbs:empty { display: none; }
.lb-thumbs button { width: 48px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; opacity: .55; transition: opacity .2s ease; }
.lb-thumbs button.on, .lb-thumbs button:hover { opacity: 1; border-color: #fff; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-bar { flex: none; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.1rem 5.5rem 1.6rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 2.5rem; }
.lb-text { min-width: 0; flex: 1 1 auto; }
.lb-from { display: block; font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255, 255, 255, .55); margin-bottom: .35rem; }
.lb h2 { font-size: 1.25rem; line-height: 1.3; margin: 0; font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lb-desc { margin: .4rem 0 0; color: rgba(255, 255, 255, .6); font-size: .86rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lb-when { margin: .55rem 0 0; color: rgba(255, 255, 255, .4); font-size: .74rem; letter-spacing: .3px; }
.lb-desc:empty, .lb-when:empty, .lb-meta:empty { display: none; }
.lb-buy { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; text-align: right; }
.lb-price { margin: 0; font-size: 1.5rem; white-space: nowrap; }
.lb-price b { font-weight: 700; }
.lb-price s { color: rgba(255, 255, 255, .5); font-size: .95rem; margin-left: .4rem; }
.lb-price .off { position: static; margin-left: .5rem; vertical-align: middle; }
.lb-meta { margin: 0; color: rgba(255, 255, 255, .55); font-size: .82rem; }
.lb-meta .bi-star-fill { color: #fbbf24; font-size: .72rem; }
/* The lightbox sits outside <main class="tool">, so the button style is repeated here */
.lb .tbtn { margin-top: .5rem; display: inline-flex; align-items: center; gap: .45rem; padding: .62rem 1.4rem; border: 1px solid #fff; border-radius: 999px;
    background: #fff; color: #000; font: inherit; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; white-space: nowrap;
    transition: box-shadow .3s ease; }
.lb .tbtn:hover, .lb .tbtn:focus-visible { box-shadow: 0 0 24px rgba(255, 255, 255, .6); outline: none; color: #000; text-decoration: none; }
@media (max-width: 767.98px) {
    .lb { overflow: auto; }
    .lb-stage { flex: none; padding: 4rem .75rem 0; }
    .lb-pic img:first-child { max-height: 52vh; }
    .lb-nav { top: 30vh; width: 2.4rem; height: 2.4rem; }
    .lb-nav.prev { left: .5rem; } .lb-nav.next { right: .5rem; }
    .lb-close { top: .8rem; right: .8rem; }
    .lb-bar { flex-direction: column; gap: .8rem; padding: 1rem 1.1rem 1.6rem; }
    .lb-buy { align-items: flex-start; text-align: left; }
    .lb-price { font-size: 1.3rem; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) { .tool { padding-top: 96px; } }
@media (max-width: 767.98px) {
    .tool .groups { gap: .9rem 1.2rem; }
    .tool .group.grow, .tool .group.price { flex-basis: 100%; max-width: none; }
    .tool .sel select { min-width: 9rem; }
}
@media (max-width: 575.98px) {
    .tool .grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .tool .bar { padding: .9rem .9rem 1rem; border-radius: 16px; }
    .tool .group { width: 100%; }
    .tool .sel, .tool .sel select { width: 100%; max-width: none; }
    .tool .toolbar { flex-wrap: wrap; gap: .5rem .9rem; }
    .tool .layout { margin-left: 0; width: 100%; }
    .tool .cols { display: none; } /* phones always get 2 per row */
    .tool .body { padding: .5rem .55rem .6rem; }
    .tool .title { font-size: .8rem; }
}
