/* ==========================================================================
   Component: product-info  →  snippets/product-info.liquid + assets/component-product-info.css
   The product form column shared by Product Of The Week (Figma 1164-2458) and the Quick View
   (1359-2711): badge → title + rating → price, colour and size pickers, add-to-cart bar and
   instalment line, "VIEW DETAILS". 472 wide (the size row and buy block 464), groups 32px apart.
   The column's surface and inset belong to the host (section or dialog).
   Behaviour: <variant-picker> (assets/js/components/variant-picker.js).
   ========================================================================== */
.product-info__details {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 472px;
}

.product-info__summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-info__badges {
  display: flex;
  gap: 4px;
}

.product-info__heading {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.product-info__title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Line boxes below are Figma's text styles rounded to whole pixels, as Figma sizes its text
   boxes (16 × 1.6 → 26, 12 × 1.2 → 14, 14 × 1.2 → 17, 14 × 1.4 → 20); with the raw ratios every
   row drifts up to a pixel by the bottom of the column. */

/* Body/L */
.product-info__name {
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  color: var(--color-text-primary);
}

/* Rating — five 12px stars 2px apart, then the underlined count 3px on (Figma's 154px row) */
.product-info__rating {
  display: flex;
  align-items: center;
  gap: 3px;
}

.product-info__stars {
  display: flex;
  gap: 2px;
  color: var(--color-icon-primary);
}

.product-info__reviews,
.product-info__size-guide {
  font-size: var(--text-body-s-size);
  font-weight: 500;
  line-height: 14px;
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
  white-space: nowrap;
}

.product-info__reviews {
  width: var(--width-whole-px);
  color: var(--color-text-secondary);
}

.product-info__price {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.product-info__price-current {
  width: var(--width-whole-px);
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  color: var(--color-text-primary);
}

/* Body/M */
.product-info__price-compare {
  width: var(--width-whole-px);
  font-size: var(--text-body-m-size);
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text-tertiary);
  text-decoration-skip-ink: none;
}

/* Options — "Name: value" row, 12px above the choices */
.product-info__options {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.product-info__option {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-info__option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 464px;
}

/* Body/M (500) */
.product-info__option-label {
  display: flex;
  gap: 8px;
  font-size: var(--text-body-m-size);
  font-weight: 500;
  line-height: 17px;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.product-info__option-name {
  width: var(--width-whole-px);
  color: var(--color-text-tertiary);
}

.product-info__stock {
  color: var(--color-text-critical);
}

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

/* Button/M tracking */
.product-info__size-guide {
  color: var(--color-text-primary);
  letter-spacing: 0.04em;
}

/* Colour swatches — 16px, 2px radius, 0.5px #3b3b3b ring drawn inside; the chosen one gets a
   #080808 ring and a 4px mark 3px from its top-right corner (white on dark swatches) */
.product-info__swatches {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 16px;
}

.product-info__swatch {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
  background: var(--swatch);
  box-shadow: inset 0 0 0 0.5px var(--color-border-secondary);
  cursor: pointer;
}

input:checked + .product-info__swatch {
  box-shadow: inset 0 0 0 0.5px var(--color-border-strong);
}

input:checked + .product-info__swatch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 9px;
  width: 4px;
  height: 4px;
  background: var(--swatch-mark, var(--color-black));
}

input:focus-visible + .product-info__swatch,
input:focus-visible + .product-info__size {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* Sizes — 56×35 white boxes 12px apart, 1px #e2e2e2 border. Chosen: #080808 border + 4px mark
   4px inside the top-right corner. Sold out (disabled radio): #b0b0b0 label struck through
   corner to corner, "Out of stock" above it on hover. */
.product-info__sizes {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.product-info__size {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 35px;
  padding: 8px 12px;
  border: 1px solid var(--color-border-tertiary);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-text-primary);
  font-size: var(--text-body-m-size);
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
}

input:enabled:not(:checked) + .product-info__size:hover {
  border-color: var(--color-border-default);
}

input:checked + .product-info__size {
  border-color: var(--color-border-strong);
}

input:checked + .product-info__size::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 4px;
  height: 4px;
  background: var(--color-black);
}

input:disabled + .product-info__size {
  color: var(--color-text-disabled);
  cursor: default;
}

/* Figma's Vector 5894: a 1px #e2e2e2 line between the inner corners, round caps */
input:disabled + .product-info__size::after {
  content: '';
  position: absolute;
  inset: -0.5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 55 34' preserveAspectRatio='none'%3E%3Cpath d='M.5 33.5 54.5.5' stroke='%23e2e2e2' stroke-linecap='round' fill='none' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

/* "Out of stock" tip — Label/S on #080808, 4px padding; its box ends 20px above the size box and the
   caret's tip 16px above it, centred */
.product-info__stock-tip {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 21px);
  left: 50%;
  display: block;
  width: var(--width-whole-px);
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-primary);
  color: var(--color-text-inverse);
  font-size: var(--text-label-s-size);
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out),
    visibility 0s linear var(--duration-fast);
  pointer-events: none;
}

.product-info__stock-tip .icon-caret-up {
  position: absolute;
  top: calc(100% - 1.75px);
  left: 50%;
  color: var(--color-surface-primary);
  transform: translateX(-50%) rotate(180deg);
}

input:disabled + .product-info__size:hover .product-info__stock-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

/* Buy — 464 wide: Button/L bar with the 20px bag, then the instalment line 16px below */
.product-info__buy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 464px;
}

.product-info__atc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  height: 42px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-primary);
  color: var(--color-text-inverse);
  font-size: var(--text-body-m-size);
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}

.product-info__atc .icon-bag {
  width: 20px;
  height: 20px;
  color: var(--color-icon-inverse);
}

.product-info__atc:hover {
  background: var(--color-text-menu);
}

.product-info__atc:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* Body/S */
.product-info__installments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: var(--text-body-s-size);
  font-weight: 500;
  line-height: 14px;
  color: var(--color-text-secondary);
}

.product-info__installments-text {
  width: var(--width-whole-px);
}

.product-info__provider {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--color-text-primary);
}

.product-info__provider > span {
  width: var(--width-whole-px);
}

.product-info__provider-info {
  display: block;
  color: var(--color-icon-secondary);
}

/* View details — the shared .button--tertiary; its 1px hover underline hangs below the 16px row
   so the row itself sits on the bottom inset. Tracking is set per instance (Product Of The Week
   uses Button/M's 4%, the Quick View none, as in Figma). */
.product-info__more {
  align-self: flex-start;
  margin-bottom: -1px;
}

@media (max-width: 749px) {
  .product-info__sizes {
    gap: 8px;
  }
}
