/* Stock list and car details (pages/vehicule): the sticky filter bar, the card's badges, promotion price and stock chip,
   the pager and the promotion block. The pills, menus and phone sheets are categorie.css; this file adds what the stock
   needs on top of them. Tokens only. Written for the 375 px phone first. */
::selection { background: var(--navy); color: var(--on-navy); }

/* The bar rides under the sticky header, inside the page measure and on the page's own ground: only the pills are white
   (owner, 2026-11-21: no white strip). Once it is stuck (.stuck, set by SiteStockFilters) the cards scroll under a blur of
   the page colour, so the pills stay readable. While a menu is open it rises above the header and the assistant, so the
   phone sheet and its scrim cover the whole screen. */
.stock-bar { position: sticky; top: var(--top-h); z-index: 15; padding-block: var(--s-3); transition: background var(--t-fast); }
.stock-bar.stuck { background: color-mix(in oklch, var(--ui-bg, var(--paper)) 70%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
/* A backdrop filter would become the containing block of the fixed phone sheet and its scrim: off while a menu is open. */
.stock-bar.stuck.stock-bar-open { -webkit-backdrop-filter: none; backdrop-filter: none; }
.stock-sentinel { display: block; height: 1px; margin-bottom: -1px; }
.stock-bar-open { z-index: 46; }
.stock-bar .filters { flex-wrap: nowrap; gap: var(--s-2); margin: 0; padding: 0; overflow: visible; }
.stock-bar .filter { min-height: 44px; }
.stock-bar .filter:hover { border-color: var(--ink); }
.stock-bar .filter:active { background: var(--paper-2); }
.stock-bar .filter.on:active { background: var(--ink-2); }
.stock-bar .filter .icon { color: inherit; }
.filter-n { display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding-inline: 0.3rem; border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.stock-count { margin-left: auto; padding-left: var(--s-2); font-size: var(--step--1); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stock-count b { color: var(--ink); font-weight: 600; }
.facet-wide { display: none; }
/* A 320-375 px phone holds the two pills and the count on one row. */
@media (max-width: 900px) {
  .stock-bar .filter { padding-inline: 0.95rem; }
}
/* Below 400 px the count does not fit beside the pills; the sheet's button states it ("Vezi 23 de mașini"). */
@media (max-width: 400px) {
  .stock-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.year-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); padding: var(--s-1) var(--s-2) var(--s-2); }
.filter-sheet .year-pair { padding-inline: 0; }
/* In the phone sheet the open year list stops above the sticky "Vezi" bar when it scrolls into view. */
.filter-sheet .select .filter-menu { scroll-margin-bottom: 6rem; }
.year-pair > div { display: grid; gap: var(--s-1); font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
/* The year pickers are SiteSelect (base.css); this is their frame in the filter menu. The options in the sheet are .chip, the menu rows .opt (base.css). */
.year-pair .select-trigger { min-height: 44px; padding: 0 0.75rem 0 0.9rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); font-variant-numeric: tabular-nums; }
.year-pair .select-trigger:hover { border-color: var(--ink); }
.sheet-acts { position: sticky; bottom: calc(-1 * var(--s-5)); display: flex; align-items: center; gap: var(--s-4); margin: var(--s-2) calc(-1 * var(--s-4)) calc(-1 * var(--s-5)); padding: var(--s-3) var(--s-4) var(--s-4); border-top: 1px solid var(--line); background: var(--card); }
.sheet-acts .btn { margin-left: auto; min-height: 48px; }

/* The list: while a new page loads, the cards it replaces step back. */
.stock-list { padding-top: var(--s-5); scroll-margin-top: calc(var(--top-h) + 4.5rem); }
.stock-list[aria-busy="true"] .cars { opacity: 0.5; transition: opacity var(--t-fast); }
.stock-list .cars-empty { margin-top: var(--s-2); }
.cars-empty .cat-empty-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* The promotion mark on a photo (SitePromoFlag; stock card, SitePromoDetail and the car's lead photo, which all load this
   sheet): a swing tag that runs out of the frame's right edge, square on the edge, its inner end cut to a point with a
   punched hole the photo shows through. The frame is positioned and clips it, so the tag slides out of the edge once when
   it appears. It labels only: every click goes through to the photo under it, and the points of interest paint over it.
   A long label wraps to two lines inside 15em, never past 78% of the frame. No icon: the punched tag is the sign. */
.promo-flag { position: absolute; top: var(--s-3); right: 0; z-index: 0; display: flex; max-width: 78%; pointer-events: none; filter: drop-shadow(0 2px 5px oklch(0 0 0 / 0.22)); animation: promo-flag-in var(--t-slow) var(--ease-lift) 160ms backwards; }
/* Sized in em: a larger frame (the car's lead photo, vehicul.css) only raises the font size. */
.promo-flag-tag { display: flex; align-items: center; min-width: 0; max-width: 15em; padding: 0.7em 1.25em 0.7em 2.1em; background: var(--promo); color: #fff; font-family: var(--font-display); font-size: 0.8rem; font-weight: var(--display-weight); font-stretch: var(--display-stretch); line-height: 1.2; clip-path: polygon(1.1em 0, 100% 0, 100% 100%, 1.1em 100%, 0 50%); -webkit-mask: radial-gradient(circle at 1.2em 50%, transparent 0.25em, #000 calc(0.25em + 0.5px)); mask: radial-gradient(circle at 1.2em 50%, transparent 0.25em, #000 calc(0.25em + 0.5px)); }
.promo-flag-tag > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; text-wrap: balance; }
@keyframes promo-flag-in { from { transform: translateX(101%); } }
@media (prefers-reduced-motion: reduce) { .promo-flag { animation: none; } }
/* Card: the Certified badge top-left on the photo, the promotion flag top-right. On a photo too narrow for both
   side by side (list view, grid at a tablet, phone) the flag drops under the badge row. */
.car-badges { position: absolute; top: var(--s-3); left: var(--s-3); right: var(--s-3); display: flex; flex-wrap: wrap; gap: var(--s-2); pointer-events: none; }
.car-media { container-type: inline-size; }
@container (max-width: 34rem) { .car-badges + .promo-flag { top: calc(var(--s-3) * 2 + 1.6rem); } }
.car-body h3 { overflow-wrap: anywhere; text-wrap: balance; }
.car-body h3 a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.car-meta { flex-wrap: wrap; gap: 0; }
.car-meta li + li::before { content: ""; display: inline-block; width: 1px; height: 0.9em; margin-inline: var(--s-3); background: var(--line-strong); vertical-align: -0.1em; }
.car-prices { display: grid; gap: var(--s-2); justify-items: start; }
.car-price small { font-size: 0.55em; font-weight: 600; font-stretch: 100%; letter-spacing: 0; color: var(--on-navy-2); }
.car-was { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); font-size: var(--step--1); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.car-was s { color: var(--ink-3); text-decoration-thickness: 1.5px; }
.car-was span { font-weight: 700; color: var(--navy-ink); }

/* Pager: a phone reads "Pagina 6 din 18" between the two steps; wider screens get the numbers. */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-top: var(--s-7); font-variant-numeric: tabular-nums; }
.pager ol { display: none; gap: var(--s-1); }
.pager ol a, .pager-gap { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding-inline: var(--s-2); border: 1px solid transparent; border-radius: var(--radius-pill); font-size: var(--step--1); font-weight: 600; color: var(--ink); transition: border-color var(--t-fast), background var(--t-fast); }
.pager ol a:hover { border-color: var(--line-strong); }
.pager ol a:active { background: var(--paper-2); }
.pager ol a[aria-current] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.pager-gap { color: var(--ink-3); }
.pager-step { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 1.1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: var(--step--1); font-weight: 700; color: var(--ink); transition: border-color var(--t-fast), transform 500ms var(--ease-lift); }
a.pager-step:hover { border-color: var(--ink); }
a.pager-step:active { transform: scale(0.97); }
.pager-step[aria-disabled] { color: var(--ink-3); border-color: var(--line); }
.pager-step .icon { width: 16px; height: 16px; }
.pager-of { font-size: var(--step--1); color: var(--ink-2); }

/* Promotions above the cars (?promo=1): the running offers, on the navy field of the rate cards. */
.promos { display: grid; gap: var(--s-3); padding-top: var(--s-5); }
.promo { display: grid; gap: var(--s-2); justify-items: start; padding: var(--s-5); border-radius: var(--radius-lg); background: var(--navy); color: var(--on-navy); }
.promo h2 { font-size: var(--step-2); text-wrap: balance; overflow-wrap: anywhere; }
.promo p { max-width: 62ch; color: var(--on-navy-2); text-wrap: pretty; }
.promo-until { font-size: var(--step--1); font-variant-numeric: tabular-nums; }

@media (min-width: 641px) {
  .facet-all > .filter-menu { left: 0; right: auto; }
  .promos { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
  .pager { justify-content: center; }
  .pager ol { display: flex; }
  .pager-of { display: none; }
}
@media (min-width: 901px) {
  .facet-wide { display: inline-flex; }
  .facet-all, .facet-phone { display: none; }
  .stock-bar .filters { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .stock-list[aria-busy="true"] .cars, .pager ol a, .pager-step, .filter-menu .opt, .view-switch button { transition: none; }
}

/* View modes (SiteStockFilters switch, SiteStockList data-view): the large card is the base look (categorie.css); the grid and
   the list exist from 901 px up, below that the cards are the large ones and the switch is hidden. */
.view-switch { display: none; }
@media (min-width: 901px) {
  .view-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--card); }
  .view-switch button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--ink-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
  .view-switch button:hover { background: var(--paper-2); color: var(--ink); }
  .view-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
  .view-switch .icon { width: 20px; height: 20px; }

  /* Grid: three cards a row, photo on top, the body stacked under it. */
  .cars[data-view="grid"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
  .cars[data-view="grid"] .car { grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--s-3); padding: var(--s-3); }
  .cars[data-view="grid"] .car-body { align-content: start; gap: var(--s-2); padding: 0 var(--s-2) var(--s-2); }
  .cars[data-view="grid"] .car-body h3 { font-size: var(--step-1); }
  .cars[data-view="grid"] .car-meta { font-size: var(--step--1); }
  .cars[data-view="grid"] .car-price { padding: 0.5rem 1rem; font-size: var(--step-1); }
  .cars[data-view="grid"] .car-cta { margin-top: 0; }

  /* List: a compact row, photo left, title and facts in the middle, price and button at the right edge. */
  .cars[data-view="list"] { gap: var(--s-3); }
  .cars[data-view="list"] .car { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--s-5); align-items: center; padding: var(--s-3); }
  .cars[data-view="list"] .car-body { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-5); padding: 0 var(--s-3) 0 0; }
  .cars[data-view="list"] .car-body h3, .cars[data-view="list"] .car-meta, .cars[data-view="list"] .car-body > .badge { grid-column: 1; }
  .cars[data-view="list"] .car-body h3 { font-size: var(--step-1); }
  .cars[data-view="list"] .car-meta { font-size: var(--step--1); }
  .cars[data-view="list"] .car-prices { grid-column: 2; grid-row: 1 / 3; justify-items: end; }
  .cars[data-view="list"] .car-price { padding: 0.5rem 1rem; font-size: var(--step-1); }
  .cars[data-view="list"] .car-cta { grid-column: 2; grid-row: 3; justify-self: end; margin-top: 0; }
}

/* The large card on a smaller screen: type and photo scale with the width of the list (container units), so the card
   keeps its two columns down to a tablet and shrinks together instead of stacking a full-width photo. */
.cars { container-type: inline-size; }
@media (max-width: 1100px) {
  .cars[data-view="big"] .car { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 3cqw; padding: 2.4cqw; }
  .cars[data-view="big"] .car-body { gap: 1.6cqw; padding-right: 0; }
  .cars[data-view="big"] .car-body h3 { font-size: clamp(1.05rem, 3.6cqw, var(--step-2)); }
  .cars[data-view="big"] .car-meta { font-size: clamp(0.8rem, 2cqw, var(--step-0)); }
  .cars[data-view="big"] .car-price { padding: 1.4cqw 2.4cqw; font-size: clamp(1rem, 3.4cqw, var(--step-2)); }
  .cars[data-view="big"] .car-was { font-size: clamp(0.74rem, 1.8cqw, var(--step--1)); }
  .cars[data-view="big"] .car-cta { padding-block: 1.4cqw; font-size: clamp(0.85rem, 2cqw, var(--step-0)); }
}
@media (max-width: 640px) {
  .cars[data-view="big"] .car { grid-template-columns: minmax(0, 1fr); gap: 3.5cqw; padding: 3.5cqw; }
  .cars[data-view="big"] .car-media { aspect-ratio: 16 / 10; }
  .cars[data-view="big"] .car-body { padding: 0 1.5cqw 1.5cqw; gap: 2.4cqw; }
  .cars[data-view="big"] .car-body h3 { font-size: clamp(1.05rem, 5.4cqw, var(--step-1)); }
  .cars[data-view="big"] .car-meta { font-size: clamp(0.8rem, 3.4cqw, var(--step-0)); }
  .cars[data-view="big"] .car-price { padding: 2cqw 4cqw; font-size: clamp(1rem, 5.4cqw, var(--step-1)); }
  .cars[data-view="big"] .car-cta { padding-block: 2.4cqw; font-size: clamp(0.85rem, 3.6cqw, var(--step-0)); }
}
