/* Family buy page: sticky gallery (right in RTL), stepped configuration (left), sticky summary. */

.p136-notices:empty { display: none; }
.p136-buy { --buy-top: calc(var(--p136-header-h) + 20px); padding-block-end: var(--p136-s7); }
.p136-buy__crumbs { padding-block: 12px 0; font-size: var(--p136-fs-small); }

/* Without JS the configurator can't work: hide it and let the <noscript> list take over. */
html:not(.p136-js) .p136-steps,
html:not(.p136-js) .p136-summary,
html:not(.p136-js) .p136-soldout-box,
html:not(.p136-js) .p136-buybar { display: none; }

/* Sticky title bar --------------------------------------------------------------- */
.p136-buybar {
  position: sticky;
  top: var(--p136-header-h);
  z-index: var(--p136-z-sticky);
  height: 52px;
  margin-block-end: -52px;
  border-bottom: 1px solid var(--p136-line-soft);
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity var(--p136-t-med) var(--p136-ease), transform var(--p136-t-med) var(--p136-ease-out);
}
.p136-buybar.is-compact { opacity: 1; transform: none; pointer-events: auto; }
.p136-buybar__inner { display: flex; align-items: center; gap: 20px; height: 100%; }
.p136-buybar__name { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.p136-buybar__name strong { font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p136-buybar__price { color: var(--p136-ink-2); font-size: var(--p136-fs-small); white-space: nowrap; }
.p136-buybar__deposit { margin-inline-start: auto; color: var(--p136-muted); font-size: var(--p136-fs-small); white-space: nowrap; }
.p136-buybar__chips { display: flex; gap: 14px; color: var(--p136-muted); font-size: var(--p136-fs-small); }
.p136-buybar__chips li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.p136-buybar__chips .p136-icon { width: 14px; height: 14px; }

/* Grid ------------------------------------------------------------------------------- */
.p136-buy__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  padding-block-start: 8px;
  align-items: start;
}
.p136-buy__media { position: sticky; top: var(--buy-top); }
.p136-buy__config { min-width: 0; }

/* Gallery ---------------------------------------------------------------------------- */
.p136-gallery { display: grid; gap: 8px; }
.p136-gallery__stage {
  position: relative;
  height: min(70vh, 540px);
  border-radius: var(--p136-r-md);
  background: var(--p136-surface);
  overflow: hidden;
}
.p136-gallery__track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.p136-gallery__track::-webkit-scrollbar { display: none; }
.p136-gallery__slide {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  height: 100%;
  padding: clamp(16px, 3vw, 32px);
  scroll-snap-align: center;
}
.p136-gallery__slide img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.p136-gallery__slide--film { padding: 0; background: #000; }
.p136-gallery__slide--film .p136-video { width: 100%; height: 100%; }
.p136-gallery__arrow {
  position: absolute;
  inset-block-end: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--p136-shadow-sm);
  color: var(--p136-ink);
  transition: transform var(--p136-t-fast) var(--p136-ease);
}
.p136-gallery__arrow .p136-icon { width: 16px; height: 16px; }
.p136-gallery__arrow:hover { transform: scale(1.06); }
.p136-gallery__arrow--next { inset-inline-end: 12px; }
.p136-gallery__arrow--prev { inset-inline-start: 12px; }
.p136-gallery__arrow--prev .p136-icon { transform: scaleX(-1); }
.p136-gallery__dots { display: flex; justify-content: center; gap: 0; min-height: 24px; }
.p136-gallery__dot { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; }
.p136-gallery__dot::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--p136-line);
  transition: background-color var(--p136-t-fast) var(--p136-ease), transform var(--p136-t-fast) var(--p136-ease);
}
.p136-gallery__dot[aria-current="true"]::before { background: var(--p136-ink); transform: scale(1.2); }

/* Intro ------------------------------------------------------------------------------- */
.p136-buy__intro { padding-block-end: 20px; }
.p136-buy__intro .p136-eyebrow { margin-block-end: 4px; }
.p136-buy__title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); line-height: var(--p136-lh-display); font-weight: 800; }
.p136-buy__title strong, .p136-buy__title bdi { color: var(--p136-ink); }
.p136-buy__lead { margin-block-start: 8px; color: var(--p136-muted); font-size: var(--p136-fs-body); max-width: 44ch; }

/* Steps: one active stage, finished ones collapse to a row, upcoming ones only show a dim heading -- */
.p136-steps { display: grid; }
.p136-step {
  position: relative;
  padding-block: 24px;
  border-top: 1px solid var(--p136-line-soft);
  scroll-margin-top: calc(var(--p136-header-h) + 68px);
  transition: opacity var(--p136-t-med) var(--p136-ease);
}
.p136-step__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.p136-step__title { font-size: 1.5rem; line-height: 1.35; font-weight: 700; }
.p136-step__title strong { color: var(--p136-ink); font-weight: 800; }
.p136-step__title span { color: var(--p136-faint); font-weight: 600; }
.p136-step__summary { display: none; align-items: center; gap: 12px; margin: 0; font-weight: 600; font-size: var(--p136-fs-body); min-width: 0; }
.p136-step__value { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--p136-ink); }
.p136-step__value .p136-swatch { width: 14px; height: 14px; }
.p136-step__edit {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--p136-accent);
  font-size: var(--p136-fs-small);
  font-weight: 600;
  cursor: pointer;
}
.p136-step__edit:hover { text-decoration: underline; text-underline-offset: 3px; }
.p136-step__edit[hidden] { display: none; }
.p136-step__fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.p136-step__body { margin-block-start: 20px; }
.p136-step__next { display: none; margin-block-start: 16px; min-height: 40px; padding: 0 24px; border: 0; border-radius: var(--p136-r-pill); background: var(--p136-ink); color: #fff; font-weight: 600; font-size: 0.9375rem; cursor: pointer; }
.p136-step__next:hover { background: #000; }
.p136-step.is-active .p136-step__next { display: inline-flex; align-items: center; }
.p136-step .p136-help { margin-block-start: 12px; }

/* Active: full strength, options visible (fades in; nothing else moves) */
.p136-step.is-active .p136-step__body { animation: p136-stage-in var(--p136-t-med) var(--p136-ease-out); }
@keyframes p136-stage-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Done: one line, «رنگ · مشکی · تغییر» */
.p136-step.is-done { padding-block: 14px; cursor: pointer; }
.p136-step.is-done .p136-step__body { display: none; }
.p136-step.is-done .p136-step__title { flex: none; min-width: 96px; font-size: var(--p136-fs-small); font-weight: 600; color: var(--p136-muted); }
.p136-step.is-done .p136-step__title strong { color: var(--p136-muted); font-weight: 600; }
.p136-step.is-done .p136-step__title span, .p136-step.is-done .p136-step__dot { display: none; }
.p136-step.is-done .p136-step__head { flex-wrap: nowrap; align-items: center; }
.p136-step.is-done .p136-step__summary { display: flex; flex: 1; justify-content: space-between; }
.p136-step.is-done[data-single="1"] { cursor: default; }

/* Upcoming: just a dim heading */
.p136-step.is-upcoming { opacity: 0.35; padding-block: 18px; }
.p136-step.is-upcoming .p136-step__body { display: none; }
.p136-step.is-upcoming .p136-step__title { font-size: 1.125rem; }
.p136-step.is-upcoming .p136-step__title span { display: none; }

/* Scroll focus: while a step holds the eye, the others recede */
/* Finished rows are already muted (and must stay >= 4.5:1), so only an active step that left the eye's centre recedes. */
.p136-steps.has-focus .p136-step.is-active:not(.is-focus) { opacity: 0.6; }
.p136-steps.has-focus .p136-step.is-active:not(.is-focus):hover,
.p136-steps.has-focus .p136-step.is-active:not(.is-focus):focus-within { opacity: 1; }

.p136-choice__price:empty, .p136-choice__note:empty { display: none; }
.p136-choice__price { font-weight: 600; color: var(--p136-ink); }
.p136-choice__note { font-size: var(--p136-fs-small); color: var(--p136-warn); font-weight: 600; }
.p136-choice.is-soldout .p136-choice__body { background: var(--p136-surface-2); }
.p136-choice.is-soldout .p136-choice__title { color: var(--p136-ink-2); }
.p136-choice > input:disabled + .p136-choice__body .p136-choice__note { color: var(--p136-faint); }

/* Model: two-up cards */
.p136-choice-grid--model { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p136-choice-grid--model .p136-choice__body { min-height: 84px; }
/* Prices are filled in by JS: keep their line reserved so nothing moves when they appear. */
.p136-choice:not(.p136-choice--swatch) .p136-choice__price:empty { display: block; min-height: 1.4em; }
/* Capacity: compact grid */
.p136-choice-grid--capacity { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.p136-choice-grid--capacity .p136-choice__body { min-height: 96px; }
/* Status / edition / warranty: slim list rows, price on the far side */
.p136-choice-grid--list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.p136-choice-grid--list .p136-choice__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title price" "sub note";
  align-items: center;
  column-gap: 16px;
  min-height: 64px;
}
.p136-choice-grid--list .p136-choice__title { grid-area: title; }
.p136-choice-grid--list .p136-choice__sub { grid-area: sub; }
.p136-choice-grid--list .p136-choice__price { grid-area: price; justify-self: end; }
.p136-choice-grid--list .p136-choice__note { grid-area: note; justify-self: end; }

/* Colour swatches: circles with a name below (Apple "Finish") */
.p136-choice-grid--swatch { display: flex; flex-wrap: wrap; gap: 8px 4px; }
.p136-choice--swatch { flex: 0 0 auto; }
.p136-choice--swatch .p136-choice__body {
  align-items: center;
  min-height: 0;
  width: 84px;
  padding: 8px 4px;
  border: 0;
  border-radius: var(--p136-r-sm);
  background: transparent;
  text-align: center;
  gap: 8px;
}
.p136-choice--swatch:hover .p136-choice__body { border: 0; background: var(--p136-surface); }
.p136-choice--swatch .p136-swatch--lg { width: 40px; height: 40px; transition: box-shadow var(--p136-t-fast) var(--p136-ease); }
.p136-choice--swatch .p136-choice__title { font-size: var(--p136-fs-small); font-weight: 600; line-height: 1.4; }
.p136-choice--swatch > input:checked + .p136-choice__body { border: 0; box-shadow: none; }
.p136-choice--swatch > input:checked + .p136-choice__body .p136-swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--p136-accent); }
.p136-choice--swatch > input:focus-visible + .p136-choice__body { outline: 3px solid var(--p136-focus); outline-offset: 2px; }
.p136-choice--swatch > input:disabled + .p136-choice__body { background: transparent; border: 0; opacity: 0.4; }

/* Colour finishes without a sampled hex: labelled chips instead of empty dots. */
.p136-choice--chip { flex: 0 0 auto; }
.p136-choice--chip .p136-choice__body { min-height: 44px; padding: 8px 18px; border-radius: var(--p136-r-pill); flex-direction: row; align-items: center; }
.p136-choice-grid--swatch .p136-choice--chip .p136-choice__title { font-size: 0.9375rem; }

/* Summary: compact bar (name + total + add) that expands into the full breakdown ------------- */
.p136-summary {
  position: sticky;
  bottom: 16px;
  z-index: var(--p136-z-sticky);
  margin-block-start: 24px;
  padding: 10px 16px;
  border: 1px solid var(--p136-line-soft);
  border-radius: var(--p136-r-md);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: var(--p136-shadow-md);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "detail detail" "toggle cta" "error error";
  align-items: center;
  gap: 4px 16px;
}
.p136-summary__toggle {
  grid-area: toggle;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
}
.p136-summary__detail { grid-area: detail; display: none; padding-block-end: 8px; }
.p136-summary.is-open .p136-summary__detail { display: block; }
.p136-summary__cta { grid-area: cta; display: grid; gap: 8px; }
.p136-summary__cta .p136-btn { width: auto; min-width: 160px; }
.p136-summary__error { grid-area: error; margin-block-start: 6px; color: var(--p136-danger); font-size: var(--p136-fs-small); font-weight: 600; }
.p136-summary__mini { display: grid; gap: 0; flex: 1; min-width: 0; min-height: 44px; align-content: center; }
.p136-summary__label { color: var(--p136-muted); font-size: var(--p136-fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p136-summary__total { font-size: 1.125rem; line-height: 1.4; font-weight: 700; }
.p136-summary__total:empty { display: none; }
.p136-summary__chev { display: inline-block; flex: none; width: 8px; height: 8px; border: solid var(--p136-ink-2); border-width: 2px 2px 0 0; transform: rotate(-45deg); transition: transform var(--p136-t-med) var(--p136-ease); }
.p136-summary.is-open .p136-summary__chev { transform: rotate(135deg); }
.p136-summary__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 8px 4px; }
.p136-summary__chips .p136-chip { unicode-bidi: plaintext; min-height: 28px; font-size: var(--p136-fs-small); background: var(--p136-surface); border-color: transparent; }
.p136-summary__lines { margin-block: 8px; display: grid; gap: 6px; }
.p136-summary__lines > div { display: flex; justify-content: space-between; gap: 16px; font-size: 0.875rem; }
.p136-summary__lines dt { color: var(--p136-muted); }
.p136-summary__lines dd { font-weight: 600; }
.p136-summary__lines .is-strong dt { color: var(--p136-ink); font-weight: 700; }
.p136-summary__lines .is-strong dd { color: var(--p136-accent); font-weight: 700; }
.p136-summary__demo { margin-block-start: 8px; font-size: var(--p136-fs-small); color: var(--p136-muted); }
.p136-summary[data-state="soldout"] .p136-summary__total { display: none; }

/* Sold-out box */
.p136-soldout-box {
  display: grid;
  gap: 12px;
  margin-block: 24px;
  padding: 20px;
  border-radius: var(--p136-r-md);
  background: var(--p136-surface);
}
.p136-soldout-box h2 { font-size: var(--p136-fs-h4); }
.p136-soldout-box p { color: var(--p136-muted); font-size: 0.875rem; }
.p136-successors { display: grid; gap: 8px; }
.p136-successors a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--p136-r-sm);
  background: #fff;
  color: var(--p136-ink);
  font-size: 0.9375rem;
  font-weight: 600;
}
.p136-successors a span { color: var(--p136-muted); font-weight: 500; }
.p136-soldout-box .p136-btn { justify-self: start; }

/* Added-to-bag sheet ------------------------------------------------------------------ */
.p136-added__item { margin-block-end: 16px; font-weight: 600; color: var(--p136-ink-2); }
.p136-added__h { margin-block: 24px 12px; font-size: var(--p136-fs-h4); }
.p136-added__acc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.p136-added__acc a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--p136-r-sm); background: var(--p136-surface); color: var(--p136-ink); }
.p136-added__acc img { width: 56px; height: 56px; object-fit: contain; mix-blend-mode: multiply; flex: none; }
.p136-added__acc span { display: grid; font-size: 0.875rem; font-weight: 600; line-height: 1.5; }
.p136-added__acc small { color: var(--p136-muted); font-weight: 400; }

.p136-help-list { display: grid; gap: 16px; }
.p136-help-list dt { font-weight: 700; margin-block-end: 4px; }
.p136-help-list dd { color: var(--p136-ink-2); font-size: 0.9375rem; }
.p136-fine { margin-block-start: 16px; font-size: var(--p136-fs-small); }

/* No-JS list ---------------------------------------------------------------------------- */
.p136-native { padding-block: 24px; }
.p136-native__list { display: grid; gap: 8px; margin-block-start: 16px; }
.p136-native__list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--p136-r-sm); background: var(--p136-surface); }

/* Below the fold ------------------------------------------------------------------------- */
.p136-below { display: grid; gap: clamp(40px, 6vw, 64px); padding-block-start: var(--p136-section); }
.p136-below .p136-headline { margin-block-end: 16px; font-size: var(--p136-fs-h3); }
.p136-below .p136-card--pad { padding: var(--p136-s5); }
.p136-below .p136-accordion summary { padding-block: 16px; font-size: 1rem; }
.p136-below .p136-accordion .p136-accordion__body { padding-block-end: 20px; font-size: 0.9375rem; }
.p136-specs { display: grid; }
.p136-specs > div { display: grid; grid-template-columns: minmax(120px, 0.6fr) 1.4fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--p136-line-soft); font-size: 0.9375rem; }
.p136-specs dt { color: var(--p136-muted); }
.p136-specs dd { overflow-wrap: anywhere; }
.p136-prose ul { list-style: disc; padding-inline-start: 1.2em; display: grid; gap: 6px; }

/* Responsive ------------------------------------------------------------------------------ */
@media (max-width: 1068px) {
  .p136-buy__grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .p136-buy__media { position: static; }
  .p136-gallery__stage { height: min(72vw, 420px); }
  .p136-buybar__chips, .p136-buybar__deposit { display: none; }
}

@media (max-width: 734px) {
  .p136-buy { padding-block-end: 96px; }
  .p136-buybar { height: 48px; margin-block-end: -48px; }
  .p136-buy__title { font-size: 1.5rem; }
  .p136-step { padding-block: 20px; scroll-margin-top: calc(var(--p136-header-h) + 60px); }
  .p136-step__title { font-size: 1.375rem; }
  .p136-step__body { margin-block-start: 16px; }
  .p136-choice-grid--model { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p136-choice-grid--capacity { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Bottom sheet summary */
  .p136-summary {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    margin: 0;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    border-inline: 0;
    border-bottom: 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    gap: 4px 12px;
  }
  .p136-summary__total { font-size: 1.0625rem; }
  .p136-summary__cta .p136-btn { min-width: 0; padding-inline: 20px; }
  .p136-added__acc { grid-template-columns: minmax(0, 1fr); }
  .p136-specs > div { grid-template-columns: minmax(96px, 0.7fr) 1.3fr; }
  .p136-choice--swatch .p136-choice__body { width: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .p136-step, .p136-step.is-active .p136-step__body { transition: none; animation: none; }
}

/* Keep the floating specialist button clear of the sticky summary. */
html:has([data-p136-buy]) { --p136-float-bottom: 84px; }
