/* ==========================================================================
   AGAFIA — HOMEPAGE AND CAROUSEL STYLES

   Цей файл завантажується лише на index.html і відповідає за:
   1. Захист головної сторінки від горизонтального переповнення.
   2. Шапку та мобільне меню.
   3. Карусель головного екрана.
   4. Категорії.
   5. Блок історії.
   6. Переваги магазину.
   7. Картки товарів.
   8. Підписку та футер.
   ========================================================================== */

/* ==========================================================================
   1. ЗМІННІ ГОЛОВНОЇ СТОРІНКИ
   ========================================================================== */

:root {
  --home-ivory: #f8f4ee;
  --home-ivory-deep: #efe7dd;
  --home-paper: #fffdf9;
  --home-ink: #2e221d;
  --home-muted: #796c64;
  --home-wine: #8d252d;
  --home-wine-dark: #65181f;
  --home-border: #ddd1c5;
  --home-white: #ffffff;
  --home-container: 1320px;
  --home-header-height: 78px;
  --home-transition: 260ms ease;
}

/* ==========================================================================
   2. БАЗОВИЙ ЗАХИСТ РОЗМІТКИ
   ========================================================================== */

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--home-ink);
  background: var(--home-ivory);
  font-family:
    Inter,
    Arial,
    Helvetica,
    sans-serif;
  line-height: 1.5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
picture {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button {
  transition:
    color var(--home-transition),
    background-color var(--home-transition),
    border-color var(--home-transition),
    opacity var(--home-transition),
    transform var(--home-transition);
}

button {
  cursor: pointer;
}

main,
section,
article,
header,
footer,
nav,
div {
  min-width: 0;
}

h1,
h2,
h3,
.brand {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-weight: 400;
}

.container {
  width: min(calc(100% - 128px), var(--home-container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:focus-visible {
  outline: 3px solid rgba(141, 37, 45, 0.42);
  outline-offset: 4px;
}

/* ==========================================================================
   3. КНОПКИ
   ========================================================================== */

.button {
  display: inline-flex;
  min-height: 58px;
  padding: 14px 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--home-wine);
  border-radius: 0;
  background: var(--home-wine);
  color: var(--home-white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.button:hover {
  border-color: var(--home-wine-dark);
  background: var(--home-wine-dark);
  transform: translateY(-2px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--home-wine);
  font-size: 16px;
  font-weight: 700;
}

.text-link:hover {
  color: var(--home-wine-dark);
  transform: translateX(3px);
}

.text-link::after {
  content: none;
}

/* ==========================================================================
   4. ВЕРХНЯ ІНФОРМАЦІЙНА СМУГА
   ========================================================================== */

.announcement {
  position: relative;
  z-index: 50;
  display: flex;
  width: 100%;
  min-height: 30px;
  padding: 6px 20px;
  align-items: center;
  justify-content: center;
  background: var(--home-wine-dark);
  color: var(--home-white);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-align: center;
}

/* ==========================================================================
   5. ШАПКА САЙТУ
   ========================================================================== */

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  width: 100%;
  height: var(--home-header-height);
  border-bottom: 1px solid rgba(46, 34, 29, 0.1);
  background: rgba(252, 250, 246, 0.96);
  backdrop-filter: blur(12px);
}

.header__inner {
  position: relative;
  display: grid;
  min-height: var(--home-header-height);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  justify-self: start;
}

.main-nav a {
  position: relative;
  padding: 12px 2px;
  color: var(--home-ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color var(--home-transition);
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 1px;
  background: var(--home-wine);
  content: "";
  opacity: 0;
  transform: scaleX(0);
  transition:
    opacity var(--home-transition),
    transform var(--home-transition);
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.is-active,
.main-nav a[aria-current="page"] {
  color: var(--home-wine);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after,
.main-nav a.is-active::after,
.main-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.brand {
  justify-self: center;
  color: var(--home-ink);
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

@media (min-width: 768px) {
  .main-nav {
    transform: translateY(14px);
  }
}

.language-switcher,
.icon-button,
.menu-toggle {
  display: inline-flex;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--home-ink);
}

.language-switcher {
  gap: 3px;
  font-size: 11px;
}

.icon-button {
  position: relative;
  font-size: 17px;
  line-height: 1;
}

.icon-button:hover,
.language-switcher:hover,
.menu-toggle:hover {
  color: var(--home-wine);
}

.cart-count {
  position: absolute;
  top: 50%;
  right: -6px;
  display: inline-flex;
  width: 17px;
  min-width: 17px;
  height: 17px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--home-wine);
  color: var(--home-white);
  font-size: 9px;
  font-weight: 700;
  transform: translateY(-50%);
}

.menu-toggle {
  display: none;
  font-size: 22px;
}

/* ==========================================================================
   6. КАРУСЕЛЬ ГОЛОВНОГО ЕКРАНА
   ========================================================================== */

.homepage-carousel {
  position: relative;
  width: 100%;
  height: clamp(640px, calc(100svh - 134px), 830px);
  min-height: 640px;
  overflow: hidden;
  background: var(--home-ivory-deep);
  isolation: isolate;
}

.homepage-carousel__viewport,
.homepage-carousel__track {
  width: 100%;
  height: 100%;
}

.homepage-carousel__viewport {
  position: relative;
  overflow: hidden;
}

.homepage-carousel__track {
  position: relative;
  display: grid;
}

.homepage-carousel__slide {
  position: relative;
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 640px;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.015);
  transition:
    opacity 700ms ease,
    visibility 700ms ease,
    transform 1000ms ease;
}

.homepage-carousel__slide.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.homepage-carousel__slide::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(248, 244, 238, 0.95) 0%,
    rgba(248, 244, 238, 0.83) 25%,
    rgba(248, 244, 238, 0.28) 53%,
    rgba(248, 244, 238, 0.02) 76%
  );
  content: "";
  pointer-events: none;
}

.homepage-carousel__picture {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.homepage-carousel__picture .hero__image,
.homepage-carousel .hero__image {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position:
    var(--desktop-focal-x, 50%)
    var(--desktop-focal-y, 50%);
}

.homepage-carousel .hero {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 640px;
  margin: 0;
}

.homepage-carousel .hero__content {
  position: relative;
  z-index: 3;
  display: flex;
  width: min(calc(100% - 128px), var(--home-container));
  height: 100%;
  margin-inline: auto;
  padding-block: 72px 110px;
  align-items: center;
}

.homepage-carousel__copy {
  width: min(100%, 620px);
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--home-wine);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.35;
  text-transform: uppercase;
}

.homepage-carousel__copy h1 {
  max-width: 650px;
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(56px, 5.3vw, 92px);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.homepage-carousel__copy > p:not(.eyebrow) {
  max-width: 610px;
  margin: 32px 0 0;
  color: var(--home-ink);
  font-size: clamp(17px, 1.2vw, 21px);
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  margin-top: 38px;
  align-items: center;
  flex-wrap: wrap;
  gap: 26px;
}

.homepage-carousel__controls {
  position: absolute;
  z-index: 8;
  right: max(32px, calc((100vw - var(--home-container)) / 2));
  bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.homepage-carousel__arrow,
.homepage-carousel__pause {
  display: inline-flex;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(46, 34, 29, 0.24);
  background: rgba(248, 244, 238, 0.88);
  color: var(--home-ink);
  font-size: 15px;
  font-weight: 700;
  backdrop-filter: blur(9px);
}

.homepage-carousel__pause {
  min-width: 84px;
}

.homepage-carousel__arrow:hover,
.homepage-carousel__pause:hover {
  border-color: var(--home-wine);
  background: var(--home-wine);
  color: var(--home-white);
}

.homepage-carousel__dots {
  position: absolute;
  z-index: 8;
  bottom: 45px;
  left: max(32px, calc((100vw - var(--home-container)) / 2));
  display: flex;
  align-items: center;
  gap: 11px;
}

.homepage-carousel__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid var(--home-wine);
  border-radius: 999px;
  background: rgba(248, 244, 238, 0.8);
}

.homepage-carousel__dot.is-active {
  width: 28px;
  background: var(--home-wine);
}

/* ==========================================================================
   7. ЗАГАЛЬНЕ ОФОРМЛЕННЯ СЕКЦІЙ
   ========================================================================== */

.section {
  width: 100%;
  padding-block: 112px;
}

.section-heading {
  display: flex;
  margin-bottom: 50px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.section-heading > div {
  min-width: 0;
}

.section-heading h2 {
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(44px, 4vw, 70px);
  letter-spacing: -0.035em;
  line-height: 1.04;
}

/* ==========================================================================
   8. КАТЕГОРІЇ
   ========================================================================== */

.categories {
  background: var(--home-ivory);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.category-card {
  position: relative;
  display: block;
  min-height: 460px;
  overflow: hidden;
  background: var(--home-ivory-deep);
}

.category-card::after {
  position: absolute;
  inset: 44% 0 0;
  background: linear-gradient(
    to bottom,
    rgba(20, 13, 10, 0),
    rgba(20, 13, 10, 0.76)
  );
  content: "";
  pointer-events: none;
}

.category-card img {
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: cover;
  transition: transform 700ms ease;
}

.category-card span {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: 26px;
  left: 28px;
  color: var(--home-white);
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: clamp(28px, 2.1vw, 38px);
  line-height: 1.1;
}

.category-card:hover img {
  transform: scale(1.035);
}

/* ==========================================================================
   9. ІСТОРІЯ МАЙСТЕРНІ
   ========================================================================== */

.split-story {
  display: grid;
  width: min(calc(100% - 128px), var(--home-container));
  margin-inline: auto;
  padding-block: 0 112px;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  background: var(--home-paper);
}

.split-story__media {
  min-height: 660px;
  overflow: hidden;
}

.split-story__media img {
  width: 100%;
  height: 100%;
  min-height: 660px;
  object-fit: cover;
}

.split-story__content {
  display: flex;
  padding: clamp(56px, 6vw, 100px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.split-story__content h2 {
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(44px, 4vw, 70px);
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.split-story__content > p:not(.eyebrow) {
  margin: 30px 0 0;
  color: var(--home-muted);
  font-size: 18px;
  line-height: 1.75;
}

.split-story__content .text-link {
  margin-top: 32px;
}

/* ==========================================================================
   10. ПЕРЕВАГИ МАГАЗИНУ
   ========================================================================== */

.trust-strip {
  width: 100%;
  padding-block: 30px;
  border-top: 1px solid var(--home-border);
  border-bottom: 1px solid var(--home-border);
  background: var(--home-paper);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trust-item {
  display: grid;
  min-height: 132px;
  padding: 24px 34px;
  grid-template-columns: auto 1fr;
  align-content: center;
  align-items: center;
  gap: 8px 18px;
  border-right: 1px solid var(--home-border);
}

.trust-item:last-child {
  border-right: 0;
}

.trust-item > span {
  grid-row: 1 / 3;
  color: var(--home-wine);
  font-size: 22px;
}

.trust-item strong {
  color: var(--home-ink);
  font-size: 15px;
}

.trust-item small {
  color: var(--home-muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ==========================================================================
   11. КАРТКИ ТОВАРІВ
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 22px;
}

.product-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  min-width: 0;
}

.product-card > a,
.product-card > picture {
  display: block;
  min-width: 0;
}

.product-card > img,
.product-card > a > img,
.product-card > picture img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 0.82;
  object-fit: cover;
  background: var(--home-ivory-deep);
  transition: transform 600ms ease;
}

.product-card:hover > img,
.product-card:hover > a > img,
.product-card:hover > picture img {
  transform: translateY(-4px);
}

.product-card__meta {
  display: grid;
  padding-top: 17px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  align-items: start;
}

.product-card__meta h3 {
  min-width: 0;
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(24px, 1.8vw, 34px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.product-card__meta > span,
.product-card__meta > strong {
  color: var(--home-ink);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.product-card__meta p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--home-muted);
  font-size: 14px;
}

.homepage-products-state {
  display: grid;
  min-height: 260px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 48px 24px;
  border: 1px solid var(--home-border);
  text-align: center;
}

.homepage-products-state h3,
.homepage-products-state p {
  margin: 0;
}

.homepage-products-state h3 {
  color: var(--home-ink);
  font-size: clamp(26px, 3vw, 38px);
}

.homepage-products-state p {
  max-width: 520px;
}

.homepage-products-state .btn {
  justify-self: center;
}

/* ========================================================================== 
   12. ПІДПИСКА
   ========================================================================== */

.newsletter {
  width: 100%;
  padding-block: 84px;
  border-top: 1px solid var(--home-border);
  background: var(--home-ivory-deep);
}

.newsletter__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.7fr);
  align-items: end;
  gap: 64px;
}

.newsletter h2 {
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(42px, 3.8vw, 66px);
  line-height: 1.04;
}

.newsletter p:not(.eyebrow) {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--home-muted);
  font-size: 17px;
  line-height: 1.65;
}

.newsletter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.newsletter-form input {
  width: 100%;
  min-height: 58px;
  padding: 14px 18px;
  border: 1px solid var(--home-border);
  border-right: 0;
  border-radius: 0;
  background: var(--home-paper);
  color: var(--home-ink);
  outline: 0;
}

.newsletter-form input:focus {
  border-color: var(--home-wine);
  box-shadow: inset 0 0 0 1px var(--home-wine);
}

/* ==========================================================================
   13. ФУТЕР
   ========================================================================== */

.site-footer {
  width: 100%;
  padding-block: 78px 30px;
  border-top: 1px solid var(--home-border);
  background: var(--home-paper);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(4, minmax(130px, 0.75fr));
  gap: 52px;
}

.footer-grid > div {
  min-width: 0;
}

.brand--footer {
  display: inline-block;
  margin-bottom: 22px;
  font-size: 34px;
}

.footer-grid > div > p {
  max-width: 320px;
  margin: 0;
  color: var(--home-muted);
  font-size: 14px;
  line-height: 1.7;
}

.footer-grid h2 {
  margin: 4px 0 22px;
  color: var(--home-ink);
  font-family:
    Inter,
    Arial,
    sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.footer-grid div:not(:first-child) a {
  display: block;
  width: fit-content;
  margin-bottom: 12px;
  color: var(--home-muted);
  font-size: 14px;
}

.footer-grid div:not(:first-child) a:hover {
  color: var(--home-wine);
}

.footer-bottom {
  display: flex;
  margin-top: 64px;
  padding-top: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--home-border);
  color: var(--home-muted);
  font-size: 13px;
}

.footer-bottom > div {
  display: flex;
  gap: 22px;
}

.footer-bottom a:hover {
  color: var(--home-wine);
}

/* ==========================================================================
   14. ПЛАНШЕТИ
   ========================================================================== */

@media (max-width: 1200px) {
  .container,
  .homepage-carousel .hero__content,
  .split-story {
    width: min(calc(100% - 64px), var(--home-container));
  }

  .header__inner {
    gap: 18px;
  }

  .main-nav {
    gap: 24px;
  }

  .homepage-carousel__copy {
    width: min(54vw, 590px);
  }

  .category-grid,
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-story {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.85fr);
  }

  .trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trust-item:nth-child(2) {
    border-right: 0;
  }

  .trust-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--home-border);
  }

  .footer-grid {
    grid-template-columns: 1.2fr repeat(2, 0.8fr);
  }
}

/* ==========================================================================
   15. МОБІЛЬНЕ МЕНЮ ТА ВУЗЬКІ ПЛАНШЕТИ
   ========================================================================== */

@media (max-width: 900px) {
  :root {
    --home-header-height: 74px;
  }

  .container,
  .homepage-carousel .hero__content,
  .split-story {
    width: min(calc(100% - 40px), var(--home-container));
  }

  .header__inner {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .menu-toggle {
    display: inline-flex;
    grid-column: 1;
    justify-self: start;
  }

  .brand {
    grid-column: 2;
    justify-self: center;
    font-size: 32px;
  }

  .header__actions {
    grid-column: 3;
    gap: 2px;
  }

  .header__actions .icon-button {
    min-width: 36px;
    min-height: 36px;
  }

  .main-nav {
    position: absolute;
    z-index: 60;
    top: 100%;
    right: 0;
    left: 0;
    display: flex;
    padding: 24px;
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--home-border);
    border-bottom: 1px solid var(--home-border);
    background: var(--home-paper);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
      opacity var(--home-transition),
      visibility var(--home-transition),
      transform var(--home-transition);
  }

  .main-nav a {
    padding: 12px 4px;
    font-size: 16px;
  }

  .main-nav.is-open,
  .site-header.is-menu-open .main-nav,
  .menu-toggle[aria-expanded="true"] + .main-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .homepage-carousel {
    height: 720px;
    min-height: 720px;
  }

  .homepage-carousel__slide,
  .homepage-carousel .hero {
    min-height: 720px;
  }

  .homepage-carousel__slide::after {
    background: linear-gradient(
      0deg,
      rgba(248, 244, 238, 0.97) 0%,
      rgba(248, 244, 238, 0.84) 31%,
      rgba(248, 244, 238, 0.1) 66%
    );
  }

  .homepage-carousel .hero__content {
    padding-block: 48px 102px;
    align-items: flex-end;
  }

  .homepage-carousel__copy {
    width: 100%;
    max-width: 650px;
  }

  .homepage-carousel__copy h1 {
    max-width: 560px;
    font-size: clamp(48px, 10vw, 72px);
  }

  .homepage-carousel__copy > p:not(.eyebrow) {
    max-width: 580px;
    margin-top: 22px;
    font-size: 17px;
  }

  .hero__actions {
    margin-top: 26px;
  }

  .homepage-carousel__picture .hero__image,
  .homepage-carousel .hero__image {
    object-position:
      var(--mobile-focal-x, 50%)
      var(--mobile-focal-y, 50%);
  }

  .section {
    padding-block: 82px;
  }

  .split-story {
    padding-bottom: 82px;
    grid-template-columns: 1fr;
  }

  .split-story__media,
  .split-story__media img {
    min-height: 500px;
  }

  .split-story__content {
    padding: 56px 40px;
  }

  .newsletter__inner {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 38px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   16. МОБІЛЬНІ ТЕЛЕФОНИ
   ========================================================================== */

@media (max-width: 640px) {
  .announcement {
    min-height: 34px;
    padding-inline: 14px;
    font-size: 11px;
  }

  .container,
  .homepage-carousel .hero__content,
  .split-story {
    width: min(calc(100% - 28px), var(--home-container));
  }

  .header__actions .language-switcher {
    min-width: 34px;
    padding-inline: 3px;
  }

  .header__actions .account-link {
    display: none;
  }

  .homepage-carousel {
    height: 680px;
    min-height: 680px;
  }

  .homepage-carousel__slide,
  .homepage-carousel .hero {
    min-height: 680px;
  }

  .homepage-carousel .hero__content {
    padding-block: 38px 98px;
  }

  .eyebrow {
    margin-bottom: 16px;
    font-size: 12px;
  }

  .homepage-carousel__copy h1 {
    font-size: clamp(43px, 13vw, 60px);
  }

  .homepage-carousel__copy > p:not(.eyebrow) {
    font-size: 15px;
    line-height: 1.55;
  }

  .button {
    min-height: 52px;
    padding-inline: 22px;
    font-size: 12px;
  }

  .hero__actions {
    gap: 16px;
  }

  .homepage-carousel__controls {
    right: 14px;
    bottom: 18px;
  }

  .homepage-carousel__dots {
    bottom: 35px;
    left: 14px;
  }

  .homepage-carousel__arrow {
    min-width: 42px;
    height: 42px;
  }

  .homepage-carousel__pause {
    min-width: 62px;
    height: 42px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .section {
    padding-block: 52px;
  }

  .section-heading {
    margin-bottom: 28px;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .section-heading h2,
  .split-story__content h2,
  .newsletter h2 {
    font-size: clamp(34px, 10vw, 44px);
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .category-card,
  .category-card img {
    min-height: 250px;
  }

  .category-card span {
    right: 16px;
    bottom: 16px;
    left: 16px;
    font-size: 22px;
  }

  .categories .category-card:nth-child(2) img,
  .categories .category-card:nth-child(3) img,
  .categories .category-card:nth-child(4) img {
    transform: none;
  }

  .categories .category-card:nth-child(2):hover img,
  .categories .category-card:nth-child(3):hover img,
  .categories .category-card:nth-child(4):hover img {
    transform: scale(1.025);
  }

  .split-story {
    padding-bottom: 68px;
  }

  .split-story__media,
  .split-story__media img {
    min-height: 340px;
  }

  .split-story__content {
    padding: 44px 24px;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .trust-item {
    min-height: 105px;
    border-right: 0;
    border-bottom: 1px solid var(--home-border);
  }

  .trust-item:nth-child(3) {
    border-bottom: 1px solid var(--home-border);
  }

  .trust-item:last-child {
    border-bottom: 0;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 12px;
  }

  .product-card > img,
  .product-card > a > img,
  .product-card > picture img {
    aspect-ratio: 0.9;
  }

  .product-card__meta {
    min-height: 70px;
    padding: 12px 2px 18px;
    align-items: start;
    gap: 6px 10px;
  }

  .product-card__meta h3 {
    font-family: Inter, Arial, Helvetica, sans-serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
  }

  .product-card__meta > span,
  .product-card__meta > strong {
    padding-top: 1px;
    font-size: 14px;
    line-height: 1.4;
  }

  .product-card__meta p {
    grid-column: 1 / -1;
    font-size: 13px;
    line-height: 1.4;
  }

  .newsletter {
    padding-block: 64px;
  }

  .newsletter-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .newsletter-form input {
    border-right: 1px solid var(--home-border);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-grid > div:first-child {
    grid-column: auto;
  }

  .footer-bottom {
    margin-top: 48px;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 320px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .product-card__meta {
    min-height: 0;
    padding: 13px 2px 0;
    gap: 6px 12px;
  }

  .category-card,
  .category-card img {
    min-height: 210px;
  }

  .category-card span {
    font-size: 16px;
  }

  .product-card__meta h3 {
    font-size: 18px;
  }

  .product-card__meta > span,
  .product-card__meta > strong {
    font-size: 14px;
  }

  .product-card__meta p {
    font-size: 13px;
  }
}

/* ========================================================================== 
   17. ДОСТУПНІСТЬ: ЗМЕНШЕННЯ АНІМАЦІЙ
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .homepage-carousel__slide {
    transform: none;
  }
}
/* ==========================================================================
   PREMIUM CAROUSEL CONTROLS
   Компактна панель навігації без стандартного вигляду HTML-кнопок.
   ========================================================================== */

.homepage-carousel .homepage-carousel__controls {
  position: absolute;
  z-index: 8;
  right: max(32px, calc((100vw - var(--home-container)) / 2));
  bottom: 32px;

  display: flex;
  align-items: center;
  gap: 2px;

  padding: 6px;

  border: 1px solid rgba(255, 250, 244, 0.32);
  border-radius: 999px;

  background: rgba(42, 28, 24, 0.58);
  box-shadow:
    0 14px 40px rgba(31, 18, 14, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

/* Не показуємо панель, якщо JavaScript встановив hidden. */
.homepage-carousel .homepage-carousel__controls[hidden] {
  display: none;
}

/* Спільний вигляд трьох кнопок. */
.homepage-carousel .homepage-carousel__control {
  appearance: none;
  -webkit-appearance: none;

  position: relative;

  display: grid;
  place-items: center;

  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;

  border: 0;
  border-radius: 50%;

  background: transparent;
  color: rgba(255, 250, 244, 0.96);

  font: inherit;
  line-height: 1;

  cursor: pointer;

  transition:
    color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

/* Прибираємо текстові символи — іконки малюються через CSS. */
.homepage-carousel [data-homepage-carousel-previous],
.homepage-carousel [data-homepage-carousel-next],
.homepage-carousel .homepage-carousel__toggle {
  font-size: 0;
}

/* Стрілки назад і вперед. */
.homepage-carousel [data-homepage-carousel-previous]::before,
.homepage-carousel [data-homepage-carousel-next]::before {
  content: "";

  display: block;

  width: 9px;
  height: 9px;

  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
}

.homepage-carousel [data-homepage-carousel-previous]::before {
  transform: rotate(45deg) translate(2px, 10px);
}

.homepage-carousel [data-homepage-carousel-next]::before {
  transform: rotate(225deg) translate(-10px, -1px);
}

/* Іконка паузи. */
.homepage-carousel .homepage-carousel__toggle::before,
.homepage-carousel .homepage-carousel__toggle::after {
  content: "";

  position: absolute;
  top: 50%;
  left: 50%;

  width: 2px;
  height: 14px;

  border-radius: 999px;
  background: currentColor;
}

.homepage-carousel .homepage-carousel__toggle::before {
  transform: translate(-5px, -50%);
}

.homepage-carousel .homepage-carousel__toggle::after {
  transform: translate(3px, -50%);
}

/*
 * JavaScript змінює aria-label на Play carousel.
 * У цьому стані замість двох рисок показується трикутник Play.
 */
.homepage-carousel
  .homepage-carousel__toggle[aria-label="Play carousel"]::before {
  width: 0;
  height: 0;

  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
  border-radius: 0;

  background: transparent;

  transform: translate(-35%, -50%);
}

.homepage-carousel
  .homepage-carousel__toggle[aria-label="Play carousel"]::after {
  display: none;
}

/* Наведення миші. */
@media (hover: hover) {
  .homepage-carousel .homepage-carousel__control:hover {
    background: rgba(255, 250, 244, 0.16);
    color: #ffffff;
    transform: translateY(-1px);
  }
}

.homepage-carousel .homepage-carousel__control:active {
  background: rgba(255, 250, 244, 0.22);
  transform: translateY(0) scale(0.94);
}

/* Доступна клавіатурна навігація. */
.homepage-carousel .homepage-carousel__control:focus-visible {
  outline: 2px solid rgba(255, 250, 244, 0.96);
  outline-offset: 3px;
}

.homepage-carousel .homepage-carousel__control:disabled {
  opacity: 0.38;
  cursor: default;
}

/* Мобільна версія. */
@media (max-width: 700px) {
  .homepage-carousel .homepage-carousel__controls {
    right: 14px;
    bottom: 16px;
    gap: 1px;
    padding: 4px;
  }

  .homepage-carousel .homepage-carousel__control {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }
}

/* Вимкнення анімацій відповідно до системних налаштувань. */
@media (prefers-reduced-motion: reduce) {
  .homepage-carousel .homepage-carousel__control {
    transition: none;
  }
}
