/* Offer open view from desktop width (ai/specs/2026-09-28-offer-desktop-design.md), split out of offer-hero.css (26.11):
   the <link> media says from where. Every offer from 992 px; Ilumaailm goods from 768 px, so a tablet-wide window
   never falls back to the old big photo with thumbnails (campaign/details.blade.php). Load right after offer-hero.css. */
body.offer-hero-page {
  --od-pad: 32px;
  --od-gap: 40px;
  --od-side: clamp(340px, 29vw, 420px);
  --od-vw: calc(100vw - var(--od-sb, 0px));
  --od-edge: max(var(--od-pad), calc((var(--od-vw) - 1240px) / 2));
  --od-rail-h: clamp(420px, 34vw, 560px);
}

/* header over the rail, same recipe as the homepage hero */
body.offer-hero-page .app-header { position: absolute !important; left: 0; right: 0; top: 0 !important; margin-left: 0; margin-right: 0; z-index: 1120; }
body.offer-hero-page .app-header.-pane { background-color: transparent !important; box-shadow: none !important; }
body.offer-hero-page .nh-header {
  --nh-pill: rgba(255, 255, 255, .15);
  --nh-pill-hover: rgba(255, 255, 255, .27);
  --nh-pill-active-bg: rgba(255, 255, 255, .92);
  --nh-pill-active: #111;
  --nh-icon-hover: rgba(255, 255, 255, .16);
  color: #fff; background: transparent !important; border-bottom: 0;
}
body.offer-hero-page .view-content.-listing-details > .bgimage { display: none; }

/* page grid */
body.offer-hero-page .offer-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--od-side); grid-template-rows: auto auto auto 1fr;
  column-gap: var(--od-gap); max-width: calc(1240px + 2 * var(--od-pad)); margin: 0 auto; padding: 0 var(--od-pad);
}
body.offer-hero-page .offer-layout > .row { display: contents; }
body.offer-hero-page .offer-layout > .row > * { width: auto; max-width: none; min-width: 0; padding-left: 0; padding-right: 0; margin-top: 0; }
body.offer-hero-page .offer-hero-gallery-col { grid-column: 1 / -1; grid-row: 1; }
/* no breadcrumbs in the open view (Marti 2026-09-28); the JSON-LD breadcrumb stays in the head */
body.offer-hero-page .offer-layout > .offer-crumbs { display: none !important; }
body.offer-hero-page .offer-hero-info-col { grid-column: 1; grid-row: 3; margin-bottom: 56px; padding-top: 6px; }
body.offer-hero-page .offer-main-col { grid-column: 1; grid-row: 4; margin-bottom: 48px; }
body.offer-hero-page .offer-side-col { grid-column: 2; grid-row: 3 / span 2; margin-bottom: 48px; }
/* buy card (option rows or one price): info left in row 3, the card right over rows 3 and 4, the sidebar under its stop */
body.offer-hero-page .offer-layout--card .offer-hero-info-col,
body.offer-hero-page .offer-layout--card .offer-hero-row .listing-hero { display: contents; }
body.offer-hero-page .offer-layout--card .offer-side-col { grid-column: 2; grid-row: 4; }
body.offer-hero-page .offer-hero-embleem.d-md-block { display: none !important; }

/* collage rail, edge to edge from the very top */
body.offer-hero-page .offer-hero-gallery-col .listing-gallery {
  position: relative; width: var(--od-vw); margin-left: calc(50% - var(--od-vw) / 2); margin-right: 0;
  margin-top: calc(-1 * var(--offer-hero-top, 0px));
}
body.offer-hero-page .offer-hero-gallery-col .listing-gallery-desktop.d-md-block { display: none !important; }
body.offer-hero-page .offer-rail-wrap.d-md-none { display: block !important; }
/* the 2 px seams between tiles show the page background: light in light mode */
.offer-rail-wrap { position: relative; height: var(--od-rail-h); background: var(--bs-body-bg); }
.offer-rail-wrap::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 150px; z-index: 2; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
}
/* the lip: reads as the rounded sheet rising over the photos */
.offer-rail-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 33px; z-index: 3; pointer-events: none;
  background: var(--bs-body-bg); border-radius: 32px 32px 0 0;
}
.offer-rail {
  /* ends under the lip: at fractional zoom the tiles' last pixel row would show below it */
  position: absolute; inset: 0 0 8px; display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain; scrollbar-width: none; scroll-behavior: smooth;
}
.offer-rail::-webkit-scrollbar { display: none; }
.offer-rail__blk { flex: none; height: 100%; display: grid; gap: 2px; grid-template-rows: 1fr 1fr; }
.offer-rail__blk--half { width: calc(var(--od-rail-h) * .75); grid-template-columns: 1fr; }
.offer-rail__blk--full { width: calc(var(--od-rail-h) * 1.5); grid-template-columns: 1fr 1fr; }
/* Martin 12.11 (#41657): a rail shorter than the screen (few photos, portraits) grows every block in proportion
   instead of leaving a gap; a long rail has no free space, so nothing changes there */
.offer-rail__blk--half { flex-grow: 1; }
.offer-rail__blk--full { flex-grow: 2; }
/* a block of portraits only is never wider than tall (it would be cut wide, Martin 10.11); a reel keeps its width */
.offer-rail__blk--half:has(> .gp-tile):not(:has(> .offer-rail__tile:not(.gp-tile))) { max-width: var(--od-rail-h); }
.offer-rail__blk--full:has(> .gp-tile):not(:has(> .offer-rail__tile:not(.gp-tile))) { max-width: calc(var(--od-rail-h) * 2); }
.offer-rail__blk:has(> .offer-rail__tile--reel) { flex-grow: 0; }
.offer-rail__tile {
  position: relative; display: block; margin: 0; padding: 0; border: 0; border-radius: 0;
  overflow: hidden; min-width: 0; min-height: 0; background: var(--bs-secondary-bg); cursor: zoom-in;
}
.offer-rail__tile--reel { cursor: pointer; }
.offer-rail__tile img,
.offer-rail__tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.offer-rail__tile:hover img { transform: scale(1.035); }
.offer-rail__tile.span-c { grid-column: 1 / 3; }
.offer-rail__tile.span-r { grid-row: 1 / 3; }
.offer-rail__tile.span-all { grid-column: 1 / 3; grid-row: 1 / 3; }
.offer-rail__tag {
  position: absolute; left: 14px; bottom: 48px; z-index: 1;
  display: inline-flex; align-items: center; gap: 3px; padding: 5px 12px 5px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 13px; font-weight: 700;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.offer-rail__count {
  position: absolute; right: var(--od-edge); bottom: 50px; z-index: 4;
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 0; border-radius: 12px;
  background: #fff; color: #111; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .22);
}
.offer-rail__arr {
  display: grid; place-items: center; position: absolute; top: 50%; z-index: 4;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: #111; font-size: 20px; line-height: 1;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28); transform: translateY(-50%); transition: opacity .2s, transform .15s;
}
.offer-rail__arr:hover { transform: translateY(-50%) scale(1.06); }
.offer-rail__arr--prev { left: 24px; }
.offer-rail__arr--next { right: 24px; }
.offer-rail__arr.is-off { opacity: 0; pointer-events: none; }
/* heart and photo count: one white pair at the bottom right of the rail, on the content edge */
.offer-rail__acts { position: absolute; right: var(--od-edge); bottom: 50px; z-index: 4; display: flex; align-items: center; gap: 10px; }
.offer-rail__acts .offer-rail__count { position: static; min-height: 40px; }
body.offer-hero-page .offer-rail-wrap .favourite-heart--hero {
  position: static; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .22);
}
body.offer-hero-page .offer-rail-wrap .favourite-heart--hero i { font-size: 1.15rem; color: #111; filter: none; }
body.offer-hero-page .offer-rail-wrap .favourite-heart--hero i.bi-heart-fill { color: #FF385C; }
.offer-rail__acts .offer-share {
  position: static; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: #fff; color: #111; box-shadow: 0 2px 14px rgba(0, 0, 0, .22);
}
.offer-rail__acts .offer-share svg { width: 19px; height: 19px; }
body.offer-hero-page .offer-rail-wrap .kinkekas-badge {
  top: calc(var(--nh-header-h, 72px) + 18px) !important; bottom: auto !important; left: var(--od-edge) !important; right: auto !important; z-index: 4;
}

/* hero column: the phone sheet, left aligned (one price); with option rows the info half of the grid */
body.offer-hero-page .offer-hero-row .listing-hero { display: flex; flex-direction: column; align-items: stretch; max-width: 680px; }
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info, .offer-buy) > * { order: 10; }
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info) > .rating { order: 0; align-self: flex-start; margin-bottom: 12px; }
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info) > h1 {
  order: 1; margin-bottom: 14px !important; font-size: clamp(32px, 2.7vw, 46px) !important; line-height: 1.1; text-wrap: balance;
}
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info) > .listing-hero-qty-badge { order: 2; }
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info) > .listing-hero-short-desc {
  order: 3; font-size: 18.5px !important; line-height: 1.5; max-width: 60ch; margin-bottom: 20px !important;
}
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info) > .plus-deal-detail-banner { order: 5; margin-bottom: 18px; }
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info) > .listing-stats-mobile { order: 6; }
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info) > .progress { order: 7; margin-bottom: 18px; }
body.offer-hero-page .offer-hero-row :is(.listing-hero, .offer-info, .offer-buy) > .listing-hero-price-row { order: 8; justify-content: flex-start !important; align-items: center !important; gap: 14px; }
body.offer-hero-page .listing-hero-meta-row { display: none !important; }

/* stats in a bordered box: Aega jäänud, Kehtivus, Ostetud */
body.offer-hero-page .listing-hero .listing-stats-mobile {
  display: flex !important; flex-wrap: nowrap; margin: 4px 0 20px !important; padding: 12px 0 !important;
  border: 1px solid var(--bs-border-color); border-radius: 18px;
}
body.offer-hero-page .listing-stats-mobile > .col-4 { flex: 1 1 0; width: auto; margin-top: 0; padding: 0 10px; }
body.offer-hero-page .listing-stats-mobile > .col-4 + .col-4 { border-left: 1px solid var(--bs-border-color); }
body.offer-hero-page .listing-stats-mobile .fs-xs { letter-spacing: .07em; margin-bottom: 4px; }
body.offer-hero-page .listing-stats-mobile .fs-base { flex-wrap: nowrap !important; white-space: nowrap; font-size: 17px !important; font-weight: 700; }
body.offer-hero-page .listing-stats-mobile .fs-base.time-urgent { display: inline-flex !important; padding: 2px 10px; gap: 4px !important; }
body.offer-hero-page .listing-stats-mobile .time-urgent .time-left { min-width: 0 !important; font-variant-numeric: tabular-nums; }

/* one price: red discount label next to the prices */
body.offer-hero-page .offer-hero-row .listing-hero-price-row .discount {
  background: #DC251E; color: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1.1;
  border-radius: 10px; padding: 5px 10px; width: auto; height: auto;
}

/* buy card: info left, sticky card right; offer-buy.js stops it at the collage under the Tingimused text */
body.offer-hero-page .offer-layout--card .offer-info {
  grid-column: 1; grid-row: 3; display: flex; flex-direction: column; align-items: stretch; min-width: 0;
  margin-bottom: 56px; padding-top: 6px;
}
body.offer-hero-page .offer-layout--card .offer-buy {
  grid-column: 2; grid-row: 3 / span 2; align-self: start; z-index: 2; margin-top: 6px;
  display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px;
  padding: 20px; border: 1px solid var(--bs-border-color); border-radius: 26px; background: var(--bs-body-bg);
  box-shadow: 0 16px 48px rgba(16, 24, 18, .11), 0 2px 6px rgba(16, 24, 18, .05);
}
[data-bs-theme="dark"] body.offer-hero-page .offer-layout--card .offer-buy { background: var(--bs-tertiary-bg); box-shadow: 0 16px 48px rgba(0, 0, 0, .45); }
body.offer-hero-page .offer-layout--card .offer-buy > * { margin-top: 0 !important; margin-bottom: 0 !important; }
body.offer-hero-page .offer-layout--card .offer-buy > .plus-deal-detail-banner { order: 5; }
body.offer-hero-page .offer-layout--card .offer-buy__desk { display: block; }
body.offer-hero-page .offer-layout--card .offer-buy .offer-trust { border-top: 1px solid var(--bs-border-color); padding-top: 16px; }
/* one price in the card: discount | prices | quantity at the right end */
/* prices get air above and below so the Plus banner and Osta do not crowd them */
body.offer-hero-page .offer-layout--card .offer-buy > .listing-hero-price-row { flex-wrap: wrap !important; row-gap: 10px; padding: 12px 2px 14px; }
body.offer-hero-page .offer-layout--card .offer-buy .listing-hero-price-row .price { font-size: 17px; white-space: nowrap; }
/* sale price big, old price small: both stay on one line in the card, also over 1000€ (Martin 19.11) */
body.offer-hero-page .offer-layout--card .offer-buy .listing-hero-price-row .price.fw-bold { font-size: 28px; line-height: 1.05; letter-spacing: -.01em; }
body.offer-hero-page .offer-layout--card .offer-buy .listing-hero-price-row .discount { font-size: .95rem; padding: 4px 8px; }
body.offer-hero-page .offer-layout--card .offer-buy .offer-qty { gap: 2px; }
body.offer-hero-page .offer-layout--card .offer-buy .offer-qty .offer-step__btn { width: 34px; height: 34px; }
body.offer-hero-page .offer-layout--steps .listing-hero-price-row { display: none !important; }
body.offer-hero-page .offer-layout--steps select[id^="options-"] { display: none !important; }
body.offer-hero-page .listing-hero .add-to-cart.offer-steps-empty {
  background: #c9d2c6 !important; border-color: #c9d2c6 !important; box-shadow: none !important;
}
[data-bs-theme="dark"] body.offer-hero-page .listing-hero .add-to-cart.offer-steps-empty { background: #4a524c !important; border-color: #4a524c !important; }

/* option rows wide: name | prices | control */
body.offer-hero-page .offer-steps { margin-top: 6px; border-radius: 20px; }
body.offer-hero-page .offer-steps__title { font-size: 18px; }
body.offer-hero-page .offer-step { grid-template-columns: minmax(0, 1fr) 132px; padding: 12px 14px 12px 20px; min-height: 68px; }
body.offer-hero-page .offer-step:hover { border-color: #b7c6b3; }
body.offer-hero-page .offer-step.is-on,
body.offer-hero-page .offer-step.is-on:hover { border-color: #18ae00; }
body.offer-hero-page .offer-step__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; }
body.offer-hero-page .offer-step__price { margin-top: 0; justify-content: end; }
body.offer-hero-page .offer-step__price b { text-align: right; }
body.offer-hero-page .offer-step.is-on .offer-step__ctl { justify-content: space-between; }
body.offer-hero-page .offer-step__ctl { justify-content: flex-end; }

/* sticky Osta bar: photo, title and price with the button on the right */
.offer-sticky-buy {
  display: block; position: fixed; left: 0; right: 0; top: 0; z-index: 1030;
  background: var(--bs-body-bg); box-shadow: 0 8px 24px rgba(0, 0, 0, .13); border-bottom: 1px solid var(--bs-border-color-translucent);
  transform: translateY(-110%); transition: transform .22s ease; pointer-events: none;
}
.offer-sticky-buy.is-on { transform: none; pointer-events: auto; }
.offer-sticky-buy__in { display: flex; align-items: center; gap: 14px; max-width: calc(1240px + 2 * var(--od-pad)); margin: 0 auto; padding: 10px var(--od-pad); }
.offer-sticky-buy__img { display: block; width: 64px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bs-secondary-bg); }
.offer-sticky-buy__img[hidden] { display: none; }
.offer-sticky-buy__tx { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.offer-sticky-buy__tx b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer-sticky-buy__sub { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-sticky-buy__sub strong { color: var(--bs-body-color); font-size: 16px; }
.offer-sticky-buy__sub s { font-size: 14px; }
.offer-sticky-buy__pct { background: #DC251E; color: #fff; font-weight: 800; font-size: 12.5px; border-radius: 8px; padding: 2px 7px; }
.offer-sticky-buy__btn {
  flex: none; width: 260px; min-height: 50px; padding: 6px 12px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, #18ae00 0%, #4cd964 100%); color: #fff;
  font-size: 17px; font-weight: 700; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.offer-sticky-buy__btn.is-empty { background: #c9d2c6; }
.offer-sticky-buy__btn:disabled { opacity: .6; }
.offer-sticky-buy__btn .offer-steps-sum { font-size: 12.5px; margin-top: 1px; }
.offer-sticky-buy__choose { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1200px) {
  body.offer-hero-page { --od-pad: 40px; --od-gap: 56px; }
}
/* narrow desktop: the rows column is ~540 px, prices go under the name as on phones */
@media (max-width: 1199.98px) {
  body.offer-hero-page .offer-step__body { display: block; }
  body.offer-hero-page .offer-step__price { margin-top: 6px; justify-content: start; }
  body.offer-hero-page .offer-step__price b { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .offer-rail, .offer-rail__tile img, .offer-sticky-buy, .offer-steps { transition: none; scroll-behavior: auto; }
}
/* Boost: three prices in the card */
body.offer-hero-page .offer-layout--card .offer-buy .listing-hero-price-row.is-flash .fs-sm { font-size: 11.5px; letter-spacing: .03em; white-space: nowrap; }
body.offer-hero-page .offer-layout--card .offer-buy .listing-hero-price-row.is-flash .listing-hero-price-block.text-muted .price,
body.offer-hero-page .offer-layout--card .offer-buy .listing-hero-price-row.is-flash .listing-hero-price-block--full .price { font-size: 17px; }
