/* PDP v3 — Stone color picker
   Scoped under .pdp-stone-picker. Uses v3 tokens only. */

.pdp-stone-picker {
  display: block;
  width: 100%;
  padding: 18px 0 8px;
  color: var(--ink);
  font-family: 'Inter Tight', system-ui, sans-serif;
}

.pdp-stone-picker__label {
  display: block;
  margin: 0 0 14px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pdp-stone-picker__viewport {
  position: relative;
}

.pdp-stone-picker__row {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px 24px 12px;
  margin: 0;
  list-style: none;
  /* Edge fade gradients */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 24px,
    #000 calc(100% - 24px),
    transparent 100%
  );
          mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 24px,
    #000 calc(100% - 24px),
    transparent 100%
  );
}

.pdp-stone-picker__row::-webkit-scrollbar {
  display: none;
}

.pdp-stone-picker__item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  scroll-snap-align: start;
  background: transparent;
  border: 0;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.pdp-stone-picker__swatch {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--rule);
  box-shadow: inset 0 0 0 1px rgba(27, 26, 24, 0.06);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.pdp-stone-picker__swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdp-stone-picker__swatch--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-soft);
  color: var(--ink-soft);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 20px;
  line-height: 1;
}

.pdp-stone-picker__name {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
  text-align: center;
}

.pdp-stone-picker__caption {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  text-align: center;
}

/* Hover */
.pdp-stone-picker__item:hover .pdp-stone-picker__swatch,
.pdp-stone-picker__item:focus-visible .pdp-stone-picker__swatch {
  transform: scale(1.04);
  box-shadow:
    inset 0 0 0 1px rgba(27, 26, 24, 0.06),
    0 0 0 2px var(--accent);
}

.pdp-stone-picker__item:focus-visible {
  outline: none;
}

/* Selected */
.pdp-stone-picker__item.is-selected .pdp-stone-picker__swatch {
  box-shadow:
    inset 0 0 0 1px rgba(27, 26, 24, 0.06),
    0 0 0 2px var(--accent),
    0 0 0 6px rgba(140, 106, 72, 0.18);
}

.pdp-stone-picker__item.is-selected .pdp-stone-picker__name {
  color: var(--accent);
}

.pdp-stone-picker__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 180ms ease, transform 180ms ease;
}

.pdp-stone-picker__item.is-selected .pdp-stone-picker__dot {
  opacity: 1;
  transform: scale(1);
}

/* Desktop — grid layout, no horizontal scroll */
@media (min-width: 768px) {
  .pdp-stone-picker__row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 14px;
    overflow: visible;
    scroll-snap-type: none;
    padding: 6px 0 12px;
    -webkit-mask-image: none;
            mask-image: none;
  }

  .pdp-stone-picker__item {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdp-stone-picker__swatch,
  .pdp-stone-picker__dot {
    transition: none;
  }
  .pdp-stone-picker__item:hover .pdp-stone-picker__swatch {
    transform: none;
  }
}
