/* Product page. Loaded only by store/show; cards in "recently viewed" come from
   product_cards.css. The header, footer and container come from storefront_shell.css. */

.product-page {
  padding: 18px 0 72px;
}

.product-page .breadcrumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.product-page .breadcrumbs a {
  color: var(--muted);
  transition: color 180ms var(--ease);
}

.product-page .breadcrumbs a:hover,
.product-page .breadcrumbs a:focus-visible {
  color: var(--accent);
}

.product-page .breadcrumbs svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--faint);
}

.product-page .breadcrumbs span {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
}

.product-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.product-sr-only[hidden] {
  display: none;
}

/* Layout: gallery on the left stays in view while the buying column scrolls. */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: start;
  gap: clamp(32px, 4.5vw, 72px);
  margin-top: 18px;
}

.product-gallery {
  position: sticky;
  top: 96px;
  display: grid;
  min-width: 0;
  gap: 14px;
}

.product-stage-shell {
  position: relative;
  min-width: 0;
}

.product-stage {
  position: relative;
  display: flex;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 24px;
  background: var(--paper);
  touch-action: pan-y;
}

.product-stage img {
  width: 100%;
  height: 100%;
  padding: 9%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-gallery-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.product-gallery-controls[hidden] {
  display: none;
}

.product-gallery-nav {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(255 255 255 / 90%);
  color: var(--ink);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.product-gallery-nav:hover,
.product-gallery-nav:focus-visible {
  border-color: #c9cec9;
  background: var(--surface);
}

.product-gallery-nav svg {
  width: 18px;
  height: 18px;
}

.product-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.product-thumbnails::-webkit-scrollbar {
  display: none;
}

.product-gallery.is-single-image .product-thumbnails {
  display: none;
}

/* product_page.js fills the row after load; holding its height keeps the buy box below
   the gallery (on phones) from jumping down when the thumbnails or dots appear. */
.product-gallery.has-multiple-images .product-thumbnails {
  min-height: 76px;
}

.product-thumb {
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  place-items: center;
  overflow: hidden;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--paper);
  transition: border-color 180ms var(--ease);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-thumb:hover {
  border-color: #cfd4cf;
}

.product-thumb.is-active {
  border-color: var(--ink);
}

/* Buying column */
.product-buy {
  min-width: 0;
  padding-top: 6px;
}

.product-eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.product-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.product-title-row h1 {
  min-width: 0;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.product-utility-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.product-utility-actions button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}

.product-utility-actions button:hover,
.product-utility-actions button:focus-visible {
  border-color: #c9cec9;
  color: var(--accent);
}

.product-utility-actions svg {
  width: 19px;
  height: 19px;
}

#product-favorite.is-selected {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
}

#product-favorite.is-selected svg {
  fill: currentColor;
}

.product-article {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.product-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 20px;
}

#product-price {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}

#product-price.is-promo,
#product-sticky-price.is-promo {
  color: var(--promo-ink);
}

.product-price-old {
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration-thickness: 1px;
}

.product-price-old[hidden],
.product-promo-badge[hidden] {
  display: none;
}

.product-promo-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--promo);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.product-stock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #eaf6ed;
  color: #2f7a47;
  font-size: 13px;
  font-weight: 600;
}

.stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3f9a5a;
}

.product-lede p {
  max-width: 60ch;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* Options */
.product-selection {
  display: grid;
  gap: 22px;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.product-model-picker h3 {
  margin: 0 0 10px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  font-feature-settings: normal;
}

.product-model-list,
.product-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-options {
  display: grid;
  gap: 22px;
}

.product-option {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* One available value: the legend already states it, so no lone chip to "choose". */
.product-option.is-fixed legend {
  margin-bottom: 0;
}

.product-option.is-fixed .product-option-list {
  display: none;
}

.product-option[hidden] {
  display: none;
}

.product-option legend {
  display: flex;
  width: 100%;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

.product-option-selected-value {
  overflow: hidden;
  color: var(--muted);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-model-button,
.product-option-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease);
}

.product-model-button:hover,
.product-option-button:hover:not(:disabled) {
  border-color: #b9c0ba;
}

.product-model-button.is-selected,
.product-option-button.is-selected {
  border-color: var(--accent);
  background: #f5f8ff;
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-dark);
}

.product-option-button:disabled {
  border-style: dashed;
  color: var(--faint);
  cursor: not-allowed;
}

.product-option-button[hidden] {
  display: none;
}

.product-model-button:focus-visible,
.product-option-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Colour options are bare swatches; the chosen name sits in the legend. */
.product-option-list--colors {
  gap: 6px;
}

.product-option-button--color,
.product-option-button--color.is-selected,
.product-option-button--color:hover:not(:disabled) {
  width: 48px;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.product-option-button--color .product-color {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 160ms var(--ease);
}

.product-option-button--color > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.product-option-button--color:hover:not(:disabled) .product-color {
  outline-color: #c3c8c4;
}

.product-option-button--color.is-selected .product-color {
  outline-color: var(--ink);
}

.product-option-button--color:disabled .product-color {
  opacity: 0.4;
}

.product-option-button--color:focus-visible {
  outline: 0;
}

.product-option-button--color:focus-visible .product-color {
  outline-color: var(--accent);
}

/* Explanations for options (e.g. SIM variants) open under the chip on hover or focus. */
.product-option-button[data-tooltip] {
  position: relative;
}

.product-option-button[data-tooltip]::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: min(340px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 12px 30px rgb(32 34 32 / 18%);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 13px;
  font-weight: 450;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transition: opacity 160ms var(--ease);
  visibility: hidden;
  white-space: pre-line;
}

.product-option-button[data-tooltip]:not(:hover):not(:focus-visible)::after {
  content: none;
}

.product-option-button[data-tooltip]:hover::after,
.product-option-button[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.product-selected-variant {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.product-selected-variant strong {
  color: var(--ink);
}

/* Purchase */
.product-purchase {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 28px;
}

.product-quantity {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.product-quantity button {
  display: grid;
  width: 44px;
  height: 100%;
  min-height: 52px;
  place-items: center;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  transition: color 160ms var(--ease);
}

.product-quantity button:hover,
.product-quantity button:focus-visible {
  color: var(--accent);
}

.product-quantity svg {
  width: 17px;
  height: 17px;
}

.product-quantity strong {
  min-width: 26px;
  font-family: var(--display);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.product-actions {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
}

.product-add-button,
.product-buy-now {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

.product-add-button {
  background: var(--accent);
  color: #fff;
}

.product-add-button:hover,
.product-add-button:focus-visible {
  background: var(--accent-dark);
}

.product-add-button svg {
  width: 19px;
  height: 19px;
}

.product-add-button__price {
  display: none;
}

.product-buy-now {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.product-buy-now:hover,
.product-buy-now:focus-visible {
  background: #dce6ff;
}

.product-add-button:focus-visible,
.product-buy-now:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-service {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--paper);
  list-style: none;
}

.product-service li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-service svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--ink);
}

.product-service strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

/* Details below the fold */
.product-details {
  display: grid;
  gap: 48px;
  margin-top: 72px;
}

.product-section-heading {
  margin-bottom: 18px;
}

.product-section-heading h2,
.product-related .section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.product-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.product-highlights[data-highlight-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-highlights[data-highlight-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-highlight {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border-radius: 20px;
  background: var(--paper);
}

.product-highlight-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
}

.product-highlight-icon svg {
  width: 20px;
  height: 20px;
}

.product-highlight-label {
  color: var(--muted);
  font-size: 13px;
}

.product-highlight-value {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.product-highlight small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-facts-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.product-facts-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
}

.product-facts-source svg {
  width: 13px;
  height: 13px;
}

.product-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  margin: 0;
}

.product-spec {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.product-spec dt {
  color: var(--muted);
  font-size: 14px;
}

.product-spec dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.product-spec-value-part {
  white-space: nowrap;
}

.product-related {
  margin-top: 64px;
}

/* Wraps so a long title ("Недавно просмотренные товары") pushes the link to the next
   line on narrow phones instead of past the screen edge. */
.product-related .section-heading {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 18px;
}

.product-related .text-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.product-related .text-link svg {
  width: 16px;
  height: 16px;
}

.product-sticky-buy {
  display: none;
}

@media (max-width: 1023px) {
  .product-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
  }

  .product-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-specs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .product-page {
    padding: 8px 0 48px;
  }

  .product-page .breadcrumbs {
    font-size: 12px;
  }

  .product-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 8px;
  }

  /* Full-bleed gallery; thumbnails turn into position dots over the photo and swiping
     changes photos. The stage is shorter than square so the title, price and options
     start on the first screen. */
  .product-gallery {
    position: relative;
    top: auto;
    gap: 0;
    margin-inline: -16px;
  }

  .product-stage {
    aspect-ratio: auto;
    height: clamp(240px, 42svh, 100vw);
    border-radius: 0;
  }

  .product-stage img {
    padding: 6% 6% 9%;
  }

  .product-gallery-controls {
    display: none;
  }

  .product-thumbnails {
    position: absolute;
    right: 0;
    bottom: 4px;
    left: 0;
    justify-content: center;
    gap: 0;
  }

  .product-gallery.has-multiple-images .product-thumbnails {
    min-height: 24px;
  }

  .product-thumb {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    padding: 8px;
    border: 0;
    border-radius: 50%;
    background: transparent;
  }

  .product-thumb img {
    display: none;
  }

  .product-thumb::before {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cdd2ce;
    content: "";
    transition: background-color 160ms var(--ease), transform 160ms var(--ease);
  }

  .product-thumb.is-active::before {
    background: var(--ink);
    transform: scale(1.15);
  }

  .product-eyebrow {
    margin-bottom: 4px;
    font-size: 13px;
  }

  .product-title-row {
    gap: 12px;
  }

  .product-title-row h1 {
    font-size: 25px;
    letter-spacing: -0.03em;
  }

  .product-article {
    margin-top: 4px;
    font-size: 12px;
  }

  .product-utility-actions {
    gap: 6px;
  }

  .product-utility-actions button {
    width: 40px;
    height: 40px;
  }

  .product-utility-actions svg {
    width: 18px;
    height: 18px;
  }

  .product-price-row {
    margin-top: 10px;
  }

  #product-price {
    font-size: 28px;
  }

  .product-lede p {
    margin-top: 12px;
    font-size: 14px;
  }

  .product-selection {
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
  }

  .product-model-picker h3,
  .product-option legend {
    margin-bottom: 8px;
  }

  .product-option.is-fixed legend {
    margin-bottom: 0;
  }

  .product-options {
    gap: 16px;
  }

  .product-model-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .product-model-button,
  .product-option-button {
    min-height: 44px;
    padding: 0 14px;
  }

  .product-purchase {
    flex-wrap: wrap;
    margin-top: 20px;
  }

  .product-actions {
    display: contents;
  }

  .product-add-button {
    flex: 1 1 0;
    min-width: 0;
    gap: 8px;
    padding: 0 14px;
  }

  .product-add-button svg {
    display: none;
  }

  .product-add-button__price {
    display: inline;
    font-variant-numeric: tabular-nums;
  }

  .product-add-button__price::before {
    margin-right: 8px;
    opacity: 0.6;
    content: "·";
  }

  .product-buy-now {
    width: 100%;
    min-height: 50px;
  }

  .product-service {
    margin-top: 20px;
    padding: 16px;
  }

  .product-details {
    gap: 40px;
    margin-top: 48px;
  }

  .product-section-heading h2,
  .product-related .section-heading h2 {
    font-size: 25px;
  }

  .product-highlights,
  .product-highlights[data-highlight-count="3"],
  .product-highlights[data-highlight-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-highlight {
    padding: 16px;
    border-radius: 16px;
  }

  .product-highlight-value {
    font-size: 17px;
  }

  .product-spec {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 12px;
    padding: 13px 0;
  }

  .product-spec-value-part {
    white-space: normal;
  }

  .product-related {
    margin-top: 48px;
  }

  .product-sticky-buy {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    /* Solid, like the header: Safari 26 carries the color of a bar at the bottom edge
       into the space around its toolbar. */
    background: var(--surface);
    box-shadow: 0 -8px 24px rgb(20 28 24 / 8%);
  }

  .product-sticky-buy[hidden],
  html.panel-is-open .product-sticky-buy {
    display: none;
  }

  .product-sticky-buy__copy {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
  }

  .product-sticky-buy__copy span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-sticky-buy__copy strong {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
  }

  .product-sticky-buy__button {
    min-height: 46px;
    flex: 0 0 auto;
    padding: 0 22px;
    border-radius: 13px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
  }

  body.has-sticky-buy {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  body.has-sticky-buy .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

/* Full-screen photo viewer (#product-lightbox). The page photo opens it; a click on the
   photo there zooms in where the pointer is. */
.product-stage img {
  cursor: zoom-in;
}

.product-zoom-button {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(255 255 255 / 90%);
  color: var(--ink);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}

.product-zoom-button:hover,
.product-zoom-button:focus-visible {
  border-color: #c9cec9;
  background: var(--surface);
}

.product-zoom-button:active {
  transform: scale(0.94);
}

.product-zoom-button svg {
  width: 18px;
  height: 18px;
}

.product-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  color: var(--ink);
  opacity: 1;
  transition: opacity 220ms var(--ease), display 220ms allow-discrete, overlay 220ms allow-discrete;
}

.product-lightbox:not([open]) {
  opacity: 0;
}

@starting-style {
  .product-lightbox[open] {
    opacity: 0;
  }
}

.product-lightbox::backdrop {
  background: var(--surface);
  backdrop-filter: none;
}

.product-lightbox__stage {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 72px 96px;
}

.product-lightbox__stage img {
  width: 100%;
  max-width: 1200px;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  cursor: zoom-in;
  touch-action: pinch-zoom;
  transition: transform 280ms var(--ease);
}

.product-lightbox__stage.is-zoomed img {
  cursor: zoom-out;
  transform: scale(2.2);
}

.product-lightbox__button {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(255 255 255 / 92%);
  color: var(--ink);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.product-lightbox__button:hover,
.product-lightbox__button:focus-visible {
  border-color: #c9cec9;
  background: var(--surface);
}

.product-lightbox__button svg {
  width: 20px;
  height: 20px;
}

.product-lightbox__close {
  top: 16px;
  right: 16px;
}

.product-lightbox__nav {
  top: 50%;
  translate: 0 -50%;
}

.product-lightbox__nav--previous {
  left: 24px;
}

.product-lightbox__nav--next {
  right: 24px;
}

.product-lightbox:not(.has-multiple-images) .product-lightbox__nav {
  display: none;
}

.product-lightbox__counter {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .product-zoom-button {
    top: 12px;
    right: 12px;
  }

  .product-lightbox__stage {
    padding: 64px 12px 56px;
  }

  .product-lightbox__nav {
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    translate: none;
  }

  .product-lightbox__nav--previous {
    left: 16px;
  }

  .product-lightbox__nav--next {
    right: 16px;
  }
}

/* A colour without its own photo: the stage says «Нет фото» instead of a generic packshot. */
.product-stage-empty {
  font-size: 14px;
}

.product-stage-empty[hidden] {
  display: none;
}

.product-stage-empty svg {
  width: 32px;
  height: 32px;
}
