/* Nabd — the product page: gallery, choices with their prices, protection, delivery, highlights,
   specifications, bundle 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.3fr) 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 photos: one at a time on a panel, thumbnails down the start side on large screens. */
.product__media {
  display: grid;
  gap: 1rem;
}

@media (min-width: 990px) {
  .product__media:has(.product__thumbs) {
    grid-template-columns: 4.75rem minmax(0, 1fr);
  }

  .product__thumbs {
    grid-row: 1;
    grid-column: 1;
  }
}

.product__stage {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  background: var(--media);
}

.product__gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.product__gallery::-webkit-scrollbar {
  display: none;
}

.product__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.product__slide img,
.product__placeholder {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product__badge {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
}

.gallery-status {
  position: absolute;
  inset-block-end: 0.875rem;
  inset-inline: 0;
  display: flex;
  justify-content: center;
}

.gallery-status__count {
  display: none;
}

.gallery-status__dots {
  display: flex;
  gap: 0.375rem;
  direction: ltr;
}

.gallery-status__dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: rgb(11 13 18 / 0.25);
  transition: width 200ms var(--ease), background-color 200ms ease-out;
}

.gallery-status__dot.is-current {
  width: 1.25rem;
  background: #0b0d12;
}

.product__thumbs {
  display: flex;
  gap: 0.625rem;
}

@media (min-width: 990px) {
  .product__thumbs {
    flex-direction: column;
  }

  .gallery-status {
    display: none;
  }
}

@media (max-width: 989px) {
  .product__thumbs {
    display: none;
  }

  .product__stage {
    margin-inline: calc(-1 * var(--gutter));
    border-radius: 0;
  }
}

.product__thumb {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--media);
  transition: border-color 140ms ease-out;
}

.product__thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product__thumb:hover {
  border-color: var(--line-strong);
}

.product__thumb.is-current {
  border: 2px solid var(--fg);
}

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

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

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

.product__vendor .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.product__sku {
  margin: 0;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
}

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

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

.product__specs {
  margin: 0;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--text-small);
}

.product__rating {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-block-start: -0.75rem;
  font-size: var(--text-small);
  text-decoration: none;
}

.product__rating .rating {
  font-size: var(--text-small);
}

.product__rating-link {
  color: var(--fg-muted);
}

.product__rating:hover .product__rating-link {
  text-decoration: underline;
}

.product__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--line);
}

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

.product__pay-later {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-block-start: -0.5rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-control);
  background: var(--bg-raised);
}

.product__pay-later > .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.product__pay-later .pay-later {
  flex: 1;
}

/* Choices: colours by photo, everything else as tiles with their own price. */
.variant-picker {
  display: grid;
  gap: 1.5rem;
}

.variant-picker__option legend,
.protection__legend {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  margin-block-end: 0.75rem;
  color: var(--fg-muted);
  font-size: var(--text-small);
  font-weight: 500;
}

.variant-picker__value {
  color: var(--fg);
}

.variant-values {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.625rem;
}

.variant-values--colour {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

.variant-value input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

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

.variant-value:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

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

.variant-value__name {
  font-weight: 600;
}

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

.variant-value:has(input:checked) .variant-value__price {
  color: var(--fg);
}

.variant-value--unavailable {
  border-style: dashed;
}

.variant-value--unavailable .variant-value__name {
  color: var(--fg-subtle);
  text-decoration: line-through;
}

.variant-value--colour {
  justify-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none !important;
  box-shadow: none !important;
}

.variant-value__photo {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--media);
}

.variant-value__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.variant-value--colour:has(input:checked) .variant-value__photo {
  border: 2px solid var(--fg);
}

.variant-value--colour .variant-value__name {
  color: var(--fg-muted);
  font-size: var(--text-caption);
  font-weight: 400;
}

.variant-value--colour:has(input:checked) .variant-value__name {
  color: var(--fg);
}

/* Protection: "No protection plan" first and chosen; each plan with what it adds. */
.protection {
  display: grid;
  gap: 0.625rem;
}

.protection__legend {
  justify-content: space-between;
  margin-block-end: 0.125rem;
}

.protection__legend .link {
  font-size: var(--text-caption);
}

.plan {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  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;
}

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

.plan:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.plan input {
  margin-block-start: 0.125rem;
}

.plan__text {
  display: grid;
  flex: 1;
  gap: 0.125rem;
}

.plan__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

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

.plan__price {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  font-weight: 600;
  white-space: nowrap;
}

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

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

.buy-row .button .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.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: 3rem;
  padding-inline: 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  cursor: pointer;
}

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

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

.product__tools {
  display: flex;
  gap: 1.5rem;
}

/* Stock and delivery. */
.delivery {
  display: grid;
  gap: 1rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--line);
}

.stock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: var(--text-small);
}

.stock strong {
  color: var(--success);
  font-weight: 600;
}

.stock__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
}

.stock--out strong {
  color: var(--fg-muted);
}

.stock--out .stock__dot {
  background: var(--fg-subtle);
}

.info-lines {
  display: grid;
  gap: 1rem;
}

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

.info-line > .icon {
  width: 1.25rem;
  height: 1.25rem;
}

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

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

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

.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;
}

.product__text--subtle {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-small);
}

/* The bar that keeps Add to cart 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);
  box-shadow: 0 -8px 24px -12px rgb(11 13 18 / 0.18);
  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: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.sticky-buy__summary img {
  border-radius: var(--radius-media);
  background: var(--media);
}

.sticky-buy__title {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

@media (max-width: 749px) {
  .sticky-buy__summary img,
  .sticky-buy__title {
    display: none;
  }

  .sticky-buy__inner {
    padding-block: 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
  }

  .sticky-buy .button {
    flex: 1;
  }

  .has-compare-bar .compare-bar {
    inset-block-end: 5.5rem;
  }
}

/* ---------- Highlights at night ---------- */

.highlights__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 3rem;
  margin-block-end: 2rem;
}

.highlights__heading {
  max-width: 40rem;
  margin: 0;
  font-size: var(--text-h1);
}

:lang(ar) .highlights__heading {
  line-height: 1.4;
}

.highlights__lede {
  max-width: 28rem;
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-lead);
}

.highlights__image {
  width: 100%;
  aspect-ratio: 21 / 8;
  border-radius: calc(var(--radius) + 4px);
  object-fit: cover;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
  margin-block-start: 2rem;
}

@media (min-width: 990px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

.stat__figure {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  margin: 0 0 0.5rem;
}

.stat__value {
  font-size: clamp(2.5rem, 1.8rem + 2.4vw, 4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat__unit {
  color: var(--fg-muted);
  font-size: var(--text-h3);
  font-weight: 500;
}

.stat__caption {
  max-width: 16rem;
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-small);
}

@media (max-width: 749px) {
  .highlights__image {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Specifications: the description as a spec sheet ---------- */

.specs {
  columns: 2 22rem;
  column-gap: 4rem;
}

.specs > * {
  break-inside: avoid;
}

.specs h2,
.specs h3,
.specs h4 {
  margin: 2rem 0 0.5rem;
  font-size: var(--text-h3);
  break-after: avoid;
}

.specs > :first-child {
  margin-block-start: 0;
}

.specs table {
  width: 100%;
  margin-block-end: 1.5rem;
  border-collapse: collapse;
  font-size: var(--text-small);
}

.specs th,
.specs td {
  padding: 0.75rem 0;
  border-block-end: 1px solid var(--line);
  font-weight: 400;
  text-align: start;
  vertical-align: top;
}

.specs tr > :first-child {
  width: 42%;
  padding-inline-end: 1rem;
  color: var(--fg-muted);
}

.specs ul {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.specs li::before {
  content: '✓';
  margin-inline-end: 0.625rem;
  color: var(--success);
  font-weight: 600;
}

.specs p {
  color: var(--fg-muted);
}

/* ---------- Often bought together ---------- */

.bundle {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2.5rem);
  border-radius: calc(var(--radius) + 4px);
  background: var(--bg-raised);
}

@media (min-width: 990px) {
  .bundle {
    grid-template-columns: minmax(0, 1fr) 17rem;
    align-items: center;
  }
}

.bundle__items {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

.bundle__item {
  display: grid;
  gap: 0.625rem;
  width: 10rem;
}

.bundle__image img,
.bundle__image .placeholder {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  border-radius: var(--radius);
  background: var(--media);
  object-fit: cover;
}

.bundle__item .check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: var(--text-small);
  cursor: pointer;
}

.bundle__item .check input {
  margin-block-start: 0.125rem;
}

.bundle__price {
  font-weight: 600;
}

.bundle__plus {
  display: grid;
  place-items: center;
  height: 10rem;
  color: var(--fg-subtle);
}

.bundle__plus .icon {
  width: 1.25rem;
  height: 1.25rem;
}

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

.bundle__total p {
  margin: 0;
}

.bundle__sum {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

@media (max-width: 749px) {
  .bundle__item {
    width: calc(50% - 2rem);
  }

  .bundle__plus {
    height: auto;
    align-self: center;
  }
}

/* ---------- 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;
}
