/* Deal page (/deals/:slug) and curated product page (/products/:slug).
   Both share one decision layout: gallery, title, price, facts, buy. Builds on css/site.css only. */

.deal { padding-bottom: 24px; }
.deal__crumbs { padding-block: 10px 8px; }
.deal__crumbs .crumbs { flex-wrap: nowrap; overflow: hidden; }
.deal__crumbs .crumbs li { white-space: nowrap; }
.deal__crumbs .crumbs li:last-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ── Above the fold ─────────────────────────────────────────────── */
.deal-top { display: grid; gap: 14px; }
@media (min-width: 900px) {
    .deal-top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 8px; }
    .deal-sum { position: sticky; top: calc(var(--header-h) + 20px); }
}

/* Gallery: a swipeable scroll-snap track; thumbnails from tablet up. */
.gallery { min-width: 0; display: grid; gap: 10px; }
.gallery__stage { position: relative; border-radius: var(--r-panel); overflow: hidden; background: var(--tray); }
.gallery__stage::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--rule); border-radius: inherit; pointer-events: none; }
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; height: min(calc(100vw - 2 * var(--gutter)), 40svh); }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track:focus-visible { outline-offset: -3px; border-radius: var(--r-panel); }
/* Photos sit on the light tray; multiply makes white-background shots read as cut-outs (also in dark mode). */
.gallery__track { background: var(--tray); }
.gallery__img { flex: 0 0 100%; width: 100%; height: 100%; padding: 6%; object-fit: contain; mix-blend-mode: multiply; filter: brightness(1.05) contrast(1.02); scroll-snap-align: center; scroll-snap-stop: always; }
.gallery__media { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; }
/* The listing video plays as recorded (no multiply: its frames aren't cut-outs). */
.gallery__video { width: 100%; height: 100%; object-fit: contain; background: var(--tray); }
.gallery__empty { flex: 1; display: grid; place-items: center; color: color-mix(in srgb, var(--soft) 40%, transparent); }
.gallery__empty .bag { width: 64px; --knock: var(--tray); }
@media (min-width: 640px) { .gallery__track { height: auto; aspect-ratio: 1; } }
/* Phones: dots on the tray hint that the photo swipes */
.gallery__dots { position: absolute; bottom: 12px; inset-inline-end: 12px; display: flex; gap: 5px; padding: 5px 7px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 55%, transparent); pointer-events: none; }
.gallery__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: background var(--d-s), width var(--d-s) var(--e-out); }
.gallery__dots i.is-on { width: 16px; border-radius: 3px; background: #fff; }
.gallery__story { position: absolute; bottom: 12px; inset-inline-start: 12px; transition: transform var(--d-s) var(--e-out); }
.gallery__story:hover { transform: translateY(-2px); }
.gallery__thumbs { display: none; }
@media (min-width: 640px) {
    .gallery__dots { display: none; }
    .gallery__thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px; }
    .gallery__thumbs::-webkit-scrollbar { display: none; }
}
.gallery__thumb { flex: none; width: 68px; height: 68px; padding: 0; border: 1.5px solid var(--rule); border-radius: 11px; overflow: hidden; background: var(--tray); transition: border-color var(--d-s); }
.gallery__thumb img { width: 100%; height: 100%; padding: 5px; object-fit: contain; mix-blend-mode: multiply; filter: brightness(1.05) contrast(1.02); }
.gallery__thumb--video { position: relative; }
.gallery__play { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; padding: 6px 5px 6px 7px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 72%, transparent); fill: #fff; }
.gallery__thumb:hover { border-color: var(--soft); }
.gallery__thumb[aria-current="true"] { border-color: var(--fg); border-width: 2px; }

/* Summary column */
.deal-sum { display: grid; gap: 12px; align-content: start; min-width: 0; }
.deal-sum__title { font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2rem); line-height: 1.2; font-weight: 700; }
.deal-sum__price { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.deal-price { color: var(--price); font-weight: 800; font-size: clamp(2rem, 8vw, 2.6rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
/* Verified price drop (DESIGN.md): the usual price rolls up, then a rule strikes it. Final state under reduced motion. */
.deal-was { position: relative; display: inline-block; text-decoration: none; color: var(--soft); font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; animation: was-roll var(--d-m) var(--e-io) both; }
.deal-was::after { content: ""; position: absolute; inset-inline: -2px; top: 52%; height: 2px; border-radius: 1px; background: currentColor; transform: scaleX(1); transform-origin: right; animation: was-strike var(--d-m) var(--e-io) var(--d-m) both; }
@keyframes was-roll { from { transform: translateY(.6em); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes was-strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .deal-was, .deal-was::after { animation: none; } }
.deal-facts dd a::after { content: ""; position: absolute; inset: 0; } /* the whole cell is the tap target */
.deal-facts__item:has(a:focus-visible) { outline: 2.5px solid var(--red); outline-offset: 2px; border-radius: 6px; }
.deal-facts dd a:focus-visible { outline: none; }
.deal-facts dd a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: .2em; }
.deal-sum__when { color: var(--soft); font-size: .88rem; flex-basis: 100%; }
.deal-sum__lede { color: var(--soft); font-size: 1rem; line-height: 1.55; max-width: 60ch; }
.deal-sum__ship { color: var(--soft); font-size: .85rem; margin-top: -2px; }

/* Verified facts: one strip, cells split by hairlines (no cards) */
.deal-facts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; border-block: 1px solid var(--rule); }
.deal-facts--short { max-inline-size: 420px; }
.deal-facts__item { position: relative; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 1px; padding: 9px 12px; min-width: 0; }
.deal-facts__item:first-child { padding-inline-start: 0; }
.deal-facts__item + .deal-facts__item { border-inline-start: 1px solid var(--rule); }
.deal-facts dt { font-size: .78rem; color: var(--soft); line-height: 1.3; }
.deal-facts dd { margin: 0; font-weight: 800; font-size: 1.12rem; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-facts__item--ok dd { color: var(--ok); }

/* Seller coupon */
.deal-coupon { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-card); padding: 10px 12px 10px 10px; }
.deal-coupon__text { display: grid; gap: 1px; min-width: 0; }
.deal-coupon__text small { color: var(--soft); font-size: .82rem; }

/* Buy row: buy button + save */
.deal-buy { display: flex; gap: 8px; }
.deal-buy__go { flex: 1; min-height: 54px; font-size: 1.08rem; }
.deal-buy__go .bag { width: 19px; }
.deal-buy .save-btn { position: static; flex: none; width: 54px; height: 54px; border-radius: var(--r-btn); border: 1.5px solid var(--rule); background: var(--panel); box-shadow: none; transition: border-color var(--d-s), transform var(--d-xs) var(--e-out); }
.deal-buy .save-btn:hover { border-color: var(--fg); }
.deal-buy .save-btn .bag { width: 21px; }

.deal-off { display: grid; gap: 6px; justify-items: start; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-card); padding: 14px 16px; }
.deal-off p { color: var(--soft); }
.deal-off strong { color: var(--fg); }

/* ── Below the fold ─────────────────────────────────────────────── */
.deal-lower { display: grid; gap: 14px; margin-top: 28px; }
@media (min-width: 900px) { .deal-lower { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; margin-top: 44px; align-items: start; } }
.deal-side { display: grid; gap: 14px; min-width: 0; }
.deal-block { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-panel); padding: 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
@media (min-width: 768px) { .deal-block { padding: 22px 24px; } }
.deal-block h2 { font-size: clamp(1.2rem, 2.6vw, 1.45rem); }
.deal-block h3 { font-size: 1rem; font-weight: 700; margin-top: 6px; }

.deal-why__list { list-style: none; margin: 0; padding: 0; display: grid; }
.deal-why__list li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 10px; padding-block: 10px; border-top: 1px solid var(--rule); line-height: 1.5; }
.deal-why__list li:first-child { border-top: 0; padding-top: 0; }
.deal-why__list li > span:only-child { grid-column: 1 / -1; }
.deal-why__list b { font-weight: 700; }
.deal-why__note { line-height: 1.65; }
.deal-why__check { margin: 0; padding-inline-start: 1.15em; display: grid; gap: 6px; color: var(--soft); line-height: 1.55; }
.deal-why__check li::marker { color: var(--soft); }

.deal-score { border-top: 1px solid var(--rule); padding-top: 10px; }
.deal-score summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; font-weight: 600; font-size: .95rem; border-radius: 8px; }
.deal-score summary::-webkit-details-marker { display: none; }
.deal-score summary .i { color: var(--soft); transition: transform var(--d-s) var(--e-out); }
.deal-score[open] summary .i { transform: rotate(180deg); }
.deal-score__bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: .88rem; }
.deal-score__bars li { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr) 2.2rem; align-items: center; gap: 10px; }
.deal-score__bars bdi { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
/* The weakest part of the score (under 60) reads first and stands out */
.deal-score__bars li.is-weak > span:first-child { font-weight: 700; }
.deal-score__bars li.is-weak .deal-score__bar i { background: var(--soft); }
.deal-score__bar { height: 6px; border-radius: 3px; background: var(--stage); overflow: hidden; }
.deal-score__bar i { display: block; height: 100%; background: var(--fg); border-radius: 3px; }
.deal-score__basis { margin-top: 10px; color: var(--soft); font-size: .85rem; }
.deal-score__basis a { color: var(--fg); }

.deal-meta { margin: 0; display: grid; gap: 8px; font-size: .88rem; border-top: 1px solid var(--rule); padding-top: 12px; }
.deal-meta div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 10px; }
.deal-meta dt { color: var(--soft); }
.deal-meta dd { margin: 0; overflow-wrap: anywhere; }

/* Israel answer: the compact customs fact from partials/customs-facts */
.deal-il .customs-facts--compact { margin: 0; line-height: 1.65; }
.deal-il .customs-facts--compact a { display: inline-block; margin-top: 4px; padding-block: 9px; margin-block: -5px -9px; font-weight: 600; color: var(--link-strong); }
.deal-il__more { color: var(--soft); font-size: .9rem; }
.deal-il__more a { color: var(--fg); font-weight: 500; display: inline-block; padding-block: 11px; }
.deal-il__more { margin-block: -8px; }

/* Price history */
.deal-hist__plot { position: relative; }
.deal-hist__chart { width: 100%; height: 110px; overflow: visible; }
.deal-hist__dot { position: absolute; right: -5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--panel); }
/* Time runs left to right (oldest left), as in price charts everywhere; the labels follow the plot, not the page direction. */
.deal-hist__axis { direction: ltr; display: flex; justify-content: space-between; margin-top: -6px; font-size: .78rem; color: var(--soft); font-variant-numeric: tabular-nums; }
.deal-hist__area { fill: color-mix(in srgb, var(--red) 9%, transparent); }
.deal-hist__line { fill: none; stroke: var(--red); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.deal-hist__range { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.deal-hist__range div { padding-top: 8px; }
.deal-hist__range dt { font-size: .78rem; color: var(--soft); }
.deal-hist__range dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.deal-hist__basis { color: var(--soft); font-size: .85rem; }

/* Alternatives */
.deal-alts { margin-top: 18px; }
.deal-alts__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.deal-alt:nth-child(n+3) { display: none; }
@media (min-width: 900px) { .deal-alts__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } .deal-alt:nth-child(n+3) { display: flex; } }
.deal-alt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.deal-alt .deal-card { flex: 1; }
/* The card links to its own deal page; one buy button per screen is enough */
.deal-alt .deal-card__actions { display: none; }
.deal-alt__why { font-size: .88rem; line-height: 1.3; }
.deal-alt__why span { color: var(--soft); }

/* Sticky buy bar content (the bar itself is .buybar from site.css) */
.deal-bar__info { display: grid; line-height: 1.15; min-width: 0; }
.deal-bar__info small { color: var(--soft); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar .btn--buy .bag { width: 17px; }

/* ── Curated product page additions ─────────────────────────────── */
.deal-gets { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.deal-gets li { position: relative; padding-inline-start: 18px; line-height: 1.45; }
.deal-gets li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--fg); }

.pbody { display: grid; gap: 14px; }
.pbody .prose { max-width: 70ch; }
.pbody .prose > div, .pbody .prose section { display: grid; gap: 1em; }
.pbody .prose > div > *, .pbody .prose section > * { margin: 0; }
/* Body headings are stepped down one level (h2→h3, h3→h4) because they sit under the "על המוצר" h2 */
.pbody .prose h3:first-child { margin-top: 0; }
.pbody .prose h3 { font-size: clamp(1.1rem, 2.4vw, 1.3rem); font-weight: 800; margin-top: .8em; }
.pbody .prose h4 { font-size: 1rem; font-weight: 700; margin-top: .4em; }
/* Old body markup: icon-card grids become a plain list of short points */
.pbody .features-grid, .pbody .benefits-grid { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.pbody .feature-card, .pbody .benefit-item { display: grid; gap: 2px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
.pbody .feature-card h4, .pbody .benefit-item h4 { margin: 0; font-size: 1rem; }
.pbody .feature-card p, .pbody .benefit-item p { margin: 0; color: var(--soft); }
.pbody .feature-icon { display: none; }
.pbody .specs-table, .pbody .specifications { display: grid; border-top: 1px solid var(--rule); }
.pbody .spec-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--rule); font-size: .98rem; }
.pbody .spec-label { color: var(--soft); }
.pbody .pros-cons { display: grid; gap: 14px; }
@media (min-width: 640px) { .pbody .pros-cons { grid-template-columns: 1fr 1fr; } }
.pbody .pros-cons ul { margin: 0; }
.pbody details { background: var(--bg); border-radius: var(--r-card); }
.pbody summary { cursor: pointer; padding: 12px 14px; font-weight: 600; }
.pbody details > p { padding: 0 14px 14px; margin: 0; }
.pbody .related-products, .pbody .related-item { display: flex; gap: 12px; align-items: center; }
.pbody .related-item img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.pbody .tip { background: var(--stage); border-radius: var(--r-card); padding: 12px 14px; }

.spec { margin: 0; display: grid; border-top: 1px solid var(--rule); }
.spec div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--rule); }
.spec dt { color: var(--soft); }
.spec dd { margin: 0; overflow-wrap: anywhere; }

.pc { display: grid; gap: 14px; }
@media (min-width: 640px) { .pc { grid-template-columns: 1fr 1fr; } }
.pc__col { display: grid; gap: 8px; align-content: start; }
.pc__col h3 { margin: 0; }
.pc__col ul { margin: 0; padding-inline-start: 1.15em; display: grid; gap: 6px; line-height: 1.55; }
/* Product page: on phones the Israel answer and specs come before the long description */
@media (min-width: 900px) { .deal-lower--product .deal-side--facts { order: 2; } }
.deal-sum__ship + .deal-sum__lede { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 2px; }
.deal-ask { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; font-size: .92rem; color: var(--fg); justify-self: start; }
.deal-ask .i { color: var(--soft); }
/* Curated (hand-written) prices are ink, never red/800: that strength is only for engine-verified prices */
.deal-price--curated { color: var(--fg); font-weight: 700; font-size: clamp(1.6rem, 6vw, 2rem); }
.deal-live { margin-top: 20px; }
/* Live rail under a product page: the cards link to their deal pages; one buy button per screen */
.deal-live .deal-card__actions { display: none; }
/* Related grids and the live rail fit their count: two or three cards never leave empty columns beside them */
@media (min-width: 640px) { .grid.deal-fit { grid-template-columns: repeat(auto-fit, minmax(200px, 270px)); justify-content: start; } }
@media (min-width: 1024px) { .deal-live .rail { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } } /* the route sends at most 4, so a row is always full */
