/* Ritaj Simsim: product page (gallery, order form at the top, details, sticky order bar). */

.rs-pd {
  display: block;
  padding-block: 8px 0;
}

.rs-pd__crumbs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  font-size: 14px;
  color: var(--rs-muted);
  white-space: nowrap;

  a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--rs-primary);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }

  [aria-current] {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.rs-pd__top {
  display: grid;
  gap: 20px;
}

/* Gallery: photos are always shown whole (contain), on a soft sand backdrop. */
.rs-gallery {
  min-width: 0;
}

.rs-gallery__stage {
  position: relative;
}

.rs-gallery__viewport {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  border-radius: var(--rs-radius-lg);
  background:
    radial-gradient(circle at 50% 38%, #fffaf1, transparent 72%),
    var(--rs-sand-100);
  border: 1px solid var(--rs-line);

  &::-webkit-scrollbar {
    display: none;
  }
}

/* The slides stay square whatever the photos' shape (2026-11-11): a tall photo (9:16, watch gallery) used to make its
   slide taller than the square, and the whole carousel followed it (a flex row takes its tallest item), so square
   photos floated in a tall box between two empty bands. min-block-size: 0 lets the square win; a tall photo is shown
   whole inside it (contain). */
.rs-gallery__slide {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  min-block-size: 0;
  margin: 0;
  padding: 12px;
  scroll-snap-align: center;

  > button {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-block-size: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
  }

  img {
    display: block;
    width: 100%;
    height: 100%;
    min-block-size: 0;
    object-fit: contain;
  }

  iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
  }
}

.rs-gallery__slide--empty {
  color: var(--rs-accent);
  background-image: var(--rs-star);
  background-size: 56px;
}

.rs-gallery__video {
  cursor: pointer !important;

  img {
    object-fit: cover;
  }
}

.rs-gallery__play {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  translate: -50% -50%;
  border-radius: 50%;
  color: var(--rs-bg);
  background-color: color-mix(in srgb, var(--rs-primary) 88%, transparent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--rs-bg) 45%, transparent);
  transition: transform 0.3s var(--rs-ease);

  .rs-icon {
    margin-inline-start: 4px;
  }
}

[dir="rtl"] .rs-gallery__play {
  translate: 50% -50%;
}

.rs-gallery__video:hover .rs-gallery__play {
  transform: scale(1.08);
}

.rs-gallery__count {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rs-text);
  background-color: color-mix(in srgb, var(--rs-bg) 85%, transparent);
  direction: ltr;
}

.rs-gallery__arrow {
  position: absolute;
  inset-block-start: calc(50% - 22px);
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  color: var(--rs-primary);
  background-color: color-mix(in srgb, var(--rs-bg) 92%, transparent);
  box-shadow: var(--rs-shadow-soft);
  cursor: pointer;
  transition:
    transform 0.25s var(--rs-ease),
    opacity 0.25s;

  &:hover {
    transform: scale(1.06);
  }

  &[disabled] {
    opacity: 0;
    pointer-events: none;
  }
}

.rs-gallery__arrow--prev {
  inset-inline-start: 12px;

  .rs-icon {
    transform: scaleX(-1);
  }
}

[dir="rtl"] .rs-gallery__arrow--prev .rs-icon {
  transform: none;
}

.rs-gallery__arrow--next {
  inset-inline-end: 12px;
}

/* Every thumbnail stays in sight: when they do not fit on one line they wrap onto the next (a sideways strip
   with a hidden scrollbar left the last photos unseen on phones). */
.rs-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 10px;
  padding-block-end: 2px;
}

.rs-gallery__thumb {
  position: relative;
  flex: 0 0 64px;
  height: 64px;
  padding: 6px;
  overflow: hidden;
  border-radius: 12px;
  border: 1.5px solid var(--rs-line);
  background-color: var(--rs-sand-100);
  cursor: pointer;
  opacity: 0.72;
  transition:
    opacity 0.2s,
    border-color 0.2s;

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  &[aria-current="true"] {
    opacity: 1;
    border-color: var(--rs-primary);
  }

  &:hover {
    opacity: 1;
  }
}

.rs-gallery__thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--rs-bg);
  background-color: rgb(46 32 24 / 0.35);
}

/* Buy box */
.rs-pd__buy {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.rs-pd__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rs-pd__title {
  font-weight: 700;
  font-size: clamp(23px, 1.1rem + 1.2vw, 32px);
  line-height: 1.45;
  text-wrap: balance;
}

/* The YouCan (English) name, under the Arabic one (rs-name) */
.rs-pd__alt {
  display: block;
  margin-block-start: 4px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--rs-muted);
}

.rs-pd__share {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rs-line);
  color: var(--rs-primary);
  background-color: var(--rs-surface);
  cursor: pointer;
  transition: background-color 0.2s;

  &:hover {
    background-color: var(--rs-sand-100);
  }

  &.is-done {
    color: var(--rs-bg);
    background-color: var(--rs-primary);
  }
}

.rs-pd__price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.rs-pd__now {
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
  color: var(--rs-primary);
}

.rs-pd__was {
  font-size: 18px;
  color: var(--rs-muted);
}

.rs-pd__save {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--rs-dark);
  background-color: color-mix(in srgb, var(--rs-accent) 42%, var(--rs-bg));
}

/* Average of the reviews at the end of the price line, a link down to them */
.rs-pd__rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-inline-start: auto;
  font-weight: 700;
  font-size: 14px;
  color: var(--rs-text);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color 0.2s;

  &:hover {
    text-decoration-color: var(--rs-accent);
  }
}

.rs-pd__cod {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-start: -6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--rs-muted);

  .rs-icon {
    color: var(--rs-gold);
  }
}

.rs-pd__facts {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--rs-radius);
  background-color: var(--rs-surface);
  border: 1px solid var(--rs-line);

  li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
  }

  .rs-icon {
    color: var(--rs-primary);
  }
}

.rs-pd__dot {
  position: relative;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-inline: 5px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
}

/* Delivery zone of the product (e.g. the UAE only), taken from the description's 📍 line: the country's flag and the
   sentence, under the price, so nobody orders from a country the product does not reach */
.rs-pd__zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--rs-gold) 60%, transparent);
  border-radius: var(--rs-radius);
  background-color: color-mix(in srgb, var(--rs-gold) 16%, var(--rs-bg));

  p {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--rs-dark);
    text-wrap: pretty;
  }

  > .rs-icon {
    flex-shrink: 0;
    color: var(--rs-primary);
  }
}

.rs-pd__flags {
  display: inline-flex;
  flex-shrink: 0;
  gap: 4px;
  vertical-align: middle;
}

/* A thin dark ring keeps the white stripes of a flag readable on the cream and sand backgrounds */
.rs-flag {
  display: block;
  inline-size: auto;
  block-size: 18px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rs-dark) 22%, transparent);
}

.rs-pd-trust .rs-flag {
  block-size: 14px;
  border-radius: 2px;
}

/* Shown by rs-product.js when the visitor seems to browse from a country outside the zone */
.rs-pd__zone-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #9a5a00 45%, transparent);
  border-radius: var(--rs-radius);
  font-size: 16px;
  line-height: 1.6;
  color: var(--rs-dark);
  background-color: color-mix(in srgb, #9a5a00 9%, var(--rs-bg));

  &[hidden] {
    display: none;
  }

  .rs-icon {
    flex-shrink: 0;
    margin-block-start: 3px;
    color: #9a5a00;
  }

  strong {
    display: block;
    color: #7a4700;
  }
}

.rs-pd__stock {
  &[data-inventory="in-stock"] {
    color: #2c6e3f;
  }

  &[data-inventory="low-stock"] {
    color: #9a5a00;
  }

  &[data-inventory="out-of-stock"] {
    color: #9b2c22;
  }
}

/* Order form */
.rs-pd__form {
  display: grid;
  gap: 16px;
  padding: 18px 16px;
  border-radius: var(--rs-radius-lg);
  background:
    linear-gradient(180deg, #fffdf8, var(--rs-surface));
  border: 1.5px solid color-mix(in srgb, var(--rs-accent) 70%, transparent);
  box-shadow: var(--rs-shadow);
  scroll-margin-top: 96px;
}

.rs-pd__form-head {
  display: grid;
  gap: 4px;

  p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--rs-muted);
  }
}

.rs-pd__form-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;

  &::before {
    content: "";
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    rotate: 45deg;
    border-radius: 2px;
    background-color: var(--rs-accent);
  }
}

/* Store checkout fields (rendered by core-express-checkout) and variants, in the brand style */
.rs-pd ui-express-checkout {
  display: grid;
  gap: 12px;
}

.rs-pd [ui-express-checkout-field] {
  display: grid;
  gap: 6px;

  [ui-express-checkout-label] {
    font-size: 15px;
    font-weight: 600;
  }

  &:has(input:required, select:required, textarea:required) [ui-express-checkout-label]::after {
    content: " *";
    color: var(--rs-gold);
  }

  & > input,
  & > select,
  & > textarea,
  & :is([ui-phone-number], [ui-phone-countries-wrapper]) {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--rs-sand-200);
    background-color: var(--rs-bg);
    font: 400 16px/1.5 var(--font-family);
    color: var(--rs-text);
    transition:
      border-color 0.2s,
      box-shadow 0.2s;

    &::placeholder {
      color: color-mix(in srgb, var(--rs-text) 45%, transparent);
    }

    &:focus {
      outline: none;
      border-color: var(--rs-primary);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--rs-primary) 18%, transparent);
    }
  }

  &[error-message]::after {
    content: attr(error-message);
    font-size: 14px;
    color: #9b2c22;
  }
}

/* YouCan's phone validator: country code on a fixed width, the number takes the rest of the line. */
.rs-pd [ui-express-checkout-field] [ui-phone-input-wrapper] {
  display: flex;
  gap: 8px;

  [ui-phone-countries-wrapper] {
    flex: 0 0 104px;
    width: 104px;
    display: flex;
    align-items: center;
  }

  [ui-phone-displayed-country-code] {
    flex: 1;
    gap: 8px;
  }

  [ui-phone-number] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
}

/* Phone numbers read left to right, also on the Arabic page. */
.rs-pd :is(input[inputmode="tel"], [ui-phone-input-wrapper]) {
  direction: ltr;
}

/* Its direction is ltr, so "end" puts the number on the right, under its Arabic label. */
[dir="rtl"] .rs-pd input[inputmode="tel"] {
  text-align: end;
}

/* .rs-pd__form outweighs misc.variants.css, which loads later. */
.rs-pd .rs-pd__form [ui-variants] {
  display: grid;
  gap: 14px;

  [ui-variant-label] {
    font-size: 15px;
    font-weight: 600;
  }

  /* Link to the size guide, between the size label and its buttons (rs-product.js) */
  .rs-size-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-block: -6px -4px;
    font-size: 14.5px;
    color: var(--rs-muted);
    text-decoration: none;

    span {
      font-weight: 600;
      color: var(--rs-primary);
      text-decoration: underline;
      text-underline-offset: 4px;
    }
  }

  .rs-variant-value {
    font-weight: 400;
    color: var(--rs-muted);
  }

  [ui-variant]:not([ui-variant="radio_buttons"], [ui-variant="color_base_buttons"], [ui-variant="image_based_buttons"]) [ui-variant-opt] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 600;
    background-color: var(--rs-bg);
    border: 1.5px solid var(--rs-sand-200);

    &:hover:not(:has(input:disabled)) {
      border-color: var(--rs-primary);
    }
  }

  [ui-variant]:not([ui-variant="radio_buttons"], [ui-variant="color_base_buttons"]) [ui-variant-opt]:has(> input:checked) {
    color: var(--rs-bg);
    background-color: var(--rs-primary);
    border-color: var(--rs-primary);
  }

  [ui-variant="color_base_buttons"] [ui-variant-opt] {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid var(--rs-sand-200);
    background-color: var(--variant-color);
    box-shadow: inset 0 0 0 3px var(--rs-bg);
    cursor: pointer;

    &:has(> input:checked) {
      border-color: var(--rs-primary);
      box-shadow:
        inset 0 0 0 3px var(--rs-bg),
        0 0 0 2px var(--rs-primary);
    }
  }

  [ui-variant="image_based_buttons"] [ui-variant-opt] {
    width: 72px;
    height: 72px;
    padding: 0;
    border-radius: 14px;
    border: 1.5px solid var(--rs-sand-200);
    overflow: hidden;
    cursor: pointer;

    &:has(> input:checked) {
      border-color: var(--rs-primary);
    }
  }

  [ui-variant="dropdown"] [ui-variant-options] {
    min-height: 50px;
    border-radius: 14px;
    border: 1px solid var(--rs-sand-200);
    background-color: var(--rs-bg);
    font: 600 16px/1.4 var(--font-family);
  }
}

/* Quantity, total, order and add-to-cart buttons */
.rs-pd__cta {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-areas:
    "label qty total"
    "buy buy buy"
    "cart cart cart";
  align-items: center;
  gap: 12px;
}

.rs-pd__qty-label {
  grid-area: label;
  font-size: 15px;
  font-weight: 600;
}

.rs-pd__total {
  grid-area: total;
  justify-self: end;
  font-size: 14px;
  color: var(--rs-muted);
  white-space: nowrap;

  strong {
    font-size: 18px;
    color: var(--rs-text);
  }
}

.rs-pd ui-quantity {
  grid-area: qty;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--rs-sand-200);
  background-color: var(--rs-bg);

  button[ui-button] {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--rs-primary);
    background-color: var(--rs-sand-100);
    cursor: pointer;

    &:hover:not([disabled]) {
      background-color: var(--rs-sand-200);
    }

    &[disabled] {
      opacity: 0.4;
      cursor: not-allowed;
    }
  }

  .value {
    min-width: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 17px;
  }
}

.rs-pd__buy-button {
  grid-area: buy;
}

.rs-pd__cart-button {
  grid-area: cart;
}

.rs-pd :is(.rs-pd__buy-button, .rs-pd__cart-button) {
  display: block;

  .rs-btn {
    width: 100%;
  }

  .rs-btn[data-loading] {
    pointer-events: none;
    color: transparent;

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      margin: auto;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: 2.5px solid var(--rs-bg);
      border-inline-end-color: transparent;
      animation: rs-spin 0.8s linear infinite;
    }
  }

  .rs-btn--outline[data-loading]::before {
    border-color: var(--rs-primary);
    border-inline-end-color: transparent;
  }

  .rs-btn--order[data-loading]::before {
    border-color: var(--rs-dark);
    border-inline-end-color: transparent;
  }

  .rs-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
  }
}

.rs-pd .rs-pd__buy-button .rs-btn {
  padding-inline: 18px;
  font-size: clamp(16px, 4.2vw, 18px);
  white-space: nowrap;
}

@keyframes rs-spin {
  to {
    transform: rotate(1turn);
  }
}

.rs-pd__reassure {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--rs-muted);

  li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .rs-icon {
    color: var(--rs-gold);
  }
}

.rs-pd__pitch {
  padding: 16px 18px;
  border-radius: var(--rs-radius);
  background-color: var(--rs-sand-100);
  font-size: 16px;
  line-height: 1.85;

  .rs-pd__pitch-title {
    font-weight: 700;
    color: var(--rs-primary);
  }
}

/* Trust strip */
.rs-pd-trust {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-block: 36px 0;

  li {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 16px 10px;
    text-align: center;
    border-radius: var(--rs-radius);
    background-color: var(--rs-surface);
    border: 1px solid var(--rs-line);
  }

  .rs-icon {
    margin-block-end: 4px;
    color: var(--rs-primary);
  }

  strong {
    font-size: 15px;
    font-weight: 700;
  }

  span {
    font-size: 13px;
    line-height: 1.55;
    color: var(--rs-muted);
  }

  /* The product's delivery zone: flag beside the sentence, never inside its lines */
  .rs-pd-trust__zone {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;

    .rs-pd__flags {
      margin-block-start: 3px;
    }
  }
}

/* Details: the description, with a sticky list of its parts */
.rs-pd-details {
  padding-block: 48px 8px;

  .rs-pd-details__head {
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
  }
}

.rs-pd-details__nav {
  position: sticky;
  z-index: 5;
  inset-block-start: 72px;
  display: flex;
  gap: 8px;
  margin-block: 20px 8px;
  margin-inline: calc(var(--rs-gutter) * -1);
  padding: 10px var(--rs-gutter);
  overflow-x: auto;
  scrollbar-width: none;
  background-color: color-mix(in srgb, var(--rs-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  &::-webkit-scrollbar {
    display: none;
  }

  a {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 16px;
    border-radius: 999px;
    border: 1px solid var(--rs-line);
    font-size: 15px;
    font-weight: 600;
    color: var(--rs-text);
    background-color: var(--rs-surface);
    text-decoration: none;
    white-space: nowrap;
    transition:
      background-color 0.2s,
      color 0.2s,
      border-color 0.2s;

    &:hover {
      border-color: var(--rs-primary);
    }

    &.is-current {
      color: var(--rs-bg);
      background-color: var(--rs-primary);
      border-color: var(--rs-primary);
    }
  }
}

.rs-pd-details__body {
  max-width: 820px;
  margin-block-start: 16px;

  h3 {
    position: relative;
    margin-block-start: 1.6em;
    padding-block-start: 0.6em;
    font-size: clamp(20px, 1rem + 0.7vw, 24px);
    line-height: 1.45;
    color: var(--rs-text);
    scroll-margin-top: 140px;

    &::before {
      content: "";
      position: absolute;
      inset-block-start: 0;
      inset-inline-start: 0;
      width: 44px;
      height: 3px;
      border-radius: 3px;
      background: linear-gradient(90deg, var(--rs-accent), var(--rs-primary));
    }

    &:first-child {
      margin-block-start: 0;
    }
  }

  img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
  }
}

/* Description components. The description stays plain YouCan editor HTML (no class, style or script): each
   component is recognised from its structure, so it survives the editor and serves every product.
   - list whose items open with a bold title: cards (an emoji at the start of the title becomes a line icon, rs-desc)
   - numbered list: steps            - quote: note box               - table: specifications
   - <details>: question that opens  - paragraph holding two photos: photos side by side
   - link to #rs-order: order button (rs-desc) */
.rs-pd-details__body {
  /* Paragraphs: aligned to the start on phones, where justified Arabic opens wide gaps between words (browsers do
     not stretch Arabic letters); justified from 600 px. Titles, lists, questions and buttons are never justified. */
  p {
    text-align: start;
    text-wrap: pretty;
  }

  li,
  summary,
  blockquote p {
    text-align: start;
  }

  ul:has(> li > strong:first-child) {
    display: grid;
    gap: 12px;
    padding: 0;

    > li {
      position: relative;
      margin: 0;
      padding: 18px 20px;
      border: 1px solid var(--rs-line);
      border-radius: var(--rs-radius);
      background-color: var(--rs-surface);
      box-shadow: var(--rs-shadow-soft);
      font-size: 16px;
      line-height: 1.8;

      &::before {
        content: none;
      }

      &:has(.rs-d-icon) {
        padding-inline-start: 78px;
      }

      > strong:first-child {
        display: block;
        margin-block-end: 4px;
        font-size: 17px;
        line-height: 1.5;
      }
    }
  }

  /* The brand's arch holds the icon */
  .rs-d-icon {
    position: absolute;
    inset-block-start: 18px;
    inset-inline-start: 18px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 50px;
    border-radius: 22px 22px 10px 10px;
    color: var(--rs-primary);
    background-color: var(--rs-sand-100);
    box-shadow: inset 0 0 0 1px var(--rs-line);
  }

  ol {
    padding: 0;
    list-style: none;
    counter-reset: rs-step;

    > li {
      position: relative;
      min-height: 44px;
      margin: 0;
      padding-block: 7px 24px;
      padding-inline-start: 60px;
      counter-increment: rs-step;

      &::before {
        content: counter(rs-step);
        position: absolute;
        inset-block-start: 0;
        inset-inline-start: 0;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        font-size: 18px;
        font-weight: 700;
        line-height: 1;
        color: var(--rs-bg);
        background-color: var(--rs-primary);
      }

      &:not(:last-child)::after {
        content: "";
        position: absolute;
        inset-block: 50px 6px;
        inset-inline-start: 21.5px;
        width: 1px;
        background-image: linear-gradient(var(--rs-accent) 50%, transparent 50%);
        background-size: 1px 7px;
      }

      &:last-child {
        padding-block-end: 4px;
      }
    }
  }

  blockquote {
    margin-inline: 0;
    padding: 18px 20px;
    border: 1px solid var(--rs-line);
    border-radius: var(--rs-radius);
    background-color: var(--rs-sand-100);
    font-size: 16px;

    > * + * {
      margin-block-start: 0.6em;
    }

    > p:first-child > strong:first-child {
      font-size: 17px;
      color: var(--rs-primary);
    }
  }

  table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--rs-line);
    border-radius: var(--rs-radius);
    background-color: var(--rs-surface);
    font-size: 16px;
    line-height: 1.65;

    th,
    td {
      padding: 13px 16px;
      font-weight: 400;
      text-align: start;
      vertical-align: top;
      border-block-end: 1px solid var(--rs-line);
    }

    tr:nth-child(even) > * {
      background-color: var(--rs-sand-100);
    }

    /* Labels on one line, as narrow as they allow; the values take the rest. */
    tr > :first-child {
      width: 1%;
      font-weight: 700;
      color: var(--rs-text);
      white-space: nowrap;
    }

    tr:last-child > * {
      border-block-end: 0;
    }

    /* A table with a header row (e.g. a size table): the header stands out, every column keeps its width. */
    thead th {
      font-weight: 700;
      background-color: var(--rs-sand-200);
    }

    &:has(thead) :is(th, td) {
      padding-inline: 10px;
      text-align: center;
      white-space: nowrap;
    }

    &:has(thead) tr > :first-child {
      width: auto;
    }

    thead tr:last-child > * {
      border-block-end: 1px solid var(--rs-line);
    }
  }

  details {
    margin: 0;
    border-block-end: 1px solid var(--rs-line);

    > summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      min-height: 56px;
      padding-block: 14px;
      font-size: 17px;
      font-weight: 700;
      line-height: 1.6;
      color: var(--rs-text);
      cursor: pointer;
      list-style: none;
      transition: color 0.2s;

      &::-webkit-details-marker {
        display: none;
      }

      &::after {
        content: "";
        flex: none;
        width: 20px;
        height: 20px;
        background-color: var(--rs-gold);
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E")
          center / contain no-repeat;
        transition: rotate 0.3s var(--rs-ease);
      }

      &:hover {
        color: var(--rs-primary);
      }
    }

    &[open] > summary {
      color: var(--rs-primary);

      &::after {
        rotate: 180deg;
      }
    }

    > :not(summary) {
      margin: 0;
      padding-block-end: 16px;
    }
  }

  :not(details) + details {
    margin-block-start: 1em;
    border-block-start: 1px solid var(--rs-line);
  }

  p:has(> img + img) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  figure {
    margin: 0;
  }

  figcaption {
    margin-block-start: 8px;
    font-size: 15px;
    color: var(--rs-muted);
    text-align: center;
  }

  p:has(> .rs-d-order) {
    display: flex;
    justify-content: center;
    margin-block-start: 28px;
  }

  .rs-d-order {
    width: min(100%, 420px);
    color: var(--rs-dark);
    text-decoration: none;
  }
}

@media (min-width: 600px) {
  .rs-pd-details__body p {
    text-align: justify;
    text-justify: inter-word;
    text-align-last: start;
  }
}

@media (min-width: 640px) {
  .rs-pd-details__body ul:has(> li > strong:first-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    > li:last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }
  }
}

/* Wide screens: a photo on its own stays at a comfortable size instead of filling the whole column. */
@media (min-width: 768px) {
  .rs-pd-details__body :is(p, figure) > img:only-child {
    width: min(100%, 560px);
    margin-inline: auto;
  }
}

/* Reviews (Chameleon section, loaded by YouCan) in the brand style */
[section="product-reviews"] {
  .section-head h2 {
    font-weight: 700;
    font-size: clamp(24px, 1.2rem + 1.2vw, 34px);
    color: var(--rs-text);
  }
}

/* Sticky order bar */
.rs-pd-bar {
  position: fixed;
  z-index: 65;
  inset-inline: 0;
  inset-block-end: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--rs-gutter) calc(10px + env(safe-area-inset-bottom));
  background-color: color-mix(in srgb, var(--rs-bg) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-block-start: 1px solid var(--rs-line);
  transform: translateY(110%);
  visibility: hidden;
  transition:
    transform 0.35s var(--rs-ease),
    visibility 0s 0.35s;

  &.is-visible {
    transform: none;
    visibility: visible;
    transition: transform 0.35s var(--rs-ease);
  }

  /* Out of the way while a review is being written (it would cover the form's send button). */
  html.rs-pr-writing &.is-visible {
    transform: translateY(110%);
    visibility: hidden;
    transition:
      transform 0.35s var(--rs-ease),
      visibility 0s 0.35s;
  }

  .rs-btn {
    flex-shrink: 0;
    min-height: 48px;
    padding-inline: 20px;
  }
}

.rs-pd-bar__price {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.35;

  strong {
    font-size: 18px;
    color: var(--rs-primary);
  }
}

.rs-pd-bar__name {
  overflow: hidden;
  font-size: 13px;
  color: var(--rs-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Zoom */
.rs-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background-color: rgb(30 21 15 / 0.94);

  &::backdrop {
    background: transparent;
  }

  &[open] {
    display: grid;
    place-items: center;
  }

  img {
    max-width: 94vw;
    max-height: 86dvh;
    object-fit: contain;
  }
}

.rs-lightbox__close,
.rs-lightbox__arrow {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgb(247 241 230 / 0.35);
  color: #f7f1e6;
  background-color: rgb(247 241 230 / 0.08);
  cursor: pointer;

  &:hover {
    background-color: rgb(247 241 230 / 0.2);
  }
}

.rs-lightbox__close {
  inset-block-start: 16px;
  inset-inline-end: 16px;
}

.rs-lightbox__arrow {
  inset-block-start: calc(50% - 24px);
}

.rs-lightbox__arrow--prev {
  inset-inline-start: 16px;

  .rs-icon {
    transform: scaleX(-1);
  }
}

[dir="rtl"] .rs-lightbox__arrow--prev .rs-icon {
  transform: none;
}

.rs-lightbox__arrow--next {
  inset-inline-end: 16px;
}

/* Tablet and desktop: photos and order form side by side; the photos stay in view while the form scrolls. */
@media (min-width: 768px) {
  .rs-pd__top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
  }

  .rs-gallery {
    position: sticky;
    inset-block-start: 88px;
  }

  .rs-pd__form {
    padding: 24px 22px;
  }

  .rs-pd-trust {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rs-gallery__thumb {
    flex-basis: 76px;
    height: 76px;
  }
}

@media (min-width: 1025px) {
  .rs-pd__top {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 48px;
  }

  .rs-gallery {
    inset-block-start: 96px;
  }

  .rs-gallery__arrow {
    display: grid;
  }

  .rs-pd-details__nav {
    justify-content: center;
    margin-inline: 0;
  }

  .rs-pd-details__body {
    margin-inline: auto;
  }

  .rs-pd-bar {
    justify-content: center;

    .rs-pd-bar__price {
      flex: 0 1 420px;
    }
  }
}

@media (hover: hover) and (pointer: fine) {
  .rs-gallery__arrow {
    display: grid;
  }
}

/* Phones: the price, the cash-on-delivery line and the delivery zone come up into the first screen. The breadcrumb
   gives way (the header menu leads back), and the thumbnails keep one row that slides sideways. */
@media (max-width: 639px) {
  .rs-pd__crumbs {
    display: none;
  }

  .rs-gallery__thumbs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-block: 2px;

    &::-webkit-scrollbar {
      display: none;
    }
  }

  .rs-gallery__thumb {
    flex-basis: 56px;
    height: 56px;
    padding: 5px;
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]) {
    .rs-gallery__viewport {
      scroll-behavior: auto;
    }

    .rs-pd-bar {
      transition: none;
    }
  }
}

/* ---------- Customer reviews at the foot of the product page (sections/rs-product-reviews.liquid) ---------- */

/* Five stars filled to a rating: pale stars, and the gold ones cut to --rs-fill over them */
.rs-meter {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  line-height: 0;
}

.rs-meter__base,
.rs-meter__fill {
  display: flex;
  gap: 2px;
}

.rs-meter__base {
  color: var(--rs-sand-200);
}

.rs-meter__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--rs-fill, 0%);
  overflow: hidden;
  color: var(--rs-gold);
}

/* A sand band with the brand's stars, warmer towards the summary */
.rs-pr {
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 60% at 18% 8%, color-mix(in srgb, var(--rs-accent) 24%, transparent), transparent 72%),
    var(--rs-sand-100);

  .rs-pr__pattern {
    position: absolute;
    inset: 0;
    background-image: var(--rs-star);
    background-size: 56px;
    opacity: 0.45;
    -webkit-mask-image: linear-gradient(180deg, black, transparent 70%);
    mask-image: linear-gradient(180deg, black, transparent 70%);
    pointer-events: none;
  }

  .rs-pr__inner {
    position: relative;
  }

  .rs-pr__title {
    margin-block-end: 32px;
    font-size: clamp(28px, 1.1rem + 2vw, 42px);
    text-align: center;
  }
}

.rs-pr__layout {
  display: grid;
  gap: 24px;
}

/* Only what the state needs: loading (skeleton), reviews (summary + list), empty (invitation) */
.rs-pr__layout[data-state="loading"] {
  .rs-pr__summary,
  .rs-pr__empty {
    display: none;
  }
}

.rs-pr__layout[data-state="reviews"] {
  .rs-pr__empty,
  .rs-pr__list--skeleton {
    display: none;
  }
}

.rs-pr__layout[data-state="empty"] {
  .rs-pr__summary,
  .rs-pr__list--skeleton {
    display: none;
  }

  .rs-pr__main {
    width: 100%;
    max-width: 920px;
    margin-inline: auto;
  }
}

/* Summary, in the shape of the gate: average, stars, number of reviews, spread of the stars */
.rs-pr__summary {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 26px 26px;
  border-radius: 50% 50% var(--rs-radius) var(--rs-radius) / 130px 130px var(--rs-radius) var(--rs-radius);
  text-align: center;
  background-color: var(--rs-surface);
  box-shadow: var(--rs-shadow);

  /* The gold frame of the door, just inside the edge */
  &::before {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rs-accent) 70%, transparent);
    pointer-events: none;
  }

  > * {
    position: relative;
  }
}

.rs-pr__score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.rs-pr__avg {
  font-weight: 700;
  font-size: 68px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--rs-primary);
}

.rs-pr__outof {
  font-weight: 600;
  font-size: 18px;
  color: var(--rs-muted);
}

.rs-pr__meter {
  margin: 0;

  .rs-meter__fill {
    transition: width 1.2s var(--rs-ease) 0.15s;
  }
}

.rs-pr__summary:not(.is-counted) .rs-meter__fill {
  width: 0;
}

.rs-pr__count {
  margin: 0;
  font-weight: 600;
  color: var(--rs-text);
}

.rs-pr__bars {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-block: 12px 18px;
  padding: 0;
  list-style: none;
}

.rs-pr__row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}

.rs-pr__row-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--rs-text);

  .rs-icon {
    color: var(--rs-gold);
  }
}

.rs-pr__bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--rs-accent) 22%, var(--rs-bg));
}

.rs-pr__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rs-primary), var(--rs-gold));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.1s var(--rs-ease);
}

[dir="rtl"] .rs-pr__bar-fill {
  background: linear-gradient(270deg, var(--rs-primary), var(--rs-gold));
  transform-origin: 100% 50%;
}

.rs-pr__summary.is-counted .rs-pr__bar-fill {
  transform: scaleX(var(--rs-share, 0));
}

.rs-pr__row:nth-child(2) .rs-pr__bar-fill {
  transition-delay: 0.08s;
}

.rs-pr__row:nth-child(3) .rs-pr__bar-fill {
  transition-delay: 0.16s;
}

.rs-pr__row:nth-child(4) .rs-pr__bar-fill {
  transition-delay: 0.24s;
}

.rs-pr__row:nth-child(5) .rs-pr__bar-fill {
  transition-delay: 0.32s;
}

.rs-pr__row-count {
  text-align: end;
  font-variant-numeric: tabular-nums;
  color: var(--rs-muted);
}

.rs-pr__summary .rs-pr__open {
  width: 100%;
}

/* Review cards: cream paper, a gold quote mark, the stars, the words, the photos, the first name */
.rs-pr__list {
  margin: 0;
  padding: 0;
  list-style: none;
  column-gap: 18px;
}

.rs-pr__card {
  position: relative;
  display: grid;
  gap: 14px;
  margin-block-end: 18px;
  padding: 22px;
  border-radius: var(--rs-radius);
  background-color: var(--rs-surface);
  box-shadow: var(--rs-shadow-soft);
  break-inside: avoid;
}

.rs-pr__quote {
  position: absolute;
  inset-block-start: 14px;
  inset-inline-end: 16px;
  color: color-mix(in srgb, var(--rs-accent) 45%, transparent);
  pointer-events: none;
}

.rs-pr__card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding-inline-end: 44px;
}

.rs-pr__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--rs-sand-200);

  .rs-icon.is-on {
    color: var(--rs-gold);
  }
}

.rs-pr__date {
  font-size: 13px;
  color: var(--rs-muted);
}

.rs-pr__text {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--rs-text);
  overflow-wrap: anywhere;

  &:focus {
    outline: none;
  }
}

.rs-pr__photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* A little inset keeps the whole photo clear of the rounded corners (as in the gallery thumbnails). */
.rs-pr__photo {
  width: 76px;
  height: 76px;
  padding: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background-color: var(--rs-sand-100);
  cursor: zoom-in;
  transition: transform 0.2s var(--rs-ease);

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  &:hover {
    transform: translateY(-2px);
  }

  &:focus-visible {
    outline: 2px solid var(--rs-primary);
    outline-offset: 2px;
  }
}

.rs-pr__author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--rs-line);
}

.rs-pr__initial {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 700;
  color: var(--rs-primary);
  background-color: var(--rs-sand-100);
  box-shadow: inset 0 0 0 1.5px var(--rs-gold);
}

.rs-pr__name {
  font-weight: 700;
}

.rs-pr__more {
  display: flex;
  margin-inline: auto;
}

/* Loading: two pale cards that breathe */
.rs-pr__card.is-skeleton {
  gap: 12px;

  span {
    display: block;
    height: 12px;
    border-radius: 6px;
    background-color: var(--rs-sand-200);
    animation: rs-pr-breathe 1.4s ease-in-out infinite;
  }

  span:first-child {
    width: 40%;
  }

  span:last-child {
    width: 70%;
  }
}

@keyframes rs-pr-breathe {
  50% {
    opacity: 0.45;
  }
}

/* No review yet: the closed gate invites the first one, its stars light up one after the other */
.rs-pr__empty {
  display: grid;
  gap: 22px;
  align-items: center;
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
  padding: 20px;
  border-radius: var(--rs-radius-lg);
  text-align: center;
  background-color: var(--rs-surface);
  box-shadow: var(--rs-shadow);
}

/* The key photo is upright (3:4): narrower on phones so the invitation stays compact */
.rs-pr__empty-photo {
  width: min(70%, 260px);
  margin: 0;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 14px;

  img {
    display: block;
    width: 100%;
    height: auto;
  }
}

.rs-pr__empty-body {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.rs-pr__empty-stars {
  display: flex;
  gap: 6px;
  color: var(--rs-sand-200);
}

.rs-pr__empty.is-counted .rs-pr__empty-stars .rs-icon {
  animation: rs-pr-star 0.6s var(--rs-ease) forwards;

  &:nth-child(2) {
    animation-delay: 0.12s;
  }

  &:nth-child(3) {
    animation-delay: 0.24s;
  }

  &:nth-child(4) {
    animation-delay: 0.36s;
  }

  &:nth-child(5) {
    animation-delay: 0.48s;
  }
}

@keyframes rs-pr-star {
  40% {
    transform: scale(1.25);
  }
  to {
    color: var(--rs-gold);
    transform: none;
  }
}

.rs-pr__empty-title {
  font-weight: 700;
  font-size: clamp(22px, 1rem + 1.2vw, 30px);
  line-height: 1.4;
  text-wrap: balance;
}

.rs-pr__empty-text {
  max-width: 460px;
  margin: 0;
  font-size: 17px;
  line-height: 1.85;
  color: var(--rs-text);
}

/* The form, opened in place */
.rs-pr__write {
  margin-block-end: 24px;
  padding: 22px;
  border-radius: var(--rs-radius-lg);
  background-color: var(--rs-surface);
  box-shadow: var(--rs-shadow);
  scroll-margin-block-start: 100px;
}

.rs-pr__form {
  display: grid;
  gap: 18px;
}

.rs-pr__form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rs-pr__form-title {
  font-weight: 700;
  font-size: 22px;
}

.rs-pr__close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--rs-text);
  background-color: var(--rs-sand-100);
  cursor: pointer;

  &:hover {
    background-color: var(--rs-sand-200);
  }

  &:focus-visible {
    outline: 2px solid var(--rs-primary);
    outline-offset: 2px;
  }
}

.rs-pr__field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;

  label,
  legend,
  .rs-pr__label {
    padding: 0;
    font-weight: 700;
    font-size: 15px;
  }

  input:not([type="radio"], [type="file"]),
  textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--rs-line);
    border-radius: 12px;
    font: inherit;
    color: var(--rs-text);
    background-color: var(--rs-bg);

    &:focus-visible {
      outline: 2px solid var(--rs-accent);
      outline-offset: 1px;
      border-color: var(--rs-primary);
    }
  }

  textarea {
    min-height: 120px;
    resize: vertical;
  }

  small {
    font-size: 13px;
    color: var(--rs-muted);
  }
}

.rs-pr__form-row {
  display: grid;
  gap: 18px;
}

/* Rating stars: written 5 to 1, shown 1 to 5; the chosen (or hovered) star lights up those before it */
.rs-pr__rate-stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 2px;

  label {
    display: grid;
    place-items: center;
    padding: 4px;
    border-radius: 10px;
    color: var(--rs-sand-200);
    cursor: pointer;
    transition:
      color 0.15s,
      transform 0.15s var(--rs-ease);
  }

  input:checked + label,
  input:checked ~ label {
    color: var(--rs-gold);
  }

  &:hover label {
    color: var(--rs-sand-200);
  }

  label:hover,
  label:hover ~ label {
    color: var(--rs-gold);
  }

  label:hover {
    transform: scale(1.1);
  }

  input:focus-visible + label {
    outline: 2px solid var(--rs-primary);
    outline-offset: 1px;
  }
}

.rs-pr__uploads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rs-pr__add-photo,
.rs-pr__upload {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 12px;
}

.rs-pr__add-photo {
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--rs-gold);
  color: var(--rs-primary);
  background-color: var(--rs-bg);
  cursor: pointer;

  &:hover {
    background-color: var(--rs-sand-100);
  }

  &:focus-within {
    outline: 2px solid var(--rs-primary);
    outline-offset: 2px;
  }
}

.rs-pr__upload {
  padding: 5px;
  overflow: hidden;
  background-color: var(--rs-sand-100);

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

.rs-pr__upload-remove {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 4px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background-color: rgb(32 18 8 / 0.72);
  cursor: pointer;
}

.rs-pr__status {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: #7a2414;
  background-color: #f7e4dc;
}

.rs-pr__submit {
  width: 100%;
}

.rs-pr__note {
  margin: 0;
  font-size: 13px;
  color: var(--rs-muted);
}

.rs-pr__done {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-block: 18px;
  text-align: center;

  h3 {
    font-weight: 700;
    font-size: 22px;
  }

  p {
    max-width: 420px;
    margin: 0;
    color: var(--rs-text);
  }

  &:focus {
    outline: none;
  }
}

.rs-pr__done-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: var(--rs-gold);
  background-color: var(--rs-sand-100);
}

/* Customer photo, large */
.rs-pr__viewer {
  max-width: 94vw;
  max-height: 92dvh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;

  &::backdrop {
    background-color: rgb(20 12 6 / 0.82);
  }

  img {
    display: block;
    max-width: 94vw;
    max-height: 86dvh;
    border-radius: 12px;
    object-fit: contain;
  }
}

.rs-pr__viewer-close {
  position: absolute;
  inset-block-start: -16px;
  inset-inline-end: -12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--rs-text);
  background-color: var(--rs-surface);
  box-shadow: var(--rs-shadow-soft);
  cursor: pointer;
}

@media (min-width: 768px) {
  .rs-pr__list {
    columns: 2;
  }

  .rs-pr__form-row {
    grid-template-columns: 1fr 1fr;
  }

  .rs-pr__submit {
    width: auto;
    justify-self: start;
  }

  .rs-pr__write {
    padding: 30px;
  }

  .rs-pr__empty {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 40px;
    padding: 26px;
    text-align: start;
  }

  .rs-pr__empty-photo {
    width: 100%;
  }

  .rs-pr__empty-body {
    justify-items: start;
  }
}

@media (min-width: 1025px) {
  .rs-pr__layout[data-state="reviews"] {
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
    gap: 40px;

    .rs-pr__summary {
      position: sticky;
      inset-block-start: 100px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]) {
    .rs-pr__bar-fill,
    .rs-pr__meter .rs-meter__fill,
    .rs-pr__photo,
    .rs-pr__rate-stars label {
      transition: none;
    }

    .rs-pr__card.is-skeleton span,
    .rs-pr__empty.is-counted .rs-pr__empty-stars .rs-icon {
      animation: none;
    }

    .rs-pr__empty.is-counted .rs-pr__empty-stars {
      color: var(--rs-gold);
    }
  }
}

/* ---------- End of the page (rs-related): same category, then the way back to the categories ---------- */
.rs-related__products + .rs-related__back {
  margin-block-start: 40px;
}

.rs-related__back {
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 28px var(--rs-gutter);
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius-lg);
  background: var(--rs-surface) var(--rs-star) center / 56px repeat;
  text-align: center;
}

.rs-related__back-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rs-text);
}

.rs-related__back-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.rs-related__back-links .rs-btn {
  min-block-size: 48px;
}

/* A plain ground under the outline-free link: the star pattern behind it lowered its contrast (4.15:1). */
.rs-related__back-links .rs-btn--ghost {
  background-color: var(--rs-surface);
}

@media (max-width: 639px) {
  .rs-related__back-links {
    display: grid;
    inline-size: 100%;
  }
}

/* Narrow phones: nothing in the order form may be wider than the screen */
/* 2026-11-11: measured on the live site, the order column was wider than a 360 or 375 px screen (34 and 19 px cut
   on the inline-end side: share button, form, order button), because three things refused to shrink: the phone
   field (dialling code + number), the "quantity / total" line and the one-line order button. Checked by
   tools/overflow_check.cjs. */
.rs-pd .rs-pd__buy,
.rs-pd .rs-pd__form {
  min-width: 0;
}

.rs-pd .rs-pd__form,
.rs-pd .rs-pd__form ui-express-checkout,
.rs-pd .rs-pd__form ui-express-checkout label {
  grid-template-columns: minmax(0, 1fr);
}

.rs-pd .rs-pd__form :is(input, select, textarea) {
  min-width: 0;
}

.rs-pd .rs-pd__form ui-phone-validation {
  min-width: 0;
  max-width: 100%;

  input {
    flex: 1 1 0;
    width: 100%;
  }
}

@media (max-width: 400px) {
  /* Quantity on one line, the total on the next. */
  .rs-pd .rs-pd__cta {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "label qty"
      "total total"
      "buy buy"
      "cart cart";
  }

  .rs-pd ui-quantity {
    justify-self: end;
  }

  .rs-pd .rs-pd__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    justify-self: stretch;
  }

  /* The order sentence may take two even lines rather than push the page sideways. */
  .rs-pd .rs-pd__buy-button .rs-btn {
    min-width: 0;
    padding-block: 10px;
    line-height: 1.45;
    white-space: normal;
    text-wrap: balance;
  }
}

/* Tables with a header row (size guide) on phones */
/* Their cells stay on one line each, so on a narrow screen the table was wider than the page (13 px cut at 360 px
   on the sandal's size guide): smaller cells there, and the whole table shows. */
@media (max-width: 480px) {
  .rs-pd-details .rs-pd-details__body table:has(thead) :is(th, td) {
    padding-inline: 5px;
    font-size: 13px;
  }
}

/* ---------- « Coming soon » (rs-soon, 2026-11-23): replaces the facts and the order form of a product not on sale ---------- */
.rs-pd__soon {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-radius: var(--rs-radius-lg);
  background: linear-gradient(180deg, #fffdf8, var(--rs-surface));
  border: 1.5px dashed color-mix(in srgb, var(--rs-accent) 80%, transparent);
  text-align: center;
  scroll-margin-top: 96px;
}

.rs-pd__soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--rs-dark, #2e2018);
  color: #f2d79c;
  font-weight: 700;
  font-size: 18px;
}

.rs-pd__soon-text {
  max-inline-size: 34ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--rs-muted);
}

.rs-pd__soon-button {
  inline-size: 100%;
  border-color: color-mix(in srgb, var(--rs-text) 25%, transparent);
  background: color-mix(in srgb, var(--rs-text) 8%, var(--rs-surface));
  color: var(--rs-muted);
  cursor: not-allowed;

  &:active {
    transform: none;
  }
}

.rs-pd__soon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 44px;
  font-weight: 600;
  font-size: 16px;
  color: var(--rs-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}
