/* Home runtime: lock top-sales geometry to the static mockup contract. */
@media (min-width: 1024px) {
  body[data-page-type='home'] .bento {
    grid-template-rows: repeat(2, 341px);
  }

  body[data-page-type='home'] .bento-featured {
    height: 702px;
    min-height: 0;
  }

  body[data-page-type='home'] .bento-featured__img-link {
    flex: 0 0 524px;
    width: 100%;
    min-height: 0;
  }

  body[data-page-type='home'] .bento-featured__img {
    width: 100%;
    height: 524px;
    min-height: 0;
    flex: none;
  }

  body[data-page-type='home'] .bento-featured__body {
    height: 176px;
    max-height: 176px;
    min-height: 0;
    overflow: hidden;
  }

  body[data-page-type='home'] .bento .prod-card {
    height: 341px;
    min-height: 0;
  }

  body[data-page-type='home'] .bento .prod-card__body {
    height: 159px;
    max-height: 159px;
    min-height: 0;
    overflow: hidden;
  }
}

/* Home runtime: mobile product cards must keep the mockup geometry. */
@media (max-width: 479px) {
  body[data-page-type='home'] .bento {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
}

@media (min-width: 480px) and (max-width: 1023px) {
  body[data-page-type='home'] .bento {
    grid-template-rows: auto;
  }
}

@media (max-width: 767px) {
  body[data-page-type='home'] .hero-cards {
    align-items: center;
  }

  body[data-page-type='home'] .hero-slider {
    margin-right: auto;
    margin-left: auto;
  }

  body[data-page-type='home'] .bento-featured__name,
  body[data-page-type='home'] .bento .prod-card__name,
  body[data-page-type='home'] .arrivals-grid .prod-card__name {
    display: block;
    min-height: 0;
    margin-block: 0;
    padding-block: 0;
  }

  body[data-page-type='home'] .bento-featured__cat,
  body[data-page-type='home'] .bento .prod-card__cat,
  body[data-page-type='home'] .arrivals-grid .prod-card__cat {
    align-self: flex-start;
    min-height: 0;
  }

  body[data-page-type='home'] .bento .prod-card__body,
  body[data-page-type='home'] .arrivals-grid .prod-card__body {
    padding: 12px;
  }

  body[data-page-type='home'] .bento-featured .cart-action .btn,
  body[data-page-type='home'] .bento .prod-card .cart-action .btn,
  body[data-page-type='home'] .arrivals-grid .prod-card .cart-action .btn {
    min-height: 44px;
  }
}

/* iPad portrait (768–1023px): keep the hero two-column (heading/text left, ONE card right) and
   top-aligned at the heading level — instead of the default ≤1023 stacking — but show a single card
   (the proven phone treatment), not the desktop coverflow which spread/clipped here.
   (≥1024 keeps the desktop coverflow; ≤767 stacks a single card.) */
@media (min-width: 768px) and (max-width: 1023px) {
  body[data-page-type='home'] .hero-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: clamp(20px, 3vw, 40px);
  }
  body[data-page-type='home'] .hero-cards {
    padding-inline: 0;
  }
  body[data-page-type='home'] .hero-slider {
    width: min(100%, 360px);
    height: auto;
    margin-inline: auto;
    perspective: none;
  }
  body[data-page-type='home'] .hero-card {
    position: relative;
    bottom: auto;
    left: auto;
  }
  body[data-page-type='home'] .hero-card:not(.is-active) {
    display: none;
  }
  body[data-page-type='home'] .hero-card__img {
    height: 240px;
  }

  /* Dots stay a small dot-in-tap-target (used to switch the single card). Without this the ≤1023
     touch-target rule would render them as big 44px solid circles. */
  body[data-page-type='home'] .hero-slider-dot {
    width: 30px;
    min-width: 30px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none;
  }
  body[data-page-type='home'] .hero-slider-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-1);
  }
  body[data-page-type='home'] .hero-slider-dot.is-active {
    background: transparent;
    transform: none;
  }
  body[data-page-type='home'] .hero-slider-dot.is-active::before {
    background: var(--leaf-dark);
    transform: scale(1.3);
  }
  body[data-page-type='home'] .hero-slider-dots {
    gap: 0;
  }
}

/* Топ-продаж (.bento): фото заполняет ячейку (cover) с лёгким сдвигом кадра вверх,
   чтобы крона не срезалась. Прежний contain + размытая подложка убраны — на узких
   ячейках давали мелкое фото и полосы по краям. */
.bento .bento-featured__img img,
.bento .prod-card__img img { object-fit: cover; object-position: 50% 28%; }
