/* Ramz — the product page (ADR-0070): the card on a dark plinth with the chosen value drawn on it
   and a line saying what it is for; then the platform, the title, numbered steps (the questions a
   top-up asks, the region as pills, the value or pack as tiles), Buy now with the total, Add to
   cart and the delivery promises; then how to redeem and reviews. Loaded on product pages (and by
   the quick view). */

.product-section {
  padding-block: 1.25rem clamp(3rem, 6vw, 4.5rem);
}

.product {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 990px) {
  .product {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: start;
  }

  .product--sticky .product__media {
    position: sticky;
    inset-block-start: calc(var(--header-height) + 1.5rem);
  }
}

/* The card on a plinth: a raised panel with the card centred in it, lit from below. */
.product__media {
  display: grid;
  gap: 0.875rem;
}

.product__stage {
  display: grid;
  place-items: center;
  padding: clamp(1.75rem, 6vw, 4rem) clamp(1.5rem, 6vw, 4.5rem);
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(70% 60% at 50% 100%, color-mix(in oklab, var(--color-text) 7%, transparent), transparent 70%),
    var(--bg-raised);
}

.product__stage .card-face {
  width: 100%;
  max-width: 34rem;
}

.product__caption {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-small);
  text-align: center;
}

/* The buy column. */
.product__info {
  display: grid;
  align-content: start;
  gap: 1.5rem;
}

.product__heading {
  display: grid;
  gap: 0.5rem;
}

.product__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product__vendor {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:lang(ar) .product__vendor {
  text-transform: none;
}

.product__rating {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-small);
  text-decoration: none;
}

.product__rating .icon {
  width: 1rem;
  height: 1rem;
  color: var(--accent);
  fill: currentColor;
}

.product__rating:hover .subtle {
  color: var(--fg);
  text-decoration: underline;
}

.product__title {
  margin: 0;
  font-size: var(--text-h1);
  line-height: 1.2;
}

:lang(ar) .product__title {
  font-weight: 700;
}

.product__intro {
  margin: -0.75rem 0 0;
  color: var(--fg-muted);
  font-size: var(--text-body);
}

.product__price {
  display: grid;
  gap: 0.25rem;
}

/* Steps: a number in the accent, the step's title, and its help link on the end. */
.variant-picker {
  display: grid;
  gap: 1.5rem;
}

.step {
  display: grid;
  gap: 0.875rem;
  min-width: 0;
}

.step__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.step__number {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--button-fg);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.step__title {
  font-size: var(--text-label);
  font-weight: 600;
}

.step__help {
  margin-inline-start: auto;
  color: var(--fg-muted);
  font-size: var(--text-caption);
}

.step__note {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-caption);
}

.step--inputs .customer-inputs {
  display: grid;
  gap: 0.25rem;
}

.step--inputs .field > label:not(.visually-hidden) {
  color: var(--fg-muted);
  font-size: var(--text-small);
}

/* The region: pills with their code; the chosen one raised. */
.region-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.region-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.625rem;
  padding: 0.5rem 0.875rem 0.5rem 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-chip);
  font-size: var(--text-small);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 140ms ease-out, background-color 140ms ease-out;
}

[dir='rtl'] .region-pill {
  padding: 0.5rem 0.625rem 0.5rem 0.875rem;
}

.region-pill:hover {
  border-color: var(--fg);
}

.region-pill:has(input:checked) {
  border-color: transparent;
  background: var(--bg-raised-2);
  font-weight: 600;
}

.region-pill:has(input:checked) .region-code {
  background: var(--fg);
  color: var(--bg);
}

/* Values and packs: tiles with the value large and its price; the chosen one in the accent. */
.value-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.value-tile {
  position: relative;
  display: grid;
  align-content: center;
  gap: 0.375rem;
  min-height: 5.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: border-color 140ms ease-out, background-color 140ms ease-out, box-shadow 140ms ease-out;
}

.value-tile:hover {
  border-color: var(--fg);
}

.value-tile:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 0.5px var(--accent);
}

.value-tile__value {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-heading);
  font-size: var(--text-amount-small);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.value-tile__value .icon {
  width: 1rem;
  height: 1rem;
  color: var(--fg-muted);
}

.value-tile:has(input:checked) .value-tile__value .icon {
  color: var(--accent);
}

.value-tile__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.value-tile__price {
  color: var(--fg-muted);
  font-size: var(--text-small);
}

.value-tile:has(input:checked) .value-tile__price {
  color: var(--fg);
}

.value-tile__bonus {
  color: var(--accent);
  font-size: var(--text-caption);
  font-weight: 700;
}

.value-tile__flag {
  position: absolute;
  inset-block-start: -0.6875rem;
  inset-inline-end: 0.625rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-badge);
  background: var(--accent);
  color: var(--button-fg);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Both kinds of choice: the radio itself is invisible but focusable and announced. */
.variant-value input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.variant-value:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.variant-value--unavailable {
  border-style: dashed;
  color: var(--fg-subtle);
}

.variant-value--unavailable .value-tile__value,
.variant-value--unavailable .value-tile__price {
  color: var(--fg-subtle);
}

.variant-value--unavailable .value-tile__value bdi {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

@media (max-width: 389px) {
  .value-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Buying. */
.product__form {
  display: grid;
  gap: 0.75rem;
}

.buy-row {
  display: flex;
  gap: 0.75rem;
}

.buy-row .button {
  padding-inline: 1.25rem;
  white-space: nowrap;
}

@media (max-width: 389px) {
  .buy-row .button__total {
    display: none;
  }
}

.purchase-options {
  display: grid;
  gap: 0.5rem;
}

.purchase-options legend {
  margin-block-end: 0.5rem;
  color: var(--fg-muted);
  font-size: var(--text-small);
  font-weight: 500;
}

.purchase-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  cursor: pointer;
}

.purchase-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-raised);
}

.purchase-option strong {
  color: var(--accent);
  font-weight: 600;
}

/* The total beside the label: the price times the quantity. */
.button__total {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.button__total::before {
  content: '·';
  opacity: 0.7;
}

/* The promises: an icon, a strong line and a quiet one, under a rule. */
.info-lines {
  display: grid;
  gap: 1rem;
  margin: 0.5rem 0 0;
  padding: 1.5rem 0 0;
  border-block-start: 1px solid var(--line);
  list-style: none;
}

.info-line {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  font-size: var(--text-small);
}

.info-line > .icon {
  width: 1.125rem;
  height: 1.125rem;
  margin-block-start: 0.125rem;
  color: var(--accent);
}

.info-line > span {
  display: grid;
  gap: 0.125rem;
}

.info-line strong {
  font-weight: 600;
}

.info-line .subtle {
  font-size: var(--text-small);
}

.product__whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
}

.product__whatsapp:hover {
  text-decoration: underline;
}

/* The bar that keeps Buy now in reach once the buttons scroll away. */
.sticky-buy {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 25;
  border-block-start: 1px solid var(--line);
  background: var(--bg-raised);
  box-shadow: 0 -12px 32px -12px rgb(0 0 0 / 0.5);
  translate: 0 110%;
  transition: translate 260ms var(--ease);
}

.sticky-buy.is-visible {
  translate: 0 0;
}

.sticky-buy__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.sticky-buy__summary {
  display: grid;
  min-width: 0;
}

.sticky-buy__title {
  overflow: hidden;
  color: var(--fg-muted);
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-buy__price {
  font-weight: 600;
}

@media (max-width: 749px) {
  .sticky-buy__inner {
    padding-block: 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
  }
}

/* ---------- How to redeem: the description after its opening line ---------- */

.redeem__heading {
  margin: 0 0 1.5rem;
  font-size: var(--text-h1);
}

/* A numbered list is the steps: side by side, each number large in the accent. */
.redeem > ol {
  display: grid;
  gap: 1.5rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 750px) {
  .redeem > ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.redeem > ol > li {
  display: grid;
  gap: 0.5rem;
  max-width: 20rem;
  padding: 0;
  border: 0;
  font-weight: 600;
  counter-increment: step;
}

.redeem > ol > li::before {
  content: counter(step, decimal-leading-zero);
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: var(--text-amount);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.redeem > :not(ol) {
  max-width: 42rem;
  color: var(--fg-muted);
}

.redeem > ol + * {
  margin-block-start: 2rem;
}

/* ---------- Reviews ---------- */

.product-reviews {
  display: grid;
  gap: 2rem;
}

@media (min-width: 990px) {
  .product-reviews {
    grid-template-columns: 20rem minmax(0, 1fr);
    gap: 5rem;
    align-items: start;
  }
}

.product-reviews__summary {
  display: grid;
  justify-items: start;
  gap: 0.5rem;
}

.product-reviews__summary h2 {
  margin: 0 0 0.5rem;
}

.product-reviews__average {
  margin: 0;
  font-size: 3.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.product-reviews__summary .rating__stars {
  width: 6rem;
  height: 1.125rem;
  -webkit-mask-size: 1.2rem 1.125rem;
  mask-size: 1.2rem 1.125rem;
}

.product-reviews__summary p {
  margin: 0;
}

.product-reviews__none {
  font-weight: 500;
}

.product-reviews__note {
  font-size: var(--text-small);
}

.review {
  display: grid;
  gap: 0.5rem;
  padding-block: 1.5rem;
  border-block-end: 1px solid var(--line);
}

.review:first-child {
  padding-block-start: 0;
}

.review__title {
  margin: 0.25rem 0 0;
  font-size: var(--text-body);
  font-weight: 600;
}

.review__body {
  margin: 0;
}

.review__photos {
  display: flex;
  gap: 0.5rem;
}

.review__photos img {
  border-radius: var(--radius-media);
  object-fit: cover;
}

.review__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-small);
}

.review__author {
  color: var(--fg);
  font-weight: 500;
}

.review__verified {
  color: var(--success);
}

.review__reply {
  margin-block-start: 0.5rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-control);
  background: var(--bg-raised);
  font-size: var(--text-small);
}

.review__reply p {
  margin: 0;
}

.review__reply-label {
  margin-block-end: 0.25rem !important;
  font-weight: 600;
}

/* Quantity limits under the price (ADR-0076). */
.product__quantity-rule {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-small);
}

/* The heart by the title, pre-orders, bundles, priced answers, back-in-stock requests. */
.product__title-row{display:flex;justify-content:space-between;gap:.75rem}
.wishlist-toggle--page .wishlist-toggle__button{border:1px solid var(--line)}
.preorder-note,.stock-alert__title{display:flex;align-items:center;gap:.5rem;margin:0 0 .875rem;font-size:var(--text-small)}
.stock-alert__title{margin:0;font-weight:600}
.preorder-note[hidden],.stock-alert[hidden],.stock-alert__done,.stock-alert__error,.stock-alert.is-done .stock-alert__row{display:none}
.preorder-note svg,.stock-alert__title svg{width:1.125rem;height:1.125rem}
.preorder-note__detail,.bundle-item__variant,.bundle-item__quantity,.field__price{color:var(--fg-muted)}
.bundle-items{margin:0 0 1.25rem;padding-block:1rem;border-block:1px solid var(--line);font-size:var(--text-small)}
.bundle-items__title{margin:0;font-weight:600}
.bundle-items__list{display:grid;gap:.5rem;margin:.75rem 0 0;padding:0;list-style:none}
.bundle-item{display:flex;align-items:center;gap:.75rem}
.bundle-item__image{width:3rem;height:3rem;border-radius:var(--radius);object-fit:cover}
.bundle-item a{color:inherit}
.bundle-items__savings{margin:.75rem 0 0;color:var(--sale)}
.stock-alert{display:grid;gap:.75rem;margin-block-start:1rem;padding:1rem;border:1px solid var(--line);border-radius:var(--radius)}
.stock-alert__row{display:flex;flex-wrap:wrap;gap:.5rem}
.stock-alert__row input{flex:1 1 12rem}
.stock-alert__error{color:var(--sale)}
.stock-alert.is-done .stock-alert__done,.stock-alert.is-error .stock-alert__error,.stock-alert__done:target,.stock-alert__error:target{display:block;margin:0;font-size:var(--text-small)}

.product__earns {
  margin-block: 0.5rem 0;
  color: var(--fg-muted);
  font-size: var(--text-small);
}

.price-breaks {
  width: 100%;
  margin-block: 0.75rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.price-breaks caption {
  padding-block-end: 0.375rem;
  font-weight: 600;
  text-align: start;
}
.price-breaks th,
.price-breaks td {
  padding-block: 0.375rem;
  border-block-start: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  font-weight: 400;
  text-align: start;
}
.price-breaks td:last-child {
  text-align: end;
}
