:root {
  --product-ink: #171b20;
  --product-muted: #68717b;
  --product-line: #e8ebee;
  --product-red: #ff3f3f;
  --product-green: #24a148;
  --product-max: 1160px;
}

.product-page-main { max-width: var(--product-max); margin: 0 auto; padding: 0 20px 80px; color: var(--product-ink); }
.product-page-main a { color: inherit; }
.product-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 -20px 38px; padding: 18px max(20px, calc((100vw - var(--product-max)) / 2 + 20px)); background: #f7f7f7; color: var(--product-muted); font-size: 14px; }
.product-breadcrumb a { color: #5d6872; text-decoration: none; }
.product-breadcrumb a:hover { color: var(--product-red); }
.product-breadcrumb .crumb-current { color: var(--product-ink); max-width: min(700px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr); gap: 42px; align-items: start; }
.product-gallery { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 18px; min-width: 0; }
.product-thumbs { display: flex; flex-direction: column; gap: 10px; }
.product-thumb { display: block; padding: 3px; border: 1px solid transparent; background: #fff; cursor: pointer; aspect-ratio: 1; overflow: hidden; }
.product-thumb.is-active { border-color: #20252a; }
.product-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-hero-image { display: block; width: 100%; aspect-ratio: 1; overflow: hidden; background: #f5f5f5; cursor: zoom-in; }
.product-hero-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-info { min-width: 0; }
.product-title { margin: 0 0 22px; font-size: clamp(1.7rem, 2.4vw, 2.35rem); line-height: 1.2; font-weight: 500; letter-spacing: .01em; }
.product-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 28px; }
.product-price { font-size: 2rem; line-height: 1; font-weight: 700; }
.product-old-price { color: #70777e; font-size: 14px; text-decoration: line-through; }
.product-meta { display: grid; gap: 9px; margin-bottom: 28px; color: var(--product-muted); font-size: 14px; }
.product-meta-row { display: flex; gap: 8px; }
.product-meta-label { flex: 0 0 80px; }
.product-meta-value { color: var(--product-ink); }
.product-meta-value a { color: var(--product-red); text-decoration: none; }
.product-stock { color: var(--product-green); }
.product-choices { display: grid; gap: 20px; margin-bottom: 24px; }
.product-choice-group { display: grid; gap: 9px; }
.product-choice-label { color: var(--product-muted); font-size: 14px; }
.product-choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
.product-choice { min-width: 54px; min-height: 38px; padding: 7px 14px; border: 1px solid #d4d9dd; background: #fff; color: var(--product-ink); cursor: pointer; font: inherit; }
.product-choice:hover:not(:disabled), .product-choice.is-selected { border-color: var(--product-ink); box-shadow: inset 0 0 0 1px var(--product-ink); }
.product-choice:disabled { color: #b4bac0; border-style: dashed; cursor: not-allowed; }
.product-purchase { display: grid; grid-template-columns: 92px 1fr 1fr; gap: 10px; align-items: stretch; margin-top: 28px; }
.product-quantity { display: grid; grid-template-columns: 1fr 28px; border: 1px solid #ccd2d7; min-height: 48px; }
.product-quantity input { width: 100%; min-width: 0; padding: 0 10px; border: 0; outline: 0; font: inherit; }
.product-quantity-controls { display: grid; grid-template-rows: 1fr 1fr; border-left: 1px solid #ccd2d7; }
.product-quantity-controls button { border: 0; background: #fff; color: #47515a; cursor: pointer; font-size: 12px; }
.product-quantity-controls button + button { border-top: 1px solid #ccd2d7; }
.product-action { min-height: 48px; padding: 0 16px; border: 1px solid #20252a; background: #fff; color: #20252a; cursor: pointer; font: inherit; font-weight: 600; }
.product-action:hover { background: #20252a; color: #fff; }
.product-action.is-primary { background: #20252a; color: #fff; }
.product-action.is-primary:hover { background: #000; }
.product-action:disabled { opacity: .45; cursor: not-allowed; }
.product-favorite { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; border: 0; background: transparent; color: #67717a; cursor: pointer; font: inherit; }
.product-favorite:hover, .product-favorite.is-saved { color: var(--product-red); }
.product-favorite .heart { font-size: 21px; line-height: 1; }
.product-tabs { margin-top: 72px; }
.product-tab-list { display: flex; justify-content: center; gap: 34px; border-bottom: 1px solid #dfe3e6; }
.product-tab { position: relative; padding: 0 4px 16px; border: 0; background: transparent; color: var(--product-ink); cursor: pointer; font: inherit; font-size: 18px; font-weight: 700; }
.product-tab.is-active { color: var(--product-red); }
.product-tab.is-active::after { position: absolute; content: ''; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--product-red); }
.product-tab-panel { display: none; padding: 18px 0 0; }
.product-tab-panel.is-active { display: block; }
.product-description img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.product-attributes { width: 100%; border-collapse: collapse; font-size: 14px; }
.product-attributes th, .product-attributes td { padding: 11px 14px; border: 1px solid var(--product-line); text-align: left; }
.product-attributes th { width: 35%; background: #fafafa; font-weight: 600; }
.related-products { margin-top: 68px; }
.related-heading { margin: 0 0 22px; text-align: center; font-size: 1.45rem; font-weight: 600; }
.related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.related-card { min-width: 0; text-decoration: none; }
.related-card-image { display: block; aspect-ratio: 1; overflow: hidden; background: #f5f5f5; }
.related-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.related-card:hover .related-card-image img { transform: scale(1.04); }
.related-card-title { display: -webkit-box; margin: 10px 0 7px; overflow: hidden; color: var(--product-ink); font-size: 14px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.related-card-price { color: var(--product-ink); font-weight: 700; }
.related-card-old { margin-left: 5px; color: #899097; font-size: 12px; text-decoration: line-through; }
.product-lightbox { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 30px; background: rgba(0,0,0,.82); }
.product-lightbox[hidden] { display: none; }
.product-lightbox img { max-width: min(900px, 94vw); max-height: 90vh; object-fit: contain; }
.product-lightbox-close { position: absolute; top: 18px; right: 24px; border: 0; background: transparent; color: #fff; font-size: 34px; cursor: pointer; }
.product-error, .product-loading { min-height: 320px; display: grid; place-items: center; color: var(--product-muted); }
.product-error a { color: var(--product-red); }
.product-toast { position: fixed; z-index: 1100; left: 50%; bottom: 24px; transform: translate(-50%, 14px); max-width: calc(100vw - 32px); padding: 11px 16px; background: #20252a; color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.product-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .product-top { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .product-info { max-width: 700px; }
  .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .product-page-main { padding: 0 14px 55px; }
  .product-breadcrumb { margin: 0 -14px 24px; padding: 14px; font-size: 12px; }
  .product-gallery { grid-template-columns: 60px minmax(0, 1fr); gap: 10px; }
  .product-thumbs { gap: 7px; }
  .product-title { margin-bottom: 15px; font-size: 1.45rem; }
  .product-price { font-size: 1.6rem; }
  .product-purchase { grid-template-columns: 84px 1fr; }
  .product-action.is-primary { grid-column: 2; }
  .product-action:not(.is-primary) { grid-column: 2; grid-row: 2; }
  .product-quantity { grid-row: 1 / span 2; }
  .product-tab-list { justify-content: flex-start; gap: 24px; overflow-x: auto; }
  .product-tab { white-space: nowrap; font-size: 16px; }
  .related-products { margin-top: 48px; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
