.product-card__add-form {
  width: 100%;
}

.product-card__add.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.product-card__add.is-added {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.product-card__price,
.product-card__price * {
  font-weight: 700;
}

img.services__item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero__card--video-only .hero__video {
  opacity: 1;
}

/* QAVE bundle: main { margin-top: var(--header-height) }.
   Margin sits outside .hero and shows as a light strip under the fixed header.
   Clear it on the homepage; desktop spacing is .hero__container padding (dark). */
html {
  scrollbar-gutter: auto !important;
}

body.page,
body.page main.main,
main.main {
  margin-top: 0 !important;
}

body.page {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: normal;
  color: #000;
  padding-top: 0;
}

@media (max-width: 1199.98px) {
  body.page {
    padding-top: 60px;
  }
}

/* Mobile keeps visual order: title → media → footer */
@media (max-width: 1023.98px) {
  .hero__copy {
    display: contents;
  }

  body.page h1.hero__title,
  .hero__title {
    order: -1;
    white-space: normal;
    width: 100%;
    max-width: 100%;
    font-family: var(--second-family);
    font-weight: 400;
    font-size: min(62px, 15.8vw);
    line-height: 0.86;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  /* Design: "КОФЕ С АРОМАТОМ" / "КРЫМА" */
  .hero__title-word:last-child {
    display: block;
  }

  /* Section headings: condensed Bebas, 1–2 lines like the mockups */
  body.page h2.section__title,
  .section__title {
    font-family: var(--second-family);
    font-weight: 400;
    font-size: min(64px, 14vw);
    line-height: 0.86;
    letter-spacing: 0;
    text-transform: uppercase;
    width: 100%;
    max-width: 100%;
    white-space: normal;
  }

  .section__title-line {
    display: block;
    white-space: nowrap;
  }
}

/* Desktop: pin hero under the header; grow with content so the title is not clipped. */
@media (min-width: 1024px) {
  .hero {
    height: auto;
    min-height: 100vh;
    align-items: flex-start;
    overflow: hidden;
  }

  .hero__container {
    flex: 0 0 auto;
    width: 100%;
    /* Clear fixed header + breathing room (bundle zeroes padding-top from 1024px). */
    padding-top: calc(var(--header-height) + 48px) !important;
    padding-bottom: 40px;
    justify-content: flex-start;
    min-height: 0;
  }

  /* Align hero copy with section titles (same container left edge). */
  .hero__copy {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    align-self: stretch;
  }

  .hero__footer {
    order: 0;
    width: 100%;
    gap: 24px;
  }

  .hero__subtitle {
    max-width: none;
    margin: 0;
    line-height: 1.25;
    text-align: left;
  }

  /* Design title is ~full-bleed; theme only unlocks large size from 1640px.
     JS (fitHeroTitle) fine-tunes size so К…А sit on container edges. */
  .hero__title {
    order: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    margin-top: -6px;
    text-align: left;
    overflow: visible;
    white-space: nowrap;
    font-family: var(--second-family);
    font-weight: 700;
    font-size: clamp(96px, 13.2vw, 220px);
    line-height: 0.92;
    letter-spacing: 0.01em;
  }

  .hero__title-word {
    overflow: visible;
  }
}

.header__action--cart {
  position: relative;
}

.header__cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: #271812;
  font-size: 11px;
  line-height: 18px;
  font-weight: 700;
  text-align: center;
}

.header__cart-count--empty {
  display: none;
}

.mfp-bg,
.mfp-wrap {
  z-index: 10000;
}

.c-magnific-popup.mfp-bg {
  opacity: 1;
  background-color: rgba(15, 9, 6, 0.85);
}

/* Hide quantity step label (±1) unless step is actually > 1 */
.c-quantity:not(.c-quantity_step) .c-quantity__step {
  display: none;
}

/*
 * Bestsellers: theme enables 3+banner grid only from 1640px, so at 100% laptop
 * widths (1280–1600) Swiper forces 3 stretched slides (~450px). Use the grid
 * earlier; JS media for bestsellers is patched to max-width 1269.98px.
 */
@media (min-width: 1270px) {
  .bestsellers__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2.05fr);
    gap: 30px;
  }

  .bestsellers__slider,
  .bestsellers__slider .bestsellers__viewport,
  .bestsellers__slider .bestsellers__list {
    display: contents;
  }
}

@media (min-width: 1440px) {
  .bestsellers__grid {
    grid-template-columns: repeat(3, 317px) minmax(0, 1fr);
  }

  .new-products .product-slider__item {
    width: 317px !important;
  }
}

/*
 * Slider arrows: restore theme hover (light fill), not primary brown.
 */
.product-slider__btn:hover:not(:disabled):not(.swiper-button-disabled),
.reviews__btn:hover:not(:disabled):not(.swiper-button-disabled) {
  background-color: var(--background);
  color: #000;
}

.tea-collection .product-slider__btn:hover:not(:disabled):not(.swiper-button-disabled) {
  background-color: var(--primary);
}

.tea-collection .product-slider__btn:hover:not(:disabled):not(.swiper-button-disabled) .product-slider__btn-icon {
  filter: invert(1);
}

.product-slider__btn.swiper-button-disabled,
.reviews__btn.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/*
 * Card hover scale: Swiper owns transform on .swiper-slide, so .product-card
 * must be an inner element. Match bestsellers easing (scale 1.04).
 * Do not set overflow:visible on .swiper — the wrapper is as wide as all
 * slides and that creates a page-level horizontal scrollbar.
 */
@media (min-width: 1024px) {
  html,
  body.page {
    overflow-x: clip;
    max-width: 100%;
  }

  .hero {
    overflow-x: hidden;
  }

  .hero__media {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
  }
}

.video-modal {
  width: 100%;
  max-width: 100%;
}

.product-card__weights {
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.product-card__weight {
  padding-top: 12px;
}

.product-card__weight-label {
  position: relative;
  min-width: 0;
  height: 32px;
  padding: 0 6px;
  justify-content: center;
}

.product-card__weight-discount {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 1px);
  text-align: center;
  line-height: 1;
}

.product-card__weight-value {
  font-size: 13px;
}

/* Keep weights + grind on one row; grind aligns with weight pills. */
.product-card__options {
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px;
}

.product-card__grind {
  flex: 0 0 auto;
  max-width: 44%;
  height: 32px;
  margin-left: 0;
  align-self: flex-end;
}

.product-card__grind-select {
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  min-width: 108px;
  height: 32px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background-color: #f5f5f7;
  box-shadow: none;
  padding: 0 30px 0 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 32px;
  color: #301910;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.product-card__options--stacked {
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.product-card__options--stacked .product-card__weights {
  width: 100%;
}

.product-card__options--stacked .product-card__weight {
  flex: 1 1 0;
  min-width: 0;
}

.product-card__options--stacked .product-card__weight-label {
  width: 100%;
}

.product-card__options--stacked .product-card__grind {
  flex: 1 1 100%;
  max-width: 100%;
}

.product-card__options--stacked .product-card__grind-select {
  width: 100%;
  text-align: center;
  text-align-last: center;
}

.product-card--tea .product-card__weight-discount:empty {
  display: none;
}

.product-card__grind-select:hover {
  background-color: #ececef;
}

.product-card__grind-select:focus {
  outline: none;
  background-color: #fff;
  border-color: rgba(48, 25, 16, 0.14);
  box-shadow: 0 0 0 3px rgba(48, 25, 16, 0.08);
}

.product-card__grind-icon {
  width: 14px;
  height: 14px;
  right: 10px;
  opacity: 0.7;
}

.bestsellers__item,
.product-slider__item {
  height: auto;
  display: flex;
  flex-direction: column;
}

.bestsellers__item > .product-card,
.product-slider__item > .product-card {
  flex: 1 1 auto;
  height: 100%;
  width: 100%;
}

.product-card__image {
  flex-shrink: 0;
  height: 143px;
}

.product-card__content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.product-card__title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Reserve vertical space when label / tastes / characteristics are missing. */
.product-card__header {
  flex-shrink: 0;
  height: 20px;
  min-height: 20px;
  overflow: hidden;
}

.product-card__label {
  display: block;
  min-height: 1.2em;
  line-height: 1.2;
}

.product-card__label--empty {
  visibility: hidden;
  pointer-events: none;
}

.product-card__badge--empty {
  visibility: hidden;
  pointer-events: none;
  min-height: 20px;
  min-width: 1px;
}

.product-card:not(.product-card--tea) .product-card__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.product-card__title-link.t-crop--two-l {
  height: calc(2 * 1.25em);
  min-height: calc(2 * 1.25em);
  line-height: 1.25;
}

.product-card__tastes {
  height: calc(2 * 1.35em);
  min-height: calc(2 * 1.35em);
  flex-shrink: 0;
  overflow: hidden;
}

.product-card__tastes--empty {
  visibility: hidden;
  pointer-events: none;
}

.product-card:not(.product-card--tea) .product-card__characteristics {
  flex-shrink: 0;
}

.product-card__characteristic-title {
  display: block;
  font-size: 14px;
  min-height: 1.2em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card__characteristics {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: calc(1.2em + 12px);
}

.product-card__characteristic {
  flex: 0 1 auto;
  min-width: 0;
}

.product-card__characteristics--empty {
  visibility: hidden;
  pointer-events: none;
}

.product-card__options-wrapper {
  margin-top: auto;
}

/* Tea cards keep the compact layout, but optional rows must not collapse. */
.product-card--tea .product-card__header {
  min-height: 20px;
}

.product-card--tea .product-card__image {
  flex-shrink: 0;
}

.product-card--tea .product-card__title-wrapper {
  gap: 0;
}

.product-card--tea .product-card__title-link {
  height: 1.25em;
  line-height: 1.25;
}

.product-card--tea .product-card__tastes {
  height: 1.35em;
  min-height: 1.35em;
}

.product-card--tea .product-card__weight {
  padding-top: 0;
}

.product-card--tea .product-card__weight-label {
  flex-direction: column;
}

.product-card--tea .product-card__weight-discount {
  position: static;
}

.product-slider__viewport .swiper-wrapper,
.bestsellers__slider .swiper-wrapper {
  align-items: stretch;
}

.tea-collection .product-slider__item {
  width: 317px !important;
}

@media (min-width: 1024px) {
  .product-card:not(.product-card--tea) .product-card__title-link.t-crop--two-l {
    height: auto;
    min-height: 1.25em;
  }

  .product-card:not(.product-card--tea) .product-card__meta {
    margin-top: -16px;
  }

  .product-card:not(.product-card--tea) .product-card__image {
    height: 179px;
  }

  .product-card:not(.product-card--tea) .product-card__image-img {
    max-width: 179px;
  }

  .product-card__weight-label {
    min-width: 63px;
  }
}

@media (max-width: 1023.98px) {
  .product-card:not(.product-card--tea) .product-card__title-link.t-crop--two-l {
    height: auto;
    min-height: calc(1.25 * 15px);
  }

  .product-card:not(.product-card--tea) .product-card__meta {
    margin-top: -6px;
  }

  .product-card:not(.product-card--tea) .product-card__image {
    height: 143px;
  }

  .product-card:not(.product-card--tea) .product-card__image-img {
    max-width: 143px;
  }
}

.product-slider__viewport,
.bestsellers__viewport {
  padding-block: 16px;
  margin-block: -16px;
}

.product-card {
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.product-slider__item.swiper-slide,
.bestsellers__item.swiper-slide {
  overflow: visible;
}

/* Desktop only: hover scale. Mobile keeps cards at 1:1. */
@media (max-width: 1023.98px) {
  .product-card,
  .product-card:hover,
  .product-card:focus-within {
    transform: none !important;
    transition: none;
  }
}

@media (min-width: 1024px) {
  .product-card:hover,
  .product-card:focus-within {
    transform: scale(1.04);
  }

  .swiper-slide:has(.product-card:hover),
  .swiper-slide:has(.product-card:focus-within) {
    z-index: 3;
  }
}

/* Mobile-only layout fixes */
@media (max-width: 1023.98px) {
  html {
    scrollbar-gutter: auto !important;
  }

  html,
  body.page {
    overflow-x: clip;
    overscroll-behavior-x: none;
    width: 100%;
    max-width: 100%;
  }

  body.page,
  main.main {
    overflow-x: clip;
    max-width: 100%;
  }

  .header {
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
  }

  .hero,
  .hero__bg,
  .section,
  .footer,
  .container {
    overflow-x: clip;
    max-width: 100%;
    min-width: 0;
  }

  .hero__media {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    padding: 24px 16px 20px;
    scroll-padding-inline: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .product-slider__viewport.swiper,
  .bestsellers__viewport.swiper {
    overflow: hidden;
    max-width: 100%;
  }

  .product-slider__item.swiper-slide,
  .bestsellers__item.swiper-slide {
    overflow: hidden;
  }

  .section__title,
  .section__title-line {
    max-width: 100%;
  }

  .hero__item {
    width: 220px;
  }

  .hero__item + .hero__item {
    margin-left: -48px;
  }

  .hero__card {
    width: 266.93px;
    height: 292.54px;
    aspect-ratio: 266.93 / 292.54;
  }

  .product-slider__item.swiper-slide,
  .bestsellers__item.swiper-slide {
    width: 267px !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    align-self: stretch;
  }

  .bestsellers__item > .product-card,
  .product-slider__item > .product-card {
    flex: 1 1 auto;
    height: 100%;
  }

  .product-card {
    padding: 16px 14px 14px;
    gap: 8px;
  }

  .product-card__content {
    gap: 10px;
  }

  .product-card__image-img {
    max-width: 118px;
  }

  .product-card__header {
    height: 24px;
    min-height: 24px;
    align-items: flex-start;
  }

  .product-card__image {
    height: 118px;
    flex-shrink: 0;
  }

  .product-card__label {
    font-size: 12px;
  }

  .product-card__title a {
    font-size: 15px;
  }

  .product-card__title-link.t-crop--two-l {
    display: -webkit-box;
    height: calc(2 * 1.25 * 15px);
    min-height: calc(2 * 1.25 * 15px);
    line-height: 1.25;
  }

  .product-card:not(.product-card--tea) .product-card__meta {
    min-height: 58px;
  }

  .product-card__tastes {
    height: calc(2 * 1.35 * 12px);
    font-size: 12px;
    min-height: calc(2 * 1.35 * 12px);
    flex-shrink: 0;
    overflow: hidden;
  }

  .product-card:not(.product-card--tea) .product-card__characteristics {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 6px;
    min-height: calc(11px * 1.2 + 6px + 6px);
  }

  .product-card__characteristic {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: flex-start;
    width: auto;
    min-width: 0;
  }

  .product-card__characteristic-title {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .product-card__rating {
    gap: 3px;
  }

  .product-card__rating-dot {
    width: 6px;
    height: 6px;
  }

  .product-card__weight {
    padding-top: 10px;
  }

  .product-card__grind {
    max-width: 38%;
  }

  .product-card__grind-select {
    min-width: 0;
    width: 100%;
    font-size: 12px;
    padding: 0 22px 0 8px;
  }

  .product-card__add {
    height: 44px;
    font-size: 15px;
  }

  .services__list {
    width: 100%;
    align-items: stretch;
    gap: 16px;
  }

  .services__item {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    aspect-ratio: 363 / 424;
    border-radius: 24px;
  }

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

  .services__item-content {
    padding: 28px 24px;
  }

  .services__item-title {
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1;
  }

  .services__item-text {
    font-size: clamp(14px, 4vw, 16px);
    line-height: 1.35;
  }

  .services__item-content .btn,
  .services__item-content .btn--light {
    min-width: 0;
    height: 48px;
    padding: 0 28px;
    border-radius: 999px;
  }
}


.product-card__tastes.product-card__tastes--chips {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  position: relative;
  z-index: 1;
  gap: 3px;
  height: 39px;
  max-height: none;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-height: 1;
}

.product-card__tastes--chips.t-crop--one-l {
  height: 18px;
}

.product-card__tastes--chips .product-card__taste {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 18px;
  padding: 1px 5px;
  border-radius: 10px;
  background-color: var(--taste-bg, #271812);
  color: var(--taste-color, #fff);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  white-space: nowrap;
}

.product-card__tastes--chips .product-card__taste::before,
.product-card__tastes--chips .product-card__taste::after {
  content: none;
}

.product-card__tastes--chips.product-card__tastes--empty .product-card__taste {
  background-color: transparent;
}

.product-card__tastes--chips .product-card__taste[hidden] {
  display: none;
}

.product-card__tastes--chips .product-card__taste--more {
  padding: 1px 0;
  background-color: transparent;
}

.product-card__taste-more-link {
  color: var(--primary);
  text-decoration: none;
}
