/* ==========================================================================
   Unicase — Головна сторінка
   Верстка за макетом Figma "Main - 1920 (1440)" (node 1:4306)
   Токени взяті з Figma-змінних файлу.
   Шапку/футер цей файл не чіпає.
   ========================================================================== */

/* Шрифти макета — Manrope (заголовки) і Noto Sans (текст).
   Файлів у /css/fonts/ поки немає, тому @font-face навмисно не оголошено:
   працює фолбек на Inter / системний шрифт без зайвих 404.
   Щоб отримати вигляд 1-в-1 з макетом — покладіть Manrope-Bold.woff2,
   Manrope-Light.woff2, NotoSans-Regular.woff2 у frontend/web/css/fonts/
   і розкоментуйте @font-face нижче.

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 300; font-display: swap; src: url('/css/fonts/Manrope-Light.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap; src: url('/css/fonts/Manrope-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Noto Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/css/fonts/NotoSans-Regular.woff2') format('woff2'); }
*/

:root {
  /* Кольори з макета */
  --hp-white: #ffffff;
  --hp-black: #111112;
  --hp-accent: #8074c5;
  /* Затемнений акцент для тексту. Білий на #8074c5 дає лише 4.02:1 —
     нижче порогу WCAG AA (4.5:1). На #6c60b0 виходить 5.33:1 на білому
     і 4.77:1 на світло-сірому тлі блоків. */
  --hp-accent-text: #6c60b0;
  --hp-dark-1: #5a656e;
  --hp-dark-2: #898e92;
  --hp-bluegrey-2: #d4dfe1;
  --hp-bluegrey-4: #d7eaee;
  --hp-bluegrey-5: #e6f1f3;
  --hp-bluegrey-6: #eef3f5;
  --hp-brown-4: #c2bbb1;
  --hp-brown-7: #efeeea;

  /* Радіуси з макета */
  --hp-radius-block: 48px;
  --hp-radius-card: 36px;
  --hp-radius-img: 24px;

  /* Відступи з макета */
  --hp-gap: 12px;
  --hp-gap-lg: 24px;
  --hp-pad-page: 12px;
  --hp-pad-block: 24px;

  /* Шрифти макета */
  --hp-font-text: 'Noto Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --hp-font-display: 'Manrope', 'Noto Sans', 'Inter', sans-serif;
}

/* --------------------------------------------------------------------------
   Каркас блоку
   -------------------------------------------------------------------------- */

.hp {
  max-width: 1440px;
  margin: 0 auto;
  font-family: var(--hp-font-text);
  color: var(--hp-black);
}

.hp-block {
  padding: var(--hp-pad-page);
  background: var(--hp-white);
}

.hp-block__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hp-gap-lg);
  padding: var(--hp-pad-block);
  background: var(--hp-bluegrey-6);
  border-radius: var(--hp-radius-block);
}

.hp-block--plain {
  background: var(--hp-white);
}

/* --------------------------------------------------------------------------
   Заголовок секції: іконка зліва, тайтл по центру, кнопка справа
   -------------------------------------------------------------------------- */

.hp-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 96px;
  padding: 24px 0;
}

.hp-head__title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.hp-head__title {
  margin: 0;
  font-family: var(--hp-font-display);
  font-size: 48px;
  font-weight: 700;
  line-height: 60px;
  color: var(--hp-black);
}

.hp-head__subtitle {
  margin: 0;
  font-family: var(--hp-font-display);
  font-size: 24px;
  font-weight: 300;
  line-height: 30px;
  color: var(--hp-black);
}

.hp-head__icon {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
}

.hp-head__icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.hp-head__link {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 12px 0 24px;
  font-size: 14px;
  line-height: 18px;
  color: var(--hp-black);
  text-decoration: none;
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
  transition: background 0.2s ease, color 0.2s ease;
}

.hp-head__link:hover {
  background: var(--hp-accent-text);
  color: var(--hp-white);
}

.hp-head__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Блок 1 — головний екран (банери)
   -------------------------------------------------------------------------- */

.hp-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 420px;
  gap: var(--hp-gap);
  width: 100%;
  min-height: 576px;
}

.hp-hero__banner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: var(--hp-pad-block);
  overflow: hidden;
  text-decoration: none;
  border-radius: var(--hp-radius-card);
}

.hp-hero__banner--mint { background: var(--hp-bluegrey-4); }
.hp-hero__banner--gray { background: var(--hp-brown-7); }

/* Фото товару — окремий білий кадр фіксованої висоти,
   щоб вирізки на білому тлі не «пливли» і не лізли під текст */
.hp-hero__media {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin-top: 28px;
  overflow: hidden;
  background: var(--hp-white);
  border-radius: var(--hp-radius-img);
}

.hp-hero__media-img {
  width: 100%;
  height: 100%;
  padding: 16px;
  object-fit: contain;
}

.hp-hero__banner-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hp-hero__price {
  align-self: flex-start;
  padding: 8px 18px;
  margin-bottom: 8px;
  font-family: var(--hp-font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--hp-white);
  background: var(--hp-accent-text);
  border-radius: var(--hp-radius-card);
}

/* Назви товарів довгі — жорстко обмежуємо двома рядками */
.hp-hero__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-family: var(--hp-font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 26px;
  color: var(--hp-black);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hp-hero__subtitle {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 18px;
  color: var(--hp-dark-1);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* H1 у потоці — важливий для SEO, візуально компактний */
.hp-hero__h1 {
  width: 100%;
  margin: 0;
  font-family: var(--hp-font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--hp-black);
}

.hp-hero__h1-sub {
  width: 100%;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 18px;
  color: var(--hp-dark-1);
}

.hp-hero__chevrons {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  display: flex;
  gap: 2px;
  color: var(--hp-accent);
  opacity: 0.7;
}

.hp-hero__chevrons svg {
  width: 18px;
  height: 18px;
}

.hp-hero__side {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: var(--hp-gap);
  min-height: 0;
}

/* Картка-категорія 420×184 */
.hp-cat-card {
  display: flex;
  gap: var(--hp-gap);
  min-height: 0;
  padding: var(--hp-gap);
  overflow: hidden;
  text-decoration: none;
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
}

.hp-cat-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: var(--hp-gap);
}

.hp-cat-card__body > span:not(.hp-arrow) { display: block; min-width: 0; }

.hp-cat-card__title {
  display: block;
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  color: var(--hp-black);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-cat-card__desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 18px;
  color: var(--hp-dark-1);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hp-cat-card__img {
  display: flex;
  flex: 0 0 120px;
  align-items: center;
  justify-content: center;
  width: 120px;
  overflow: hidden;
  background: var(--hp-bluegrey-6);
  border-radius: var(--hp-radius-img);
}

.hp-cat-card__img img {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
}

.hp-cat-card--img-left .hp-cat-card__img { order: -1; }

/* Кругла кнопка-стрілка */
.hp-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--hp-black);
  background: var(--hp-bluegrey-5);
  border: none;
  border-radius: var(--hp-radius-card);
  transition: background 0.2s ease, color 0.2s ease;
}

.hp-arrow svg {
  width: 18px;
  height: 18px;
}

.hp-arrow:hover {
  color: var(--hp-white);
  background: var(--hp-accent-text);
}

/* --------------------------------------------------------------------------
   Блок 2 — швидкі категорії
   -------------------------------------------------------------------------- */

.hp-block--quick .hp-block__content {
  padding: var(--hp-pad-block);
  overflow: hidden;
}

.hp-quick {
  display: flex;
  gap: 18px;
  width: 100%;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.hp-quick::-webkit-scrollbar { display: none; }

.hp-quick__item {
  display: inline-flex;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 14px;
  line-height: 18px;
  color: var(--hp-black);
  text-decoration: none;
  white-space: nowrap;
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
  transition: background 0.2s ease, color 0.2s ease;
}

.hp-quick__item:hover {
  color: var(--hp-white);
  background: var(--hp-accent-text);
}

.hp-quick__item img,
.hp-quick__item iconify-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
}

.hp-quick__item:hover img { filter: brightness(0) invert(1); }

/* --------------------------------------------------------------------------
   Слайдер сторінками (3 колонки × N рядів)
   -------------------------------------------------------------------------- */

.hp-slider {
  display: flex;
  flex-direction: column;
  gap: var(--hp-gap-lg);
  width: 100%;
}

.hp-slider__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hp-slider__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--hp-black);
  cursor: pointer;
  background: var(--hp-white);
  border: none;
  border-radius: var(--hp-radius-card);
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.hp-slider__arrow svg {
  width: 18px;
  height: 18px;
}

.hp-slider__arrow:hover:not(:disabled) {
  color: var(--hp-white);
  background: var(--hp-accent-text);
}

.hp-slider__arrow:disabled {
  cursor: default;
  opacity: 0.4;
}

.hp-slider__dots {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
}

/* Крапка виглядає як 6×6 (як у макеті), але клікабельна зона — 24×36.
   Сама крапка малюється фоном через padding + background-clip. */
.hp-slider__dot {
  box-sizing: border-box;
  width: 24px;
  height: 36px;
  padding: 15px 9px;
  cursor: pointer;
  background: var(--hp-dark-2);
  background-clip: content-box;
  border: none;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.hp-slider__dot.is-active { background-color: var(--hp-accent-text); }

.hp-slider__viewport {
  width: 100%;
  overflow: hidden;
}

.hp-slider__track {
  display: flex;
  transition: transform 0.4s ease;
}

.hp-slider__page {
  display: grid;
  flex: 0 0 100%;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--hp-gap);
  align-content: start;
}

/* --------------------------------------------------------------------------
   Картка товару (Card-small-top)
   -------------------------------------------------------------------------- */

.hp-card {
  position: relative;
  display: flex;
  gap: var(--hp-gap);
  min-height: 204px;
  padding: var(--hp-gap);
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
}

.hp-card__body {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--hp-gap);
  min-width: 0;
  padding: var(--hp-gap);
}

.hp-card__text {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--hp-gap);
  min-height: 0;
}

.hp-card__name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 16px;
  line-height: 24px;
  color: var(--hp-black);
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hp-card__name:hover { color: var(--hp-accent-text); }

.hp-card__rating {
  display: flex;
  gap: 2px;
}

.hp-card__rating svg {
  width: 12px;
  height: 12px;
}

.hp-card__rating .is-filled { color: #f5b544; fill: #f5b544; }
.hp-card__rating .is-empty { color: var(--hp-bluegrey-2); fill: var(--hp-bluegrey-2); }

.hp-card__price-row {
  display: flex;
  gap: var(--hp-gap);
  align-items: center;
  justify-content: space-between;
}

.hp-card__prices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-width: 0;
}

.hp-card__old-price {
  font-size: 12px;
  line-height: 12px;
  color: var(--hp-dark-1);
  text-decoration: line-through;
}

.hp-card__price {
  font-family: var(--hp-font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 24px;
  color: var(--hp-black);
  white-space: nowrap;
}

.hp-card__cart {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--hp-white);
  cursor: pointer;
  background: var(--hp-accent);
  border: none;
  border-radius: var(--hp-radius-card);
  transition: opacity 0.2s ease;
}

.hp-card__cart svg { width: 18px; height: 18px; }
.hp-card__cart:hover { opacity: 0.85; }
.hp-card__cart.is-loading { opacity: 0.5; pointer-events: none; }

.hp-card__media {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: flex-end;
  width: 132px;
  padding: var(--hp-gap);
  overflow: hidden;
  background: var(--hp-bluegrey-6);
  border-radius: var(--hp-radius-img);
}

.hp-card__media > a {
  position: absolute;
  inset: 0;
  display: block;
}

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

.hp-card__fav {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--hp-black);
  cursor: pointer;
  background: var(--hp-white);
  border: none;
  border-radius: var(--hp-radius-card);
}

.hp-card__fav svg { width: 18px; height: 18px; }
.hp-card__fav.is-active { color: var(--hp-accent); }
.hp-card__fav.is-active svg { fill: currentColor; }

/* Варіант картки з фото ліворуч (як у макеті чергуються) */
.hp-card--media-left .hp-card__media { order: -1; }

/* --------------------------------------------------------------------------
   Блок 4 — партнери/бренди
   -------------------------------------------------------------------------- */

.hp-brands {
  display: flex;
  gap: 18px;
  align-items: stretch;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.hp-brands::-webkit-scrollbar { display: none; }

.hp-brands__item {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  height: 120px;
  padding: 12px;
  text-decoration: none;
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
  transition: transform 0.2s ease;
}

.hp-brands__item:hover { transform: translateY(-2px); }

.hp-brands__item img {
  max-width: 96px;
  max-height: 44px;
  object-fit: contain;
}

.hp-brands__item span {
  font-size: 12px;
  line-height: 18px;
  color: var(--hp-dark-1);
}

.hp-brands__more {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 123px;
  height: 120px;
  color: var(--hp-black);
  text-decoration: none;
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
  transition: background 0.2s ease, color 0.2s ease;
}

.hp-brands__more:hover {
  color: var(--hp-white);
  background: var(--hp-accent-text);
}

.hp-brands__more svg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   Блок 5 — декоративна ілюстрація «Новинки»
   -------------------------------------------------------------------------- */

.hp-block--new .hp-block__content { position: relative; }

.hp-illustration {
  position: absolute;
  top: -36px;
  left: 60px;
  z-index: 1;
  width: 384px;
  height: 360px;
  pointer-events: none;
  object-fit: contain;
}

.hp-block--new .hp-head,
.hp-block--new .hp-slider { position: relative; z-index: 2; }

/* --------------------------------------------------------------------------
   Блок 9 — SEO-текст
   -------------------------------------------------------------------------- */

.hp-block--seo .hp-block__content {
  align-items: flex-start;
  padding: 48px;
}

.hp-seo {
  max-height: 180px;
  padding-right: 24px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.hp-seo::-webkit-scrollbar { width: 3px; }
.hp-seo::-webkit-scrollbar-track { background: transparent; }
.hp-seo::-webkit-scrollbar-thumb { background: var(--hp-bluegrey-2); border-radius: 3px; }

.hp-seo h2,
.hp-seo h3 {
  margin: 0 0 12px;
  font-family: var(--hp-font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 30px;
  color: var(--hp-black);
}

.hp-seo h3 { margin-top: 24px; }

.hp-seo p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 18px;
  color: var(--hp-dark-1);
}

/* Посилання в тексті: підкреслення обов'язкове — інакше вони відрізняються
   лише кольором (WCAG 1.4.1). Колір затемнений до контрасту 4.77:1. */
.hp-seo a {
  color: var(--hp-accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hp-seo a:hover { text-decoration-thickness: 2px; }

/* --------------------------------------------------------------------------
   FAQ (поза макетом, лишений заради SEO-розмітки)
   -------------------------------------------------------------------------- */

.hp-faq__list {
  display: flex;
  flex-direction: column;
  gap: var(--hp-gap);
  width: 100%;
}

.hp-faq__item {
  padding: 18px 24px;
  background: var(--hp-white);
  border-radius: var(--hp-radius-card);
}

.hp-faq__item summary {
  font-size: 16px;
  line-height: 24px;
  color: var(--hp-black);
  cursor: pointer;
  list-style: none;
}

.hp-faq__item summary::-webkit-details-marker { display: none; }

.hp-faq__item[open] summary { color: var(--hp-accent-text); }

.hp-faq__item p {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--hp-dark-1);
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
  .hp-hero__grid {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
  }

  .hp-hero__side {
    grid-column: 1 / -1;
    grid-template-rows: none;
    grid-template-columns: repeat(3, 1fr);
  }

  .hp-cat-card { min-height: 148px; }
  .hp-head__title { font-size: 40px; line-height: 48px; }
}

@media (max-width: 1024px) {
  .hp-slider__page { grid-template-columns: repeat(2, 1fr); }
  .hp-illustration { display: none; }
}

@media (max-width: 768px) {
  :root {
    --hp-radius-block: 32px;
    --hp-radius-card: 24px;
    --hp-pad-block: 16px;
  }

  .hp-block__content { gap: 16px; }

  .hp-hero__grid {
    grid-template-columns: 1fr;
    gap: var(--hp-gap);
  }

  .hp-hero__banner { min-height: 340px; }

  .hp-hero__side {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .hp-hero__title { font-size: 18px; line-height: 24px; }
  .hp-hero__media { margin-top: 24px; }
  .hp-cat-card { min-height: 132px; }
  .hp-cat-card__img { flex-basis: 96px; width: 96px; }

  .hp-head {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 8px 0 0;
  }

  .hp-head__title { font-size: 28px; line-height: 34px; }
  .hp-head__subtitle { font-size: 16px; line-height: 22px; }

  .hp-head__icon { display: none; }

  .hp-head__link {
    position: static;
    align-self: center;
    height: 40px;
    margin-top: 12px;
  }

  .hp-slider__page { grid-template-columns: 1fr; }

  .hp-card { min-height: 0; }
  .hp-card__media { width: 108px; }
  .hp-card__price { font-size: 20px; }

  .hp-block--seo .hp-block__content { padding: 24px; }
  .hp-seo { max-height: 260px; padding-right: 12px; }
}
