/* KHARTEC — стилі сайту. Mobile-first, без зовнішніх залежностей (крім Google Fonts). */

:root {
  --navy: #151528;    /* основной фон, цвет логотипа */
  --navy-2: #1D1D38;  /* карточки, второй уровень фона */
  --navy-3: #26264A;  /* обводки, hover */
  --yellow: #FCC107;  /* главный акцент */
  --red: #E42320;     /* редкий акцент */
  --blue: #2166AF;    /* редкий акцент */
  --gold: #D9A61A;    /* фон контактного блока */
  --white: #FFFFFF;
  --muted: #B8B8C8;   /* второстепенный текст */

  --line: #33335E;    /* светлее navy-3: hover-обводка карточек */
  --arrow-1: #E5322D; /* стрелки размеров A–D: читаются и на белой ткани, и на тёмном фоне */
  --arrow-2: #4383EC;
  --arrow-3: #22A45D;
  --arrow-4: #FCC107;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --container: 1200px;
  --gutter: 16px;
  --header-h: 64px;
  --section-y: 36px; /* вертикальный отступ секций (сверху и снизу) */
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 600px) {
  :root { --gutter: 24px; --section-y: 44px; }
}
@media (min-width: 900px) {
  :root { --header-h: 72px; --section-y: 56px; --gutter: 32px; }
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable; /* при открытии лайтбокса (overflow: hidden) страница не сдвигается вбок */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--navy);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--white);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: currentColor;
}
.icon.icon--stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Якоря останавливаются под фиксированной шапкой */
section[id] { scroll-margin-top: var(--header-h); }

.section { padding-block: var(--section-y); }

.section__head {
  max-width: 820px;
  margin-bottom: 32px;
}
@media (min-width: 900px) {
  .section__head { margin-bottom: 48px; }
}

.h2 {
  font-size: clamp(26px, 2.2vw + 18px, 40px);
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--yellow);
  text-wrap: balance;
}

.section__sub {
  margin-top: 14px;
  font-size: 17px;
  color: var(--muted);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--yellow);
  color: var(--navy);
}
.btn--primary:hover {
  background: var(--red);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, .28);
}
.btn--outline:hover,
.btn--outline[aria-expanded="true"] {
  border-color: var(--yellow);
  color: var(--yellow);
}

.btn--lg {
  min-height: 56px;
  padding: 16px 40px;
  font-size: 18px;
}

.btn--sm {
  min-height: 40px;
  padding: 8px 18px;
  font-size: 15px;
}

/* ---------- Шапка ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(21, 21, 40, .8);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}

.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
}
.header__logo img {
  width: auto;
  height: 40px;
}
/* < 600px — только щит, от 600px — щит с надписью */
.header__logo.has-shield .header__logo-full { display: none; }
@media (min-width: 600px) {
  .header__logo.has-shield .header__logo-full { display: block; }
  .header__logo.has-shield .header__logo-shield { display: none; }
}

.nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  padding: 8px var(--gutter) 24px;
  background: var(--navy);
  border-bottom: 1px solid var(--navy-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .25s, transform .25s var(--ease), visibility 0s linear .25s;
}
.nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .25s, transform .25s var(--ease), visibility 0s;
}

.nav__link {
  display: block;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
}
.nav__link:hover { color: var(--yellow); }

.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.burger__line,
.burger__line::before,
.burger__line::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s var(--ease), background-color .2s;
}
.burger__line { position: relative; }
.burger__line::before,
.burger__line::after {
  content: "";
  position: absolute;
  left: 0;
}
.burger__line::before { top: -7px; }
.burger__line::after { top: 7px; }
.burger[aria-expanded="true"] .burger__line { background: transparent; }
.burger[aria-expanded="true"] .burger__line::before { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__line::after { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 900px) {
  .header__logo img { height: 44px; }
  .nav {
    position: static;
    padding: 0;
    margin-right: 16px;
    background: none;
    border: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .nav__list {
    display: flex;
    gap: 32px;
  }
  .nav__link {
    padding: 8px 0;
    font-size: 15px;
  }
  .burger { display: none; }
}

/* ---------- Hero ---------- */
/* Высота — от контента (без привязки к высоте экрана): отступы как у секций + место под фиксированную шапку */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--header-h) + var(--section-y));
  padding-bottom: var(--section-y);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 45% at 50% 12%, rgba(38, 38, 74, .9), transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  gap: 20px;
  align-items: center;
}

.hero__visual {
  order: -1;
  justify-self: start;
  width: 132px;
  transform: translateX(-20%); /* у PNG логотипа поля ~20% — выравниваем надпись по тексту */
}
.hero__visual img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.hero__title {
  font-size: clamp(44px, 2.5vw + 34px, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.hero__subtitle {
  max-width: 580px;
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

/* Подпись + мессенджеры и телефон — одна группа сразу под подзаголовком */
.hero__reach { margin-top: 28px; }

.hero__note {
  font-size: 14px;
  color: var(--muted);
}

.hero__contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
}
.hero__note + .hero__contacts { margin-top: 14px; }

.hero__messengers {
  display: flex;
  gap: 10px;
}

.round-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand, var(--navy-3));
  color: var(--white);
  font-size: 24px;
  text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s;
}
a.round-icon:hover { transform: translateY(-2px); }

.hero__phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: color .2s;
}
.hero__phone .round-icon {
  background: var(--navy-3);
  color: var(--yellow);
  font-size: 20px;
}
.hero__phone:hover { color: var(--yellow); }

@media (min-width: 600px) {
  .hero__subtitle { font-size: 19px; }
  .hero__visual { width: 160px; }
}

@media (min-width: 900px) {
  .hero::before {
    background: radial-gradient(45% 60% at 78% 50%, rgba(38, 38, 74, .95), transparent 70%);
  }
  .hero__inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: 48px;
  }
  .hero__visual {
    order: 0;
    justify-self: end;
    width: min(100%, 470px);
    margin: 0 -24px 0 0;
    transform: none;
  }
}

/* ---------- Про нас ---------- */
.about {
  display: grid;
  gap: 32px;
}

.about__text {
  font-size: 17px;
  line-height: 1.7;
}

.about__for {
  padding: 28px 24px;
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: var(--radius);
}

.about__for-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.for-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.for-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.55;
}
.for-list .icon {
  margin-top: 3px;
  font-size: 20px;
  color: var(--yellow);
}
.for-list strong {
  font-weight: 700;
  color: var(--yellow);
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 64px;
    align-items: start;
  }
  .about__text { font-size: 19px; }
  .about__for { padding: 36px 32px; }
}

/* ---------- Карточки (переваги, кроки, знижки) ---------- */
.card {
  padding: 28px 24px;
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: var(--radius);
  transition: transform .25s var(--ease), border-color .25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
}

.cards {
  display: grid;
  gap: 16px;
}
@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

.adv__num {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  color: var(--yellow);
}
.adv__title {
  margin-top: 18px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}
.adv__text {
  margin-top: 10px;
  color: var(--muted);
}

.slogan {
  max-width: 920px;
  margin: 48px auto 0;
  font-size: clamp(22px, 1.8vw + 16px, 34px);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  color: var(--yellow);
  text-wrap: balance;
  white-space: pre-line; /* \n в data.json → перенос строки */
}
@media (min-width: 900px) {
  .slogan { margin-top: 72px; }
}

/* ---------- Як ми працюємо ---------- */
.steps {
  display: grid;
  gap: 16px;
}
.step__num {
  display: block;
  margin-bottom: 16px;
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: var(--yellow);
}
.step__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}
.step__text {
  margin-top: 8px;
  color: var(--muted);
}

@media (min-width: 600px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (min-width: 1024px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .step__num { margin-bottom: 18px; font-size: 52px; }
}

/* ---------- Каталог ---------- */
.catalog__grid {
  display: grid;
  gap: 20px;
}
/* Пока открыта таблица размеров, соседние карточки не растягиваются под неё */
.catalog__grid:has(.collapse.is-open) { align-items: start; }
@media (min-width: 600px) {
  .catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .catalog__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}

.product {
  display: flex;
  flex-direction: column;
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s;
}
.product:hover {
  transform: translateY(-4px);
  border-color: var(--line);
}

.product__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 50% 45%, #2B2B55 0%, var(--navy-2) 72%);
}
.product__media.has-photo { cursor: pointer; }

.product__img,
.product__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity .35s var(--ease);
}
.product__img {
  padding: 9%;
  object-fit: contain;
}
.product__photo {
  object-fit: cover;
  opacity: 0;
}
.product__media.is-photo .product__photo { opacity: 1; }
@media (hover: hover) {
  .product__media.has-photo:hover .product__photo { opacity: 1; }
}

/* Перефарбування схеми. Шари знизу вгору: колір (--tint на картці) з маскою по альфі силуету →
   сірий силует (.product__base) з multiply → SVG зі стрілками розмірів → фото (перекриває все, без фарби).
   Multiply саме на силуеті, а не на шарі кольору: так силует лише затемнює колір,
   і на напівпрозорому краї не проступає біла облямівка. */
.product__media { isolation: isolate; } /* multiply змішується лише всередині картинки */
.product__base { transition: opacity .35s var(--ease), filter .3s var(--ease); }
.product.is-tintable .product__base {
  mix-blend-mode: multiply;
  filter: var(--tint-filter, none); /* темні кольори: контрастніший силует */
}
.product__tint {
  position: absolute;
  inset: 9%; /* = padding у .product__img: маска лягає рівно на силует */
  background-color: var(--tint-paint, var(--tint, transparent));
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  mask-mode: alpha;
  pointer-events: none;
  transition: opacity .35s var(--ease), background-color .3s var(--ease);
}
/* Поки силует не завантажився — не показуємо ні його, ні фарбу (без спалаху білого) */
.product.is-tintable .product__media:not(.is-tint-ready) .product__base,
.product__media:not(.is-tint-ready) .product__tint { opacity: 0; }
/* Відкрита таблиця розмірів: силует стає білим (без фарби), зверху проявляються стрілки */
.product.is-sizes .product__tint { background-color: #FFFFFF; }
.product.is-sizes .product__base { filter: none; }

/* Стрілки розмірів: SVG з viewBox 0 0 1 1 — рівно на квадраті картинки (той самий відступ 9%, що в .product__img);
   товщина ліній і розмір літер задані в частках картинки, тому однакові на будь-якому екрані */
.product__arrows {
  position: absolute;
  top: 9%;
  left: 9%;
  width: 82%;
  height: 82%;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.product.is-sizes .product__arrows { opacity: 1; }
.product__arrows path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product__arrows .arrow__line { stroke: currentColor; }
.product__arrows text {
  fill: currentColor;
  font-family: var(--font);
  font-weight: 800;
}
/* Кольори стрілок і літер у шапці таблиці: A червоний, B синій, C зелений, D жовтий (як на візитці) */
.mark-1 { color: var(--arrow-1); }
.mark-2 { color: var(--arrow-2); }
.mark-3 { color: var(--arrow-3); }
.mark-4 { color: var(--arrow-4); }

.product__toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 20px;
  color: var(--white);
  background: rgba(21, 21, 40, .75);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color .2s, color .2s;
}
.product__toggle[aria-pressed="true"] {
  background: var(--yellow);
  color: var(--navy);
}

.product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px 22px;
}
@media (min-width: 600px) {
  .product__body { padding: 22px 22px 24px; }
  .product__name { min-height: 2.6em; }
}

.product__name {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.product__specs {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.swatch {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid transparent;
}
.swatch--light { border-color: #9494A8; }
.swatch--dark { border-color: rgba(255, 255, 255, .35); }

/* Кружки-кнопки (перефарбування): кнопка 30px, кружок 22px, між ними — проміжок під рамку вибору */
.swatches--pick {
  gap: 2px;
  margin: -4px; /* кружки стоять на тій самій лінії, що й текст карточки */
}
.swatch-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color .2s;
}
.swatch-btn:hover { border-color: rgba(255, 255, 255, .4); }
.swatch-btn[aria-pressed="true"] { border-color: var(--yellow); }
.swatch-btn:focus-visible {
  outline-color: var(--white);
  outline-offset: 0;
}

.product__price {
  margin-top: auto; /* цена и кнопки — по низу карточки */
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--yellow);
  white-space: nowrap;
}

.product__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.product__actions .btn {
  flex: 1 1 auto;
  padding-inline: 16px;
}
.product__actions .btn .icon {
  font-size: 18px;
  transition: transform .25s var(--ease);
}
.product__actions .btn[aria-expanded="true"] .icon { transform: rotate(180deg); }

/* Акордеон таблиці розмірів */
.collapse {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows .3s var(--ease), visibility 0s linear .3s;
}
.collapse.is-open {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows .3s var(--ease), visibility 0s;
}
.product__body > .collapse { margin-top: -14px; } /* свёрнутая панель не добавляет зазор под кнопками */
.collapse__inner {
  min-height: 0;
  overflow: hidden;
}
.product__body .sizes__note { padding-top: 14px; } /* отступ внутри — чтобы свёрнутая панель имела нулевую высоту */

.sizes__note {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--navy-3);
  border-radius: 10px;
}

.sizes {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sizes th,
.sizes td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--navy-3);
  white-space: nowrap;
}
.sizes thead th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(38, 38, 74, .6);
}
.sizes thead th { vertical-align: top; }
/* Літера стрілки під назвою колонки — у кольорі стрілки на схемі */
.sizes__mark {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.sizes tbody th {
  font-weight: 700;
  color: var(--white);
}
.sizes tbody tr:last-child > * { border-bottom: 0; }

/* ---------- Знижки ---------- */
.tiers {
  display: grid;
  gap: 16px;
}
@media (min-width: 768px) {
  .tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

.tier { text-align: center; }
.tier__discount {
  font-size: clamp(48px, 3vw + 36px, 68px);
  font-weight: 800;
  line-height: 1;
  color: var(--yellow);
}
.tier__label {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.tier__range {
  margin-top: 4px;
  color: var(--muted);
}

.discounts__custom {
  margin-top: 32px;
  font-size: clamp(19px, 1.4vw + 14px, 26px);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--red);
  text-wrap: balance;
}
@media (min-width: 900px) {
  .discounts__custom { margin-top: 48px; }
}

/* ---------- Приклади робіт ---------- */
/* Колонки задаются только здесь: карусель в main.js читает их отсюда (страница = 3 ряда) */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start; /* на неполной последней странице пустые ячейки просто пустые */
  gap: var(--carousel-gap);
}
@media (min-width: 768px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Карусель: трек из страниц, сдвиг transform'ом; высота = самая высокая (полная) страница */
.carousel {
  --carousel-gap: 8px;
  --dots-gap: 16px;
  --dots-h: 44px;
  position: relative;
}
@media (min-width: 768px) {
  .carousel { --carousel-gap: 12px; }
}

.carousel__viewport {
  overflow: hidden;
  border-radius: 12px;
  touch-action: pan-y pinch-zoom; /* вертикальная прокрутка — браузеру, горизонтальный свайп — карусели */
}

.carousel__track {
  display: flex;
  column-gap: var(--carousel-gap);
  transition: transform .35s cubic-bezier(.2, .7, .3, 1); /* ease-out */
  will-change: transform;
}
.carousel.is-static .carousel__track { transition: none; }

.carousel__page {
  flex: 0 0 100%;
  min-width: 0;
}

.carousel__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--dots-h);
  margin-top: var(--dots-gap);
}
.carousel__dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.carousel__dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--navy-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  transition: background-color .2s, transform .2s;
}
.carousel__dot:hover::before { background: var(--muted); }
.carousel__dot[aria-current="true"]::before {
  background: var(--yellow);
  box-shadow: none;
  transform: scale(1.2);
}

/* Стрелки — в стиле лайтбокса: на мобильном по краям ряда с точками, на десктопе по бокам сетки */
.carousel__arrow {
  position: absolute;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  color: var(--white);
  background: rgba(38, 38, 74, .85);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color .2s, color .2s, opacity .2s;
}
.carousel__arrow--prev { left: 0; }
.carousel__arrow--next { right: 0; }
.carousel__arrow:hover:not(:disabled) {
  background: var(--yellow);
  color: var(--navy);
}
.carousel__arrow:disabled {
  opacity: .3;
  cursor: default;
}

@media (min-width: 900px) {
  .carousel__arrow {
    top: calc((100% - var(--dots-gap) - var(--dots-h)) / 2); /* центр сетки, без ряда точек */
    bottom: auto;
    width: 48px;
    height: 48px;
    font-size: 24px;
    transform: translateY(-50%);
  }
  .carousel__arrow--prev { left: -24px; }
  .carousel__arrow--next { right: -24px; }
}
@media (min-width: 1360px) {
  .carousel__arrow--prev { left: -72px; } /* хватает места — выносим за сетку */
  .carousel__arrow--next { right: -72px; }
}

.gallery__btn {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  background: var(--navy-2);
  border: 0;
  border-radius: 12px;
  cursor: zoom-in;
}
.gallery__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease), opacity .3s;
}
.gallery__btn:hover img { transform: scale(1.05); }

/* ---------- Лайтбокс ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px 88px;
  background: rgba(10, 10, 22, .94);
  animation: fade-in .2s ease;
}
@media (min-width: 900px) {
  .lightbox { padding: 56px 96px; }
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
}
.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
  object-fit: contain;
  border-radius: 8px;
}
.lightbox__caption {
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}

.lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  font-size: 24px;
  color: var(--white);
  background: rgba(38, 38, 74, .85);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.lightbox__btn:hover {
  background: var(--yellow);
  color: var(--navy);
}
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: calc(50% - 60px); bottom: 20px; }
.lightbox__next { right: calc(50% - 60px); bottom: 20px; }
@media (min-width: 900px) {
  .lightbox__close { top: 20px; right: 20px; }
  .lightbox__prev,
  .lightbox__next { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lightbox__prev { left: 24px; }
  .lightbox__next { right: 24px; }
}

html.is-locked { overflow: hidden; }

/* ---------- Контакти ---------- */
.contact-card {
  padding: 32px 16px;
  color: var(--navy);
  background: var(--gold);
  border-radius: 20px;
}
.contact-card .h2 { color: var(--navy); }

.contact-card__grid {
  display: grid;
  gap: 32px;
  margin-top: 28px;
}

.contact-info {
  display: grid;
  align-content: start;
  gap: 16px;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.info-row .icon {
  margin-top: 1px;
  font-size: 22px;
}

.contact-phone {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 8px;
  font-size: clamp(21px, 1.6vw + 15px, 34px);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  color: var(--navy);
}
.contact-phone span { white-space: nowrap; }
.contact-phone .round-icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
  background: var(--navy);
  color: var(--gold);
}
.contact-phone:hover span {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.contact-label {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .8;
}

/* Мессенджеры: на узких экранах 2×2 (иконка слева), от 480px — четыре в ряд */
.messengers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.messengers li { display: flex; }

.messenger {
  display: grid;
  flex: 1;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 8px;
  padding: 10px 8px;
  text-decoration: none;
  color: var(--navy);
  background: rgba(21, 21, 40, .08);
  border-radius: 12px;
  transition: background-color .2s, transform .2s var(--ease);
}
.messenger:hover {
  background: rgba(21, 21, 40, .16);
  transform: translateY(-2px);
}
.messenger .round-icon {
  grid-row: span 2;
  align-self: center;
  width: 40px;
  height: 40px;
  font-size: 22px;
}
.messenger__name {
  align-self: end;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.messenger__name:last-child { grid-row: span 2; align-self: center; } /* без ника — подпись по центру */
.messenger__handle {
  align-self: start;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  opacity: .8;
  overflow-wrap: anywhere;
}

@media (min-width: 480px) {
  .messengers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .messenger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 4px 12px;
    text-align: center;
  }
  .messenger .round-icon { width: 48px; height: 48px; font-size: 26px; }
  .messenger__name,
  .messenger__handle { align-self: center; }
  .messenger__handle { margin-top: -4px; }
}

.socials-block { margin-top: 28px; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
}
.social .round-icon {
  width: 40px;
  height: 40px;
  font-size: 22px;
}
.social:hover .social__handle {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 600px) {
  .contact-card { padding: 44px 36px; }
  .info-row { font-size: 17px; }
}
@media (min-width: 900px) {
  .contact-card { padding: 56px 56px; }
  .contact-card__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 56px;
    margin-top: 36px;
  }
}

/* Брендові кольори іконок */
.brand--telegram { --brand: #26A5E4; }
.brand--whatsapp { --brand: #25D366; }
.brand--viber { --brand: #7360F2; }
.brand--signal { --brand: #3A76F0; }
.brand--threads { --brand: #000000; }
.brand--facebook { --brand: #0866FF; }
.brand--instagram {
  --brand: radial-gradient(circle at 30% 107%, #FDF497 0%, #FDF497 5%, #FD5949 45%, #D6249F 60%, #285AEB 90%);
}

/* ---------- Підвал ---------- */
.footer {
  padding: 48px 0 36px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.footer__inner {
  display: grid;
  gap: 20px;
  justify-items: center;
  text-align: center;
}

.footer__logo img {
  width: auto;
  height: 48px;
}

.footer__text,
.footer__copy {
  font-size: 14px;
  color: var(--muted);
}
.footer__copy { font-size: 13px; }

.footer__socials {
  display: flex;
  gap: 10px;
}
.footer__socials .round-icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
  background: var(--navy-3);
  transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.footer__socials .round-icon:hover {
  background: var(--yellow);
  color: var(--navy);
}

@media (min-width: 900px) {
  .footer__inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "logo text socials"
      "logo copy socials";
    gap: 4px 40px;
    align-items: center;
    justify-items: start;
    text-align: left;
  }
  .footer__logo { grid-area: logo; }
  .footer__text { grid-area: text; align-self: end; }
  .footer__copy { grid-area: copy; align-self: start; }
  .footer__socials { grid-area: socials; }
}

/* ---------- Завантаження та помилки ---------- */
.load-error {
  margin-top: calc(var(--header-h) + 24px);
  padding: 20px 24px;
  font-weight: 600;
  line-height: 1.5;
  background: var(--navy-2);
  border: 1px solid var(--red);
  border-radius: 12px;
}
.load-error__detail {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.is-loading .header,
.is-loading main,
.is-loading .footer {
  visibility: hidden;
}

/* Контент не загрузился: только сообщение об ошибке */
.is-failed .header,
.is-failed .footer,
.is-failed main > section {
  display: none;
}
.is-failed .load-error { margin-top: 48px; }

.page-loader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.is-loading .page-loader { display: flex; }
.page-loader span {
  width: 6px;
  height: 28px;
  border-radius: 2px;
  animation: loader-pulse 1s ease-in-out infinite;
}
.page-loader span:nth-child(1) { background: var(--blue); }
.page-loader span:nth-child(2) { background: var(--yellow); animation-delay: .15s; }
.page-loader span:nth-child(3) { background: var(--red); animation-delay: .3s; }

.noscript {
  padding: 120px 16px;
  text-align: center;
}

@keyframes loader-pulse {
  0%, 100% { transform: scaleY(.45); opacity: .5; }
  50% { transform: scaleY(1); opacity: 1; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Зменшення анімацій ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .card:hover,
  .product:hover,
  .messenger:hover,
  a.round-icon:hover { transform: none; }
  .gallery__btn:hover img { transform: none; }
}
