.product-main__container {
  padding-top: var(--product-main-padding-top, 40px);
  padding-bottom: var(--product-main-padding-bottom, 60px);
}

.product-main__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, var(--product-main-gap, 48px), 64px);
  align-items: start;
}

.product-gallery { position: relative; min-width: 0; }
.product-gallery-main { width: 100%; aspect-ratio: 1/1; overflow: hidden; background: var(--surface); }
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s ease; }
.product-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; }
.product-thumbs::-webkit-scrollbar { display: none; }
.product-thumb { width: 72px; height: 72px; flex-shrink: 0; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; background: var(--surface); scroll-snap-align: start; }
.product-thumb.active { border-color: var(--foreground); }
.product-thumb:hover { border-color: var(--border-dark); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { display: flex; flex-direction: column; gap: 0; min-width: 0; padding-top: 0.5rem; }
.product-title { font-weight: 600; line-height: 1.15; margin: 0 0 12px; color: var(--foreground); letter-spacing: var(--font-heading-letter-spacing, 0); overflow-wrap: anywhere; }
.product-title--small { font-size: calc(1.375rem * var(--font-heading-scale, 1)); }
.product-title--medium { font-size: calc(1.625rem * var(--font-heading-scale, 1)); }
.product-title--large { font-size: calc(2rem * var(--font-heading-scale, 1)); }
.product-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 24px; }
.product-price__current { font-size: calc(1.75rem * var(--font-heading-scale, 1)); font-weight: 600; color: var(--foreground); line-height: 1.15; }
.product-price__compare { font-size: 1.125rem; color: var(--text-secondary); text-decoration: line-through; }
.product-price__badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; background: var(--foreground); color: var(--background); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; line-height: 1; white-space: nowrap; }
.product-description { margin-bottom: 28px; color: var(--text-secondary); line-height: 1.7; }
.product-option-group { margin-bottom: 20px; }
.product-option-label { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 10px; color: var(--foreground); }
.product-option-label span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-secondary); }
.product-option-values { display: flex; flex-wrap: wrap; gap: 8px; }
.product-option-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 44px; padding: 0 16px; border: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--foreground); background: var(--background); cursor: pointer; transition: all 0.15s ease; }
.product-option-btn:hover { border-color: var(--foreground); }
.product-option-btn.selected { border-color: var(--foreground); background: var(--foreground); color: var(--background); }
.product-option-btn.unavailable { opacity: 0.35; text-decoration: line-through; cursor: not-allowed; }
/* Variant cards */
.variant-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.variant-card { position: relative; width: 120px; border: 1.5px solid transparent; border-radius: 4px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; background: var(--background); overflow: hidden; }
.variant-card:hover { border-color: var(--border-dark); }
.variant-card.selected { border-color: var(--foreground); box-shadow: 0 0 0 1px var(--foreground); }
.variant-card-img-wrap { position: relative; width: 100%; aspect-ratio: 1/1; background: var(--surface); overflow: hidden; }
.variant-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.variant-card-body { padding: 6px 8px 8px; }
.variant-card-title { font-size: 12px; font-weight: 500; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.variant-card-price { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.variant-card-badge { position: absolute; top: 0; right: 0; background: var(--foreground); color: var(--background); font-size: 9px; font-weight: 600; padding: 2px 6px; line-height: 1.3; z-index: 1; }
.variant-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.variant-card-placeholder svg { width: 28px; height: 28px; color: var(--border-dark); }
.product-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.product-form__fallback-row { display: flex; align-items: stretch; gap: 12px; }
.product-qty { display: inline-flex; align-items: center; border: 1px solid var(--border); height: 52px; margin-bottom: 6px; width: max-content; max-width: 100%; }
.product-qty button { width: 48px; height: 100%; display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text-secondary); transition: color 0.15s; }
.product-qty button:hover { color: var(--foreground); }
.product-qty input { width: 52px; height: 100%; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--foreground); background: transparent; -moz-appearance: textfield; }
.product-qty input::-webkit-outer-spin-button,
.product-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.product-atc { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; background: transparent; color: var(--foreground); font-size: 14px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; border: 1.5px solid var(--border-dark); cursor: pointer; transition: all 0.2s; }
.product-atc:hover { border-color: var(--foreground); }
.product-atc:disabled { opacity: 0.4; cursor: not-allowed; }
.product-buy-now { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center;  background: var(--scheme-btn-bg, var(--primary, #0a0a0a));
    color: var(--scheme-btn-label, var(--primary-text, #ffffff)); font-size: 14px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; border: none; cursor: pointer; transition: opacity 0.2s; }
.product-buy-now:hover { opacity: 0.85; }
.product-buy-now:disabled { opacity: 0.4; cursor: not-allowed; }
.product-cart-feedback { display: none; font-size: 13px; padding: 10px 14px; margin-top: 0; }
.product-trust { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-top: 1px solid var(--border); }
.product-meta-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.product-meta-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.product-accordion { border-top: 1px solid var(--border); }
.product-accordion summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--foreground); list-style: none; }
.product-accordion summary::-webkit-details-marker { display: none; }
.product-accordion summary svg { width: 16px; height: 16px; min-width: 16px; min-height: 16px; flex-shrink: 0; transition: transform 0.2s; color: var(--text-secondary); }
.product-accordion[open] summary svg { transform: rotate(180deg); }
.product-accordion .accordion-body { padding-bottom: 16px; font-size: 14px; line-height: 1.7; color: var(--text-secondary); }

@media (min-width: 990px) {
  .product-main__layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  }

  .product-main__layout--media-right {
    grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.08fr);
  }

  .product-main__layout--media-right .product-gallery {
    order: 2;
  }

  .product-main__layout--media-right .product-info {
    order: 1;
  }

  .product-info {
    position: sticky;
    top: 96px;
  }
}

@media (max-width: 989px) {
  .product-main__container {
    padding-top: min(var(--product-main-padding-top, 40px), 28px);
    padding-bottom: min(var(--product-main-padding-bottom, 60px), 40px);
  }

  .product-main__layout {
    gap: 24px;
  }

  .product-gallery-main {
    margin-left: -1rem;
    width: calc(100% + 2rem);
  }

  .product-thumbs {
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0 1rem 2px;
  }

  .product-info {
    padding-top: 0;
  }

  .product-title--small,
  .product-title--medium,
  .product-title--large {
    font-size: clamp(calc(1.5rem * var(--font-heading-scale, 1)), calc((1.35rem + 1vw) * var(--font-heading-scale, 1)), calc(2rem * var(--font-heading-scale, 1)));
  }

  .product-price__current {
    font-size: clamp(calc(1.375rem * var(--font-heading-scale, 1)), calc((1.2rem + 1vw) * var(--font-heading-scale, 1)), calc(1.75rem * var(--font-heading-scale, 1)));
  }

  .variant-cards {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .variant-cards::-webkit-scrollbar {
    display: none;
  }

  .variant-card {
    width: 128px;
    flex: 0 0 128px;
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  .product-main__layout {
    gap: 20px;
  }

  .product-gallery-main {
    aspect-ratio: 1 / 1;
  }

  .product-thumb {
    width: 64px;
    height: 64px;
  }

  .product-price {
    margin-bottom: 20px;
  }

  .product-option-group {
    margin-bottom: 18px;
  }

  .product-option-btn {
    min-width: 44px;
    min-height: 44px;
    height: auto;
    padding: 0.75rem 0.875rem;
  }

  .product-form__fallback-row {
    flex-direction: column;
  }

  .product-qty {
    width: 100%;
    justify-content: space-between;
  }

  .product-qty input {
    flex: 1;
    min-width: 0;
  }

  .product-buy-now,
  .product-atc {
    min-height: 52px;
    height: auto;
    padding: 0.875rem 1rem;
    white-space: normal;
    text-align: center;
  }

  .product-trust {
    padding-top: 14px;
  }

  .product-meta-item {
    align-items: flex-start;
    line-height: 1.45;
  }
}
