/* Loom Quick Shop — product-card discovery plus an accessible variant drawer. */
.product-card__media-link {
  position: absolute;
  inset: var(--product-card-image-padding, 0);
  display: block;
  overflow: hidden;
  border-radius: max(0px, calc(var(--product-card-radius, 0px) - var(--product-card-image-padding, 0px)));
}

.product-card__image {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1);
  transition: opacity 240ms ease, transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.product-card__image.is-active {
  opacity: 1;
}

.product-card:hover .product-card__image.is-active {
  transform: scale(1.035);
}

.product-card__placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.product-card__gallery-controls {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: 0.55rem;
  left: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.product-card__gallery-arrow {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg, #fff) 92%, transparent);
  color: var(--foreground, #111);
  box-shadow: 0 2px 12px rgba(10, 10, 10, 0.13);
  opacity: 0;
  transform: translateX(-0.25rem);
  transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
  pointer-events: auto;
  cursor: pointer;
}

.product-card__gallery-arrow:last-child {
  transform: translateX(0.25rem);
}

.product-card:hover .product-card__gallery-arrow,
.product-card:focus-within .product-card__gallery-arrow {
  opacity: 1;
  transform: translateX(0);
}

.product-card__gallery-arrow:hover {
  background: var(--bg, #fff);
}

.product-card__gallery-arrow:focus-visible,
.product-card__quick-add:focus-visible,
.product-card__title a:focus-visible {
  outline: 2px solid var(--foreground, #111);
  outline-offset: 2px;
}

.product-card__gallery-arrow svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-card__gallery-dots {
  position: absolute;
  top: calc(50% + 4.1rem);
  left: 50%;
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg, #fff) 78%, transparent);
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
}

.product-card__gallery-dot {
  display: block;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--foreground, #111) 25%, transparent);
}

.product-card__gallery-dot.is-active {
  background: var(--foreground, #111);
}

.product-card__quick-add {
  position: absolute;
  z-index: 5;
  right: 0.7rem;
  bottom: 0.7rem;
  left: 0.7rem;
  min-height: 2.7rem;
  padding: 0.7rem 1rem;
  border: 1px solid color-mix(in srgb, var(--foreground, #111) 12%, transparent);
  border-radius: max(0px, calc(var(--buttons-radius, 0px) * 0.7));
  background: color-mix(in srgb, var(--bg, #fff) 94%, transparent);
  color: var(--foreground, #111);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: 0 6px 22px rgba(10, 10, 10, 0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.product-card__quick-add:hover {
  background: var(--scheme-btn-bg, var(--primary, #111));
  color: var(--scheme-btn-label, #fff);
  transform: translateY(-1px);
}

.product-card__quick-add:disabled {
  opacity: 0.66;
  cursor: not-allowed;
  transform: none;
}

.product-card__quick-add.is-loading {
  cursor: wait;
}

.product-card .product-card__badge--bottom-left,
.product-card .product-card__badge--bottom-right {
  bottom: 4rem;
}

.product-card__title a {
  color: inherit;
  text-decoration: none;
}

.product-card__options {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.product-card__option-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: inherit;
  gap: 0.3rem;
}

.product-card__option-chip {
  position: relative;
  display: inline-flex;
  min-height: 1.45rem;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.42rem;
  border: 1px solid var(--border-dark, rgba(10, 10, 10, 0.12));
  border-radius: 999px;
  color: var(--text-secondary, #666);
  font-size: 0.64rem;
  line-height: 1;
  white-space: nowrap;
}

.product-card__option-chip--color::before {
  width: 0.58rem;
  height: 0.58rem;
  border: 1px solid color-mix(in srgb, var(--foreground, #111) 14%, transparent);
  border-radius: 50%;
  background: var(--option-color, var(--surface-raised, #ddd));
  content: "";
}

.product-card__option-chip.is-unavailable {
  opacity: 0.42;
  text-decoration: line-through;
}

.quick-shop {
  position: fixed;
  z-index: 180;
  inset: 0;
}

.quick-shop[hidden] {
  display: none;
}

.quick-shop__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(8, 8, 8, 0.42);
  opacity: 0;
  cursor: default;
  transition: opacity 220ms ease;
}

.quick-shop__drawer {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  display: grid;
  width: min(34rem, 94vw);
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--bg, #fff);
  color: var(--foreground, #111);
  box-shadow: -20px 0 60px rgba(10, 10, 10, 0.18);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-shop.is-open .quick-shop__overlay {
  opacity: 1;
}

.quick-shop.is-open .quick-shop__drawer {
  transform: translateX(0);
}

.quick-shop__header {
  display: flex;
  min-height: 4.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border, rgba(10, 10, 10, 0.08));
}

.quick-shop__eyebrow,
.quick-shop__vendor {
  margin: 0;
  color: var(--text-secondary, #666);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.quick-shop__close {
  display: inline-flex;
  width: 2.55rem;
  height: 2.55rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--foreground, #111) 6%, transparent);
  color: inherit;
  cursor: pointer;
}

.quick-shop__close svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.quick-shop__close:hover {
  background: color-mix(in srgb, var(--foreground, #111) 10%, transparent);
}

.quick-shop__close:focus-visible,
.quick-shop__thumbnail:focus-visible,
.quick-shop__option:focus-visible,
.quick-shop__add:focus-visible,
.quick-shop__full-link:focus-visible,
.quick-shop__error button:focus-visible {
  outline: 2px solid var(--foreground, #111);
  outline-offset: 3px;
}

.quick-shop__status,
.quick-shop__error {
  align-self: start;
  margin: 2rem 1.25rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface, #f5f5f5);
  color: var(--text-secondary, #666);
  font-size: 0.875rem;
}

.quick-shop__status::after {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 0.8rem;
  background: linear-gradient(90deg, transparent, var(--primary, #111), transparent);
  background-size: 200% 100%;
  content: "";
  animation: quick-shop-loading 1.2s linear infinite;
}

@keyframes quick-shop-loading {
  to { background-position: -200% 0; }
}

.quick-shop__content {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.quick-shop__gallery {
  padding: 1.25rem 1.25rem 0;
}

.quick-shop__image-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: max(0px, var(--media-radius, 0px));
  background: var(--surface, #f5f5f5);
}

.quick-shop__image-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-shop__image-count {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg, #fff) 90%, transparent);
  color: var(--foreground, #111);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.quick-shop__thumbnails {
  display: grid;
  grid-auto-columns: 4rem;
  grid-auto-flow: column;
  gap: 0.5rem;
  margin-top: 0.65rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.quick-shop__thumbnail {
  overflow: hidden;
  width: 4rem;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: max(0px, var(--media-radius, 0px));
  background: var(--surface, #f5f5f5);
  cursor: pointer;
}

.quick-shop__thumbnail.is-active {
  border-color: var(--foreground, #111);
}

.quick-shop__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-shop__copy {
  padding: 1.5rem 1.25rem 2rem;
}

.quick-shop__title {
  margin: 0.35rem 0 0;
  color: inherit;
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.quick-shop__price {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-top: 0.7rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quick-shop__price s {
  color: var(--text-secondary, #666);
  font-size: 0.88rem;
  font-weight: 400;
}

.quick-shop__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.quick-shop__tag {
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  background: var(--surface, #f5f5f5);
  color: var(--text-secondary, #666);
  font-size: 0.68rem;
  font-weight: 600;
}

.quick-shop__description {
  display: -webkit-box;
  overflow: hidden;
  margin: 1rem 0 0;
  color: var(--text-secondary, #666);
  font-size: 0.88rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.quick-shop__options {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.45rem;
}

.quick-shop__option-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.quick-shop__option-label {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.quick-shop__option-selected {
  color: var(--text-secondary, #666);
  font-weight: 500;
}

.quick-shop__option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-shop__option {
  position: relative;
  min-width: 2.7rem;
  min-height: 2.45rem;
  padding: 0.58rem 0.75rem;
  border: 1px solid var(--border-dark, rgba(10, 10, 10, 0.15));
  border-radius: max(0px, calc(var(--buttons-radius, 0px) * 0.75));
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.quick-shop__option:hover:not(:disabled) {
  border-color: var(--foreground, #111);
}

.quick-shop__option.is-selected {
  border-color: var(--foreground, #111);
  background: var(--foreground, #111);
  color: var(--bg, #fff);
}

.quick-shop__option:disabled {
  color: var(--text-subtle, #999);
  cursor: not-allowed;
  text-decoration: line-through;
}

.quick-shop__option--color {
  padding-left: 2rem;
}

.quick-shop__option--color::before {
  position: absolute;
  top: 50%;
  left: 0.65rem;
  width: 0.82rem;
  height: 0.82rem;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 50%;
  background: var(--swatch-color, #bbb);
  content: "";
  transform: translateY(-50%);
}

.quick-shop__confidence,
.quick-shop__details {
  margin-top: 1.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, rgba(10, 10, 10, 0.08));
}

.quick-shop__confidence h3,
.quick-shop__details h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.quick-shop__confidence-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.52rem 0;
  border-top: 1px solid var(--border, rgba(10, 10, 10, 0.08));
  font-size: 0.76rem;
  line-height: 1.5;
}

.quick-shop__confidence-row:first-child {
  border-top: 0;
}

.quick-shop__confidence-row dt {
  color: var(--foreground, #111);
  font-weight: 700;
}

.quick-shop__confidence-row dd {
  margin: 0;
  color: var(--text-secondary, #666);
}

.quick-shop__detail {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border, rgba(10, 10, 10, 0.08));
  font-size: 0.78rem;
  line-height: 1.5;
}

.quick-shop__detail:first-child {
  border-top: 0;
}

.quick-shop__detail strong {
  font-weight: 700;
}

.quick-shop__detail span {
  color: var(--text-secondary, #666);
}

.quick-shop__footer {
  padding: 0.9rem 1.25rem 1.15rem;
  border-top: 1px solid var(--border, rgba(10, 10, 10, 0.08));
  background: var(--bg, #fff);
}

.quick-shop__selection {
  min-height: 1.1rem;
  margin: 0 0 0.45rem;
  color: var(--text-secondary, #666);
  font-size: 0.72rem;
}

.quick-shop__add {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.8rem 1rem;
  border: var(--buttons-border-width, 1px) solid var(--buttons-border-color, transparent);
  border-radius: var(--buttons-radius, 0);
  background: var(--scheme-btn-bg, var(--primary, #111));
  color: var(--scheme-btn-label, #fff);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.quick-shop__add:hover:not(:disabled) {
  filter: brightness(0.92);
}

.quick-shop__add:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.quick-shop__full-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  margin-top: 0.35rem;
  color: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  text-underline-offset: 0.2rem;
}

.quick-shop__full-link svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-shop__error p {
  margin: 0 0 0.75rem;
}

.quick-shop__error button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 767px) {
  .product-card__gallery-arrow {
    width: 1.9rem;
    height: 1.9rem;
    opacity: 1;
    transform: none;
  }

  .product-card__quick-add {
    right: 0.45rem;
    bottom: 0.45rem;
    left: 0.45rem;
    min-height: 2.5rem;
  }

  .product-card__gallery-dots {
    top: calc(50% + 3.35rem);
  }

  .product-card .product-card__badge--bottom-left,
  .product-card .product-card__badge--bottom-right {
    bottom: 3.6rem;
  }

  .product-card__option-row {
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .product-card__option-chip {
    max-width: 5.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .quick-shop__drawer {
    width: min(32rem, calc(100vw - 1rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card__image,
  .product-card__gallery-arrow,
  .product-card__quick-add,
  .quick-shop__overlay,
  .quick-shop__drawer {
    transition: none;
  }

  .quick-shop__status::after {
    animation: none;
  }
}
