/*
 * home.css — стилі головної сторінки
 * BEM + CSS custom properties; без !important
 */

/* --- Hero --- */
.home-hero {
  background: linear-gradient(135deg, var(--c-bg-alt) 0%, var(--c-surface) 100%);
}

.home-hero__inner {
  text-align: center;
  max-width: 700px;
  margin-inline: auto;
}

.home-hero__title {
  margin-bottom: var(--sp-4);
}

.home-hero__subtitle {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-6);
}

.home-hero__actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Section grid (Що вас цікавить?) --- */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  max-width: 420px;
  margin-inline: auto;
}

/* Остання непарна картка — широка акцентна, без «мертвої» зони */
.sections-grid .section-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: var(--sp-3);
  min-height: 72px;
  background: linear-gradient(135deg, var(--c-accent-bg) 0%, var(--c-surface) 100%);
  border-color: var(--c-accent-light);
}

.section-card__icon {
  font-size: 36px;
  color: var(--c-accent);
  flex-shrink: 0;
}

.section-card__label {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: inherit;
}

/* --- Section heading row (заголовок + посилання) --- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.section-heading--center {
  text-align: center;
  margin-bottom: var(--sp-5);
}

/* --- Background variant --- */
.bg-alt {
  background: var(--c-bg-alt);
}

/* --- USP grid --- */
.usp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  justify-content: center;
  gap: var(--sp-5);
}

.usp-item {
  text-align: center;
}

.usp-item__icon {
  font-size: 40px;
  color: var(--c-accent);
  display: block;
  margin-bottom: var(--sp-3);
}

.usp-item__title {
  margin-bottom: var(--sp-2);
}

/* --- Mobile --- */
@media (max-width: 639px) {
  .home-hero {
    padding-block: var(--sp-6);
  }

  .home-hero__subtitle {
    font-size: var(--fs-md);
    margin-bottom: var(--sp-5);
  }

  .home-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: var(--sp-4);
  }

  .section-header .btn-ghost {
    padding-inline: 0;
    min-height: 36px;
  }

  /* Горизонтальна стрічка товарів замість стиснутої 2-колонкової сітки */
  .product-grid--scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--sp-3);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--sp-2);
    margin-inline: calc(-1 * var(--container-pad));
    padding-inline: var(--container-pad);
    scrollbar-width: none;
  }

  .product-grid--scroll::-webkit-scrollbar {
    display: none;
  }

  .product-grid--scroll .product-card {
    flex: 0 0 clamp(168px, 44vw, 220px);
    scroll-snap-align: start;
  }
}

@media (min-width: 640px) {
  .sections-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    max-width: none;
    gap: var(--sp-4);
  }

  .sections-grid .section-card:last-child:nth-child(odd) {
    grid-column: auto;
    flex-direction: column;
    min-height: 104px;
    background: var(--c-surface);
    border-color: var(--c-border);
  }
}
