/* 19-set-details-mobile.css — what only the phone's set page has (task 115, Pages/Sets/_Mobile; regrouped in task 156):
   the photo, the name and the status line, the price block's facts, the part heads, the folds, the chart's box and
   legend chips and the held «Купити» (an offer row's mark is <provider-mark>, task 163). Everything
   else is a component of 16-phone.css, which _Layout links before this file; this one is linked by the page alone
   (@section Styles). Semantic tokens only (`.sd-` = set details). */

.sd-page {
  /* No «+» here: the held actions are the last thing in the flow. */
  padding-bottom: 0;
}

/* ── The photo, the name, the chips ── */
.sd-hero__photo {
  display: grid;
  /* One cell exactly the box's inside: in an auto row a photo taller than 160 px grew the row, so the picture's
     max-height: 100% was of itself and it ran 84–96 px out of the box over the name (task 128, a 400 × 300 photo). */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  width: 100%;
  height: 184px;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-3);
  background: var(--photo-bg);
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--duration-1) var(--ease);
}

.sd-hero__photo:active {
  transform: scale(0.985);
}

.sd-hero__photo:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.sd-hero__photo img {
  display: block;
  /* Its width / height attributes reserve the box's shape only (task 122): the picture keeps its own size. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sd-hero__title {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.sd-hero__meta {
  margin-top: 2px !important;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sd-hero .set-tags {
  margin-top: var(--space-2);
}

/* ── The price block: the best price, «Купити», the facts it is read against (SetDetailPriceFacts), two chips ── */
.sd-price {
  margin-top: var(--space-4);
}

.sd-price__line {
  margin-top: 2px !important;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sd-price__line b {
  font-weight: 600;
}

/* ── The anchor chips and the parts under them (task 156: every part on the page, one column) ── */
.sd-bar {
  margin-top: var(--space-4);
}

/* A jump to a part (no script, a switch link back to it, a tab tapped with the bar held — phone.js reads this) lands
   under the header and the bar, with the gap it has under the bar in the flow. */
.sd-panel {
  scroll-margin-top: calc(var(--m-header) + var(--touch) + var(--space-3));
  margin-top: var(--space-3);
}

.sd-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--touch);
}

.sd-panel__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.sd-panel__sub {
  margin-top: var(--space-1) !important;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-wrap: pretty;
}

.sd-panel__links {
  display: flex;
  justify-content: center;
  margin-top: var(--space-2) !important;
}

.sd-panel__links .ui-btn {
  font-size: var(--text-sm);
}

/* Sealed | used: two links in the segmented control's look, the current one aria-current. */
.sd-condition {
  flex: none;
}

.sd-condition .ui-segmented__option {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* A shop's delivery (task 146): the component as it is, a gap before the list. */
.sd-delivery {
  margin-bottom: var(--space-2);
}

.sd-rating {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-1) !important;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sd-rating b {
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: 700;
}

.sd-stars {
  color: var(--accent-text);
  letter-spacing: 0.05em;
}

.sd-note {
  margin-top: var(--space-2) !important;
  padding: var(--space-3);
  border-radius: var(--radius-2);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.sd-note b {
  color: var(--text);
}

.sd-note .ui-btn {
  margin-top: var(--space-2);
}

/* ── Rows with no picture (reviews, sources, purchases): the text takes the picture's column ── */
.sd-list--text .ui-m-row__link {
  grid-template-columns: minmax(0, 1fr) auto;
}

.sd-list--text .ui-m-row + .ui-m-row::before {
  left: 0;
}

/* A row that only reads (a source, a purchase) does not light up under the finger. */
div.ui-m-row__link:active {
  background: none;
}

/* A reader's offer rows have no leading mark (task 196, source-only): two columns, as a text list's, and the divider
   runs from the row's edge. */
.sd-offers .ui-m-row__link:not(:has(> .ui-provider)) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.sd-offers .ui-m-row:not(:has(.ui-provider)) + .ui-m-row:not(:has(.ui-provider))::before {
  left: 0;
}

/* The offer the price block names: its mark ringed in the accent (task 163; task 115's letters were filled with it) —
   an administrator's; a reader's best row says «Najlepsza» in its meta line. */
.sd-offer--best .ui-provider__tile {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* A place, a seller or a source's line can be long: it gives way to the chip, not the row its width. */
.sd-offer__where,
.sd-list--text .ui-m-row__num {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sd-offers .ui-m-row__meta .tag {
  flex: none;
}

.sd-offer--off .ui-m-row__title,
.sd-offer--off .ui-m-row__value {
  color: var(--text-muted);
}

/* ── The chart: full width, a finger reads it sideways and still scrolls the page up and down ── */
.sd-chart {
  position: relative;
  height: 260px;
  margin: var(--space-2) calc(-1 * var(--space-1)) 0;
  touch-action: pan-y;
}

/* 03-set-details.css holds the desktop's canvas at 300 px minimum on a narrow screen (task 105). */
.sd-chart .price-chart {
  height: 100%;
  min-height: 0;
}

.sd-chart + .ui-m-ranges {
  margin-top: var(--space-1);
}

.ui-m-ranges[hidden],
.ui-m-range[hidden] {
  display: none;
}

/* The legend set-details-chart.js writes: chips 44 px tall, a tap hides a line. They wrap — a reader's three (the market,
   the floor, MSRP; task 196) fit in two rows at 360 px, where a scrolling row hid the third behind the edge. */
.sd-legend {
  max-width: none;
  flex-wrap: wrap;
  overflow: visible;
  gap: var(--space-1);
  margin: var(--space-1) 0 0;
  padding: 0;
}

.sd-legend .chart-side-legend-item {
  flex: none;
  gap: 6px;
  min-height: var(--touch);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--duration-1) var(--ease);
}

.sd-legend .chart-side-legend-item.is-hidden {
  opacity: 0.45;
}

.sd-legend .chart-side-legend-text {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.sd-legend .chart-side-legend-label {
  font-size: var(--text-xs);
}

.sd-legend .chart-side-legend-value {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.sd-windows {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ── The sheet's text parts (offers, reviews and minifigures) ── */
.sd-sheet__title {
  padding-right: 40px;
}

.sd-sheet__text {
  margin-top: var(--space-4) !important;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
  text-wrap: pretty;
}

.sd-review {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sd-review .ui-btn {
  flex: 1 1 0;
}

.sd-review .ui-btn[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* «⋯»: «Оновити ціни» is a form's button, the whole width like the menu's other actions. */
.ui-m-menu__actions form .ui-btn {
  width: 100%;
}

/* ── «Купити за …» and «В колекцію / В бажання», held above the bottom bar ── */
.sd-actions {
  flex-wrap: nowrap;
  margin: var(--space-4) calc(-1 * var(--m-gutter)) 0;
  padding: var(--space-2) var(--m-gutter);
}

.sd-actions > .ui-btn {
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--text-md);
}

.sd-actions > .sd-actions__buy {
  flex: 1.6 1 0;
}

.sd-actions .ui-btn svg {
  width: 18px;
  height: 18px;
}

.sd-actions .my-set-dot {
  flex: none;
}

@media (prefers-reduced-motion: reduce) {
  .sd-hero__photo {
    transition: none;
  }

  .sd-hero__photo:active {
    transform: none;
  }
}

/* The set's auctions (task 144): the row is the listing's link, the 👁 its own 44 px button beside it. */
.sd-auction {
  display: flex;
  align-items: center;
}

.sd-auction .ui-m-row__link {
  flex: 1 1 auto;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-right: 0;
}

.sd-auction__time--urgent {
  color: var(--down);
  font-weight: 600;
}

.sd-auction__time--soon {
  color: var(--warn);
}

.sd-auctions__status[hidden] {
  display: none;
}

/* ── Task 156: the status line, the reader's actions, the price block's facts, the folds, the held «Купити» ── */
.sd-hero__status {
  margin-top: var(--space-1) !important;
  font-size: var(--text-sm);
  text-wrap: pretty;
}

.sd-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.sd-hero__actions .ui-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.sd-hero .sp-mine {
  margin-top: var(--space-2);
}

.sd-hero .sp-order {
  margin-top: var(--space-2);
}

.sd-hero .sp-order .sp-mine {
  margin-top: 0;
}

.sd-hero .sp-order > * {
  flex: 1 0 100%;
}

.sd-price__buy {
  width: 100%;
  margin-top: var(--space-3);
}

.sd-facts {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  font-weight: 600;
}

.sd-price .sp-verdicts {
  margin-top: var(--space-3);
}

.sd-price .sp-sources {
  margin-top: var(--space-3);
}

.sd-price__line .sp-price__seen {
  white-space: nowrap;
}

.sd-count {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.sd-line {
  margin-top: var(--space-2) !important;
  font-size: var(--text-sm);
}

.sd-fold {
  margin-top: var(--space-2);
}

.sd-fold > summary {
  justify-content: space-between;
  list-style: none;
}

.sd-fold > summary::-webkit-details-marker {
  display: none;
}

.sd-fold > summary::after {
  content: "▾" / "";
  color: var(--text-muted);
}

.sd-fold[open] > summary::after {
  content: "▴" / "";
}

.sd-metrics {
  margin-top: var(--space-4) !important;
}

/* Held while the price block is off the screen (set-details-page.js); the component's display would beat [hidden]. */
.sd-actions[hidden] {
  display: none;
}

.sd-actions__price {
  display: grid;
  flex: 1 1 auto;
  margin: 0;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.sd-actions__price b {
  font-size: var(--text-lg);
}

.sd-actions__price span {
  white-space: nowrap;
}

.sd-actions__price small {
  color: var(--text-muted);
  font-size: var(--text-xs);
}
