.article-product-gallery {
  margin: clamp(3.5rem, 8vw, 6rem) 0;
  padding: clamp(1.35rem, 3vw, 2rem);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 76%, transparent);
}

.article[data-article-slug="kak-nosit-velvetovuyu-yubku-bez-chernogo"] .article-cover {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(760px, 72vh);
  margin-right: auto;
  margin-left: auto;
  object-fit: contain;
  background: var(--surface);
}

.article-product-gallery__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.article-product-gallery__header > div:first-child { min-width: 0; }

.article-product-gallery__header .index { margin: 0 0 14px; }

.article-product-gallery h2 {
  max-width: 18ch;
  margin: 0;
  font-family: Unbounded, Arial, sans-serif;
  font-size: clamp(1.35rem, 3vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.article-product-gallery__intro {
  max-width: 45rem;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: clamp(.95rem, 1.7vw, 1.08rem);
  line-height: 1.55;
}

.article-product-gallery__controls {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.article-product-gallery__button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.article-product-gallery__button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.7;
}

.article-product-gallery__button:hover,
.article-product-gallery__button:focus-visible {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--bg);
  outline: none;
}

.article-product-gallery__viewport {
  display: grid;
  grid-auto-columns: minmax(220px, 31%);
  grid-auto-flow: column;
  gap: 14px;
  margin: 0 calc(clamp(1.35rem, 3vw, 2rem) * -1);
  padding: 0 clamp(1.35rem, 3vw, 2rem) 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-color: var(--primary) var(--surface);
  scrollbar-width: thin;
}

.article-product-card {
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color .18s ease, transform .18s ease;
}

.article-product-card:hover,
.article-product-card:focus-within {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.article-product-card a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.article-product-card a:focus-visible { outline: 2px solid var(--primary); outline-offset: -4px; }

.article-product-card figure { height: 100%; margin: 0; }

.article-product-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: var(--surface);
}

.article-product-card figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 11px;
  min-width: 0;
  padding: 14px;
}

.article-product-card__counter {
  grid-row: span 3;
  color: var(--primary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.article-product-card__brand,
.article-product-card__name,
.article-product-card__source { min-width: 0; overflow-wrap: anywhere; }

.article-product-card__brand {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.35;
  text-transform: uppercase;
}

.article-product-card__name {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.article-product-card__source {
  margin-top: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.article-product-gallery__hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .article[data-article-slug="kak-nosit-velvetovuyu-yubku-bez-chernogo"] .article-cover {
    width: 100%;
    max-height: 70vh;
  }

  .article-product-gallery { margin: 44px 0; padding: 20px; }
  .article-product-gallery__header { align-items: start; }
  .article-product-gallery h2 { font-size: 1.4rem; }
  .article-product-gallery__intro { margin: 14px 0 20px; }
  .article-product-gallery__controls { display: none; }
  .article-product-gallery__viewport {
    grid-auto-columns: minmax(72vw, 78vw);
    gap: 10px;
    margin: 0 -20px;
    padding: 0 20px 12px;
  }
  .article-product-card figcaption { padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .article-product-gallery__viewport { scroll-behavior: auto; }
  .article-product-card { transition: none; }
}
