/* ============================================================
   ГОЛОВНА СТОРІНКА — Select Seeds–подібна структура
   ============================================================ */

/* --- Hero-слайдер (boxed + плашка) --- */
.hero {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: clamp(12px, 2.2vw, 20px) var(--gap-page) 0;
}
.hero__frame {
  position: relative;
  height: clamp(360px, 58dvh, 520px);
  overflow: hidden;
  border-radius: clamp(16px, 2.4vw, 28px);
  background: var(--c-oat);
  isolation: isolate;
  transform: translateZ(0);
}
.hero__slide {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero__slide.is-active { pointer-events: auto; z-index: 1; }
.hero__media {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.hero__slide.is-active .hero__media { opacity: 1; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.hero__plaque {
  position: absolute;
  z-index: 2;
  left: clamp(12px, 2vw, 22px);
  top: clamp(12px, 2vw, 22px);
  bottom: clamp(12px, 2vw, 22px);
  width: min(42%, 440px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(18px, 2.8vw, 36px);
  border-radius: clamp(12px, 1.8vw, 20px);
  background: color-mix(in srgb, var(--c-surface) 68%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--c-ink) 8%, transparent);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity var(--t-slow) var(--ease),
    transform var(--t-slow) var(--ease),
    visibility 0s linear var(--t-slow);
}
.hero__slide.is-active .hero__plaque {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  transition:
    opacity var(--t-slow) var(--ease),
    transform var(--t-slow) var(--ease),
    visibility 0s linear 0s;
}
.hero__title {
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.12;
  text-wrap: balance;
  color: var(--c-ink);
}
.hero__lead {
  margin-top: 12px;
  max-width: 36ch;
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.55;
  color: var(--c-body);
}
.hero__cta {
  margin-top: clamp(16px, 2.6vw, 28px);
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  pointer-events: auto;
}
.hero__cta > .btn {
  flex: 0 1 auto;
  min-width: max-content;
  max-width: 100%;
  white-space: nowrap;
  box-sizing: border-box;
}
.hero__dots {
  position: absolute; left: 0; right: 0; bottom: clamp(12px, 2.4vw, 22px); z-index: 3;
  display: flex; justify-content: center; align-items: center; gap: 10px;
}
.hero__dot {
  width: 28px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c-surface) 42%, transparent);
  box-shadow: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: width var(--t-med) var(--ease), background-color var(--t-med) ease, opacity var(--t-med) ease;
}
.hero__dot:focus,
.hero__dot:focus-visible {
  outline: none;
  box-shadow: none;
}
.hero__dot.is-active {
  width: 48px;
  height: 5px;
  background: color-mix(in srgb, var(--c-surface) 88%, transparent);
  box-shadow: none;
}

@media (max-width: 599px) {
  .hero__dot { width: 22px; height: 3px; }
  .hero__dot.is-active { width: 40px; height: 4px; }
}

@media (max-width: 899px) {
  .hero__frame { height: clamp(420px, 68dvh, 560px); }
  .hero__plaque {
    left: clamp(10px, 3vw, 16px);
    right: clamp(10px, 3vw, 16px);
    top: auto;
    bottom: clamp(40px, 8vw, 56px);
    width: auto;
    max-height: min(58%, 320px);
    padding: clamp(14px, 3.5vw, 20px);
    justify-content: flex-end;
  }
  .hero__title { font-size: clamp(22px, 5.6vw, 30px); }
  .hero__lead {
    max-width: none;
    margin-top: 8px;
    font-size: clamp(13px, 3.4vw, 15px);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero__cta { margin-top: 14px; gap: 12px; }
}

@media (max-width: 479px) {
  .hero { padding-top: 10px; }
  .hero__frame { height: clamp(400px, 72svh, 520px); border-radius: 16px; }
  .hero__plaque { border-radius: 14px; }
  .hero__cta { gap: 12px; }
}

/* --- Trust row (під банером, пагінець на hover) --- */
.section--trust {
  padding-block: 0;
  padding-top: clamp(12px, 2vw, 18px);
  background: transparent;
}
.trust-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
  padding: clamp(16px, 2.4vw, 22px) clamp(14px, 2vw, 20px);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.trust-item__sprout {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.trust-item__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, #1C3F1A 28%, transparent);
  background: transparent;
  transition:
    background-color var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease);
}
.trust-item__flower {
  position: relative;
  z-index: 1;
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
  border-radius: 0;
  background: transparent;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  transform: scale(.86);
  opacity: 0;
  transition:
    transform var(--t-med) var(--ease),
    opacity var(--t-med) var(--ease);
}
.trust-item__copy {
  display: block;
  min-width: 0;
}
.trust-item__title {
  display: block;
  font-family: var(--f-accent);
  font-weight: 600;
  font-size: clamp(14px, 1.5vw, 17px);
  color: #1C3F1A;
  line-height: 1.25;
}
.trust-item__text {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: color-mix(in srgb, var(--c-body) 80%, transparent);
  line-height: 1.35;
}

@media (hover: hover) and (pointer: fine) {
  .trust-item:hover .trust-item__ring,
  .trust-item:focus-within .trust-item__ring {
    border-color: color-mix(in srgb, #1C3F1A 42%, transparent);
  }
  .trust-item:hover .trust-item__flower,
  .trust-item:focus-within .trust-item__flower {
    transform: scale(1);
    opacity: 1;
  }
}

@media (hover: none) {
  .trust-item__flower {
    transform: scale(1);
    opacity: 1;
  }
}

@media (min-width: 900px) {
  .trust-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 20px;
    padding: clamp(18px, 2.2vw, 26px) clamp(18px, 2.4vw, 28px);
  }
}

@media (max-width: 599px) {
  .trust-bar {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .trust-item__sprout {
    width: 28px;
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trust-item__ring,
  .trust-item__flower {
    transition: none;
  }
}

/* --- Категорії --- */
.cat-tile {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  text-align: center;
}
.cat-tile__media {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--c-oat);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.2vw, 18px);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.cat-tile__media img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform var(--t-med) var(--ease);
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}
.cat-tile:hover .cat-tile__media { box-shadow: var(--shadow-card); }
.cat-tile:hover .cat-tile__media img { transform: scale(1.05); }
.cat-tile--rozsada .cat-tile__media {
  padding: clamp(2px, 0.8vw, 6px);
}
.cat-tile--rozsada .cat-tile__media img {
  transform: scale(1.12);
}
.cat-tile--rozsada:hover .cat-tile__media img {
  transform: scale(1.17);
}
.cat-tile__name {
  font-family: var(--f-accent);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--c-ink);
  line-height: 1.25;
  padding-inline: 4px;
}
@media (max-width: 899px) {
  .cat-tile__name { font-size: 13px; }
}
@media (max-width: 599px) {
  .cat-tile { gap: 8px; }
  .cat-tile__media { padding: 8px; }
  .cat-tile--rozsada .cat-tile__media { padding: 2px; }
  .cat-tile__name { font-size: 12.5px; }
}

/* --- Горизонтальна галерея товарів --- */
.product-rail {
  position: relative;
}
.product-rail__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding-bottom: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.product-rail__track::-webkit-scrollbar { display: none; }
.product-rail__item {
  flex: 0 0 calc((100% - 14px) / 1.65);
  width: calc((100% - 14px) / 1.65);
  scroll-snap-align: start;
  min-width: 0;
}
.product-rail__item .product-card { height: 100%; }

.product-rail__nav {
  position: absolute;
  top: 42%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-ink);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, opacity var(--t-fast) ease, border-color var(--t-fast) ease;
}
.product-rail__nav--prev { left: 6px; }
.product-rail__nav--next { right: 6px; }
.product-rail__nav:hover:not(:disabled) {
  background: var(--c-sage);
  border-color: var(--c-sage);
  color: #ffffff;
}
.product-rail__nav:disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 599px) {
  .product-rail__item { flex-basis: calc((100% - 14px) / 1.55); width: calc((100% - 14px) / 1.55); }
}

@media (min-width: 600px) and (max-width: 899px) {
  .product-rail__item { flex-basis: calc((100% - 28px) / 2.4); width: calc((100% - 28px) / 2.4); }
}

@media (min-width: 900px) {
  .product-rail__track { overflow-x: auto; }
  .product-rail__item {
    flex-basis: calc((100% - 42px) / 4);
    width: calc((100% - 42px) / 4);
  }
  .product-rail__nav--prev { left: 0; }
  .product-rail__nav--next { right: 0; }
}

@supports (-webkit-touch-callout: none) {
  .product-rail__track {
    scroll-snap-type: x proximity;
  }
  .product-rail__nav {
    -webkit-tap-highlight-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-rail__track { scroll-behavior: auto; }
}

/* Стилі .product-card — у product-card.css (підключено в base.html) */

/* --- Educational cards --- */
.edu-grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
  grid-template-columns: 1fr;
}
.edu-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--c-border);
  transition: box-shadow var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.edu-card:hover { text-decoration: none; box-shadow: var(--shadow-card); transform: translateY(-3px); }
.edu-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--c-oat);
}
.edu-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}
.edu-card:hover .edu-card__media img { transform: scale(1.04); }
.edu-card__body {
  padding: clamp(16px, 2.5vw, 22px);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  flex: 1;
}
.edu-card__title { font-family: var(--f-accent); font-size: 20px; }
.edu-card__text { font-size: 14px; color: var(--c-body); line-height: 1.55; flex: 1; }

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

/* --- Brand story: 3 cards --- */
.section--storyband {
  background: var(--c-bg);
}
.story-band {
  display: grid;
  gap: clamp(22px, 3.5vw, 28px);
  grid-template-columns: 1fr;
  align-items: stretch;
}
.story-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.story-card__media {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--c-oat);
  aspect-ratio: 4 / 3;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.story-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}
.story-card:hover .story-card__media img {
  transform: scale(1.03);
}
.story-card__title {
  margin: 4px 0 0;
  font-family: var(--f-accent);
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 500;
  color: var(--c-ink);
  line-height: 1.25;
}
.story-card__text {
  margin: 0;
  font-size: clamp(14px, 1.5vw, 15px);
  line-height: 1.6;
  color: var(--c-body);
  flex: 1;
}
.story-card__cta {
  margin-top: 4px;
  width: auto;
  min-width: min(100%, 168px);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 700px) {
  .story-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 2.4vw, 28px);
  }
  .story-card__media {
    aspect-ratio: 5 / 4;
  }
}

@media (max-width: 699px) {
  .story-card__cta {
    width: 100%;
    min-width: 0;
  }
}

@supports (-webkit-touch-callout: none) {
  .story-card__media {
    -webkit-transform: translateZ(0);
  }
}

/* --- iOS Safari / touch --- */
.hscroll {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}
@supports (-webkit-touch-callout: none) {
  .hero__frame { height: clamp(400px, 62svh, 520px); }
  .hero__plaque {
    background: color-mix(in srgb, var(--c-surface) 78%, transparent);
  }
  .cat-tile__media, .edu-card__media, .story-card__media {
    transform: translateZ(0);
  }
  @media (max-width: 899px) {
    .hero__frame { height: clamp(420px, 70svh, 560px); }
  }
}

@media (max-width: 767px) {
  .hero__plaque {
    transform: translate3d(0, 6px, 0);
    transition-duration: .38s;
  }
  .hero__slide.is-active .hero__plaque {
    transform: translate3d(0, 0, 0);
    transition-duration: .38s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cat-tile__media img,
  .edu-card__media img,
  .story-card__media img { transition: none; }
  .cat-tile:hover .cat-tile__media img,
  .edu-card:hover .edu-card__media img,
  .story-card:hover .story-card__media img { transform: none; }
  .hero__plaque,
  .hero__slide.is-active .hero__plaque {
    transform: none;
    transition: opacity .01ms linear, visibility 0s;
  }
}
