/* Хиты продаж: горизонтальная лента карточек между каталогом и историей.
   Тот же язык, что у рецептов: крупный заголовок, скруглённые карточки, красный акцент. */

.hits-screen {
  --hit-gap: clamp(16px, 1.35vw, 26px);
  position: relative;
  z-index: 3;
  padding: clamp(40px, 5vh, 72px) 0 clamp(56px, 7vh, 96px);
  scroll-margin-top: var(--header-h);
  color: var(--color-ink);
  background: var(--color-paper);
  content-visibility: auto;
  contain-intrinsic-size: 820px;
}

.hits-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(24px, 4vw, 72px);
  margin-inline: var(--rail-w);
  margin-bottom: clamp(24px, 3vh, 40px);
}

.hits-heading h2 {
  margin: 0;
  font: 400 clamp(64px, 6vw, 118px)/0.84 var(--font-hero);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hits-heading__note {
  margin: clamp(12px, 1.6vh, 20px) 0 0;
  color: rgb(18 16 14 / 0.72);
  font: 400 clamp(19px, 1.45vw, 28px)/1.18 var(--font-display);
  letter-spacing: 0.02em;
}

.hits-heading__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(16px, 2vh, 26px);
}

.hits-all {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.2em 0 0.48em;
  border-bottom: 2px solid var(--color-accent);
  color: inherit;
  font-size: clamp(16px, 1.2vw, 22px);
  letter-spacing: 0.075em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 180ms ease;
}

.hits-all span { font: 1.2em/0.8 Arial, sans-serif; }

.hits-all:hover,
.hits-all:focus-visible { color: var(--color-accent); }

.hits-controls {
  display: flex;
  gap: 10px;
}

.hits-controls button {
  display: grid;
  width: clamp(46px, 3.7vw, 62px);
  height: clamp(46px, 3.7vw, 62px);
  padding: 0;
  place-items: center;
  border: 1px solid rgb(18 16 14 / 0.35);
  border-radius: 50%;
  color: var(--color-ink);
  background: #fff;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.hits-controls button:disabled { opacity: 0.28; cursor: default; }

.hits-controls button:not(:disabled):hover,
.hits-controls button:not(:disabled):focus-visible {
  border-color: var(--color-accent);
  color: #fff;
  background: var(--color-accent);
}

.hits-controls svg { width: 46%; height: 46%; stroke: currentColor; stroke-width: 1.5; }

.hits-track {
  display: flex;
  align-items: stretch;
  gap: var(--hit-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rail-w);
  padding: 4px var(--rail-w) 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.hits-track::-webkit-scrollbar { display: none; }

.hit-card {
  flex: 0 0 calc((100% - (3 * var(--hit-gap))) / 4);
  min-width: 0;
  overflow: hidden;
  border-radius: clamp(20px, 1.5vw, 28px);
  background: #f7f6f3;
  box-shadow: 0 12px 30px rgb(18 16 14 / 0.055);
  scroll-snap-align: start;
  transition: transform 260ms var(--ease-out-expo), box-shadow 260ms ease;
}

.hit-card__link {
  display: flex;
  height: 100%;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.hit-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: #efece7;
}

.hit-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.97) contrast(1.02);
  transition: transform 600ms var(--ease-out-expo);
}

/* Таитянская ваниль: точная фирменная коробка и сам продукт без вакуумного пакета. */
.hit-card__media--tahiti {
  isolation: isolate;
  background: #fff;
}

.hit-card__media--tahiti::after {
  position: absolute;
  z-index: -1;
  inset: auto 7% 6% 8%;
  height: 19%;
  border-radius: 50%;
  background: rgb(48 47 45 / 0.075);
  filter: blur(20px);
  content: "";
}

.hit-card__product {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  will-change: transform;
}

.hit-card__product--package {
  z-index: 1;
  top: 7%;
  bottom: 7%;
  left: 7%;
  width: auto;
  height: 86%;
  filter: drop-shadow(0 12px 10px rgb(18 16 14 / 0.14));
  transition: transform 520ms var(--ease-out-expo), filter 520ms ease;
}

.hit-card__product--pods {
  z-index: 2;
  right: 1.5%;
  bottom: 5%;
  width: auto;
  height: 78%;
  filter: drop-shadow(0 13px 11px rgb(18 16 14 / 0.17));
  transform: rotate(3deg);
  transform-origin: 60% 85%;
  transition: transform 600ms var(--ease-out-expo), filter 520ms ease;
}

.hit-card__open {
  position: absolute;
  z-index: 4;
  top: clamp(14px, 1.2vw, 20px);
  right: clamp(14px, 1.2vw, 20px);
  display: grid;
  width: clamp(38px, 3vw, 48px);
  height: clamp(38px, 3vw, 48px);
  place-items: center;
  border: 1px solid rgb(18 16 14 / 0.2);
  border-radius: 50%;
  color: var(--color-ink);
  background: rgb(255 255 255 / 0.92);
  transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, transform 420ms var(--ease-out-expo);
}

.hit-card__open svg {
  width: 52%;
  height: 52%;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Метка «Хит»: тот же красный, что у кнопок, без скруглений — как рамка прайса в шапке */
.hit-card__badge {
  position: absolute;
  z-index: 5;
  top: clamp(14px, 1.2vw, 20px);
  left: clamp(14px, 1.2vw, 20px);
  padding: 0.48em 0.75em 0.38em;
  color: #fff;
  background: var(--color-accent);
  font-family: var(--font-display);
  font-size: clamp(12px, 0.85vw, 15px);
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.hit-card__caption {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-height: clamp(150px, 11vw, 200px);
  padding: clamp(18px, 1.5vw, 26px) clamp(20px, 1.7vw, 30px) clamp(22px, 1.8vw, 30px);
}

.hit-card__category {
  margin: 0 0 clamp(8px, 0.8vw, 12px);
  color: rgb(18 16 14 / 0.62);
  font-size: clamp(12px, 0.85vw, 15px);
  line-height: 1.1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hit-card__title {
  margin: 0;
  font: 400 clamp(22px, 1.75vw, 32px)/1 var(--font-display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hit-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: auto;
  padding: clamp(16px, 1.3vw, 24px) 0 0.3em;
  border-bottom: 2px solid var(--color-accent);
  font-size: clamp(14px, 1vw, 19px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hit-card__more svg { width: 1.1em; height: 1.1em; stroke: currentColor; stroke-width: 2; }

.hit-card:hover,
.hit-card:focus-within {
  box-shadow: 0 18px 38px rgb(18 16 14 / 0.095);
  transform: translateY(-2px);
}

.hit-card__link:hover .hit-card__image,
.hit-card__link:focus-visible .hit-card__image { transform: scale(1.04); }

.hit-card--tahiti .hit-card__link:hover .hit-card__product--package,
.hit-card--tahiti .hit-card__link:focus-visible .hit-card__product--package {
  filter: drop-shadow(0 16px 14px rgb(18 16 14 / 0.18));
  transform: translateY(-3px) scale(1.015);
}

.hit-card--tahiti .hit-card__link:hover .hit-card__product--pods,
.hit-card--tahiti .hit-card__link:focus-visible .hit-card__product--pods {
  filter: drop-shadow(0 17px 13px rgb(18 16 14 / 0.2));
  transform: translate3d(6px, -4px, 0) rotate(5deg) scale(1.018);
}

.hit-card--tahiti .hit-card__link:hover .hit-card__open,
.hit-card--tahiti .hit-card__link:focus-visible .hit-card__open {
  border-color: var(--color-accent);
  color: #fff;
  background: var(--color-accent);
  transform: rotate(7deg);
}

.hit-card__link:hover .hit-card__title,
.hit-card__link:hover .hit-card__more,
.hit-card__link:focus-visible .hit-card__title,
.hit-card__link:focus-visible .hit-card__more { color: var(--color-accent); }

.hits-screen :is(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .hit-card { flex-basis: calc((100% - (2 * var(--hit-gap))) / 3); }
}

@media (max-width: 640px) {
  .hits-screen {
    --rail-w: 16px;
    --hit-gap: 12px;
    padding: 36px 0 36px;
  }

  .hits-heading {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 18px;
  }

  .hits-heading h2 { font-size: clamp(52px, 15vw, 66px); }
  .hits-heading__note { margin-top: 10px; font-size: clamp(17px, 4.8vw, 20px); }

  .hits-heading__aside { flex-direction: row; align-items: center; justify-content: space-between; }
  .hits-controls { display: none; }
  .hits-all { min-height: 44px; font-size: 13px; letter-spacing: 0.055em; }

  .hit-card { flex-basis: 72%; border-radius: 18px; }
  .hit-card__caption { min-height: 0; padding: 16px 18px 18px; }
  .hit-card__title { font-size: 21px; }
  .hit-card__more { padding-top: 14px; font-size: 13px; }
  .hit-card__product--package { top: 8%; bottom: 8%; left: 7%; height: 84%; }
  .hit-card__product--pods { right: 1%; bottom: 5%; height: 76%; }
}

@media (prefers-reduced-motion: reduce) {
  .hit-card, .hit-card__image, .hit-card__product, .hit-card__open, .hits-all, .hits-controls button { transition: none; }
}
