/* =================== HERO ============= */

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 20px;
  padding-top: 120px; /* приблизна висота хедера */
  box-sizing: border-box;
}

.hero__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;

  width: 100%; /* займає всю ширину контейнера */
  padding-left: 0; /* залишаємо, бо контейнер вже має padding */
  box-sizing: border-box;
}

/* Щоб текст краще читався */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35); /* легке затемнення поверх відео */
  z-index: 1;
}
/* Стилі заголовка та підзаголовка */
.hero__subtitle {
  color: #fff;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  margin-bottom: 30px;
  margin-top: clamp(10px, 3vw, 100px);
  text-transform: uppercase;
}

.hero__title {
  color: #fff;
  max-width: 918px; /* обмеження ширини заголовка */
  width: 100%; /* щоб займав всю доступну ширину до max-width */
  box-sizing: border-box;
  margin-bottom: 30px;
  line-height: 1.1;
}

.hero__text {
  color: #fff;
  max-width: 695px; /* обмеження ширини підзаголовка */
  margin-bottom: 30px;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}
.hero__btn {
  width: 187px;
}
.hero__actions {
  display: flex;
  gap: 16px; /* відстань між кнопками */
  flex-wrap: wrap; /* щоб на мобільних могли стати одна під одною */
}

/* ======= categories ================= */
.categories {
  padding-top: clamp(40px, 5vw, 80px);
  margin-bottom: clamp(20px, 5vw, 80px);
}

.categories__text {
  color: #a6a6a6;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.categories__title {
  text-align: left;
  margin-bottom: 40px;
  color: #222222;
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(4px, 3vw, 30px);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.category-card img {
  height: auto;
  aspect-ratio: 5 / 4.5; /* пропорції  фото */
  object-fit: cover;
  transition: transform 0.4s ease;
}

.category-card__label {
  width: 100%;
  background-color: #f8f8f8; /* бежевий відтінок */
  text-align: center;
  padding: clamp(10px, 2vw, 15px) 0;
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 700; /* жирний текст */
  letter-spacing: 0.06em;
  color: #1e1e1e;
}

.category-card:hover img {
  transform: scale(1.02);
}

/* =========== секція ADVANTAGES========== */

.advantages {
  position: relative;
  background: url("../img/advantages-bg.jpg") center/cover no-repeat;
  color: #fff;
  height: auto;
  min-height: clamp(600px, 100vh, 1200px); /* мінімальна висота секції */
  padding-bottom: 40px; /* простір знизу секції */
}
.advantages__container {
  position: relative;
  z-index: 2;
}

.advantages__overlay {
  min-height: auto;
  display: flex;
  align-items: flex-start;
  padding-top: clamp(140px, 20vh, 360px);
  padding-bottom: clamp(5px, 2vh, 20px);
}

.advantages::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.75) 0%,
      rgba(0, 0, 0, 0.6) 45%,
      rgba(0, 0, 0, 0.25) 72%,
      rgba(0, 0, 0, 0) 100%
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 1;
}

.advantages__title {
  color: #fff;
  line-height: 1.15;
  max-width: 590px; /* обмеження ширини заголовка */
  width: 100%; /* щоб займав всю доступну ширину до max-width */
  box-sizing: border-box;
  margin-bottom: 30px;
  letter-spacing: 1px;
}

.advantages__text {
  color: #fff;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  margin-bottom: 30px;
  box-sizing: border-box;
  max-width: 590px;
  line-height: 1.6; /* зменшує відстань між рядками */
  opacity: 0.95;
}

.advantages__btn {
  width: 197px; /* ширина кнопки */
  height: 44px; /* висота кнопки */
  color: #fff;
  background: #790000;
}

.advantages__grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(160px, 1fr)
  ); /* ← зменшити до 160px */
  gap: 20px; /* ← зменшити проміжки */
  margin-top: clamp(20px, 10vh, 100px);
  padding-bottom: clamp(10px, 2vh, 40px);
  position: relative;
  z-index: 2;
}

.advantage {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.advantage img {
  width: clamp(36px, 6vw, 50px);
  height: clamp(36px, 6vw, 50px);
  margin-bottom: clamp(15px, 2vh, 20px);
}

.advantage p {
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.4;
  padding: 0 5px; /* ← зменшити падінги */
  max-width: clamp(147px, 20vw, 260px); /* ← адаптивний max-width */
  margin: 0 auto;
}

/* =========== PARTNERS  ========= */
.partners {
  padding: clamp(40px, 7vw, 100px) 0;
  background-color: #f9f9f9;
}

.partners__header {
  margin-bottom: clamp(40px, 5vw, 60px);
}

.partners__subtitle {
  color: #a6a6a6;
  text-transform: uppercase;
  font-size: clamp(0.75rem, 1vw, 0.875rem);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.partners__title {
  color: #222222;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
}

/* Обгортка для маски та приховування крайніх частин */
.partners__logos-wrapper {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

/* Трек з логотипами — саме він анімується (містить оригінал + дубль) */
.partners__logos-track {
  --logo-h: clamp(55px, 14vw, 80px);
  --gap: clamp(20px, 6vw, 50px);
  --duration: 28s;

  display: flex;
  flex-wrap: nowrap;
  gap: var(--gap);
  justify-content: flex-start;
  align-items: center;
  width: max-content; /* дозволяє треку бути ширше контейнера */
  animation: scroll var(--duration) linear infinite;
  will-change: transform; /* для кращої продуктивності */
}

.partner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner img {
  height: clamp(50px, 8vw, 80px);
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.partner img:hover {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.08);
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Пауза при наведенні на контейнер */
.partners__logos-wrapper:hover .partners__logos-track {
  animation-play-state: paused;
}

/* ==========секція master============ */

.master {
  position: relative;
  background: url("../img/master-bg.jpg") center/cover no-repeat;
  color: #fff;
  /* max-height прибрано — фіксований він конфліктував з padding на мобільних */
}

.master__content {
  padding-top: clamp(60px, 14vh, 190px);
  padding-bottom: clamp(60px, 20vh, 300px);
}

/* заголовок */
.master__title {
  color: #222222;
  max-width: clamp(250px, 40vw, 500px);
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 30px; /* відступ між заголовком і підзаголовком */
  letter-spacing: 1px;
  line-height: 1.2; /* зменшує відстань між рядками */
}

/* підзаголовок */
.master__subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  line-height: clamp(1.1, 2.5vh, 1.6);
  color: #222222;
  box-sizing: border-box;
  margin-bottom: 30px; /* відступ до кнопки */
  max-width: clamp(220px, 60vw, 450px);
}

/* кнопка */
.master__btn {
  width: 200px;
  height: 50px;
  color: #fff;
  background: #790000;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* ================ Карта та контакти ========== */

.contacts {
  padding: 80px 0;
  background: #fff;
}

.contacts__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px;
}

.contacts__info {
  flex: 1; /* ліва частина з текстом */
}

.contacts__subtitle {
  font-size: clamp(14px, 2.2vw, 16px);
  text-transform: uppercase;
  color: #a5a5a5;
  margin-bottom: 10px;
}

.contacts__title {
  margin-bottom: clamp(10px, 2vh, 40px);
}

/* На десктопах колонки вертикальні (як було) */
.contacts__columns {
  display: block; /* замість flex на десктопі */
}

.contacts__col {
  margin-bottom: clamp(24px, 2vh, 40px);
}

.contacts__col:last-child {
  margin-bottom: 0;
}

.contacts__address {
  margin-bottom: clamp(24px, 2vh, 40px);
  line-height: 1.6;
}

.contacts__email {
  color: #000;
  text-decoration: none;
}

/* ===два номера телефону==== */
.contacts__phones {
  padding: 0;
  margin-bottom: clamp(24px, 2vh, 40px);
  list-style: none; /* прибираємо маркери */
}

.contacts__phones li {
  margin-bottom: 5px; /* відстань між номерами */
}

.contacts__phones li:last-child {
  margin-bottom: 0; /* останній без відступу */
}

.contacts__phones a {
  color: #222;
  text-decoration: none;
  font-variant-numeric: tabular-nums; /* вирівнюємо на однакову ширину */
}

.contacts__phones a:hover {
  text-decoration: underline;
}
/* ========== */
.contacts__schedule {
  font-size: 15px;
  line-height: 2;
  margin-bottom: clamp(8px, 1vh, 20px);
}

.contacts__schedule p {
  margin-bottom: clamp(8px, 1vh, 20px);
}

/* прибираємо маркери і падінги списку */
.contacts__schedule ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* кожен рядок як рядок таблиці */
.contacts__schedule li {
  display: table-row;
}

/* два "стовпчики": день і час */
.contacts__schedule li .day,
.contacts__schedule li .time {
  display: table-cell;
}

/* відстань між текстом і часом */
.contacts__schedule li .time {
  padding-left: 20px;
  color: #666;
}

.contacts__invite {
  text-align: left;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.4;
  margin-left: auto;
  margin-right: auto;
  width: 100%; /* Займає всю ширину */
  margin-top: 40px; /* Відступ від карти */
}

.contacts__map {
  flex: 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  border-radius: 12px;
  overflow: hidden;
}

/* ===== Адаптивність ===== */

/* === 992px і менше (планшети) ===== */
@media (max-width: 992px) {
  /* весь блок contacts__inner стає вертикально */
  .contacts__inner {
    flex-direction: column;
  }

  .contacts__map {
    height: 350px;
    /* order: 3; - видаляємо, бо тепер це не потрібно */
  }

  .contacts__invite {
    font-size: 18px;
    /* order: 2; - видаляємо, бо тепер це не потрібно */
    margin-top: 20px;
    margin-bottom: 0;
  }

  /* .contacts__info {
    order: 1; - видаляємо, бо тепер це не потрібно
  } */

  /* Коли карта внизу - робимо контакти в дві колонки */
  .contacts__columns {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
  }

  .contacts__col {
    flex: 1;
    min-width: 250px; /* мінімальна ширина колонки */
    margin-bottom: 0; /* скидаємо марджини з десктопу */
  }
}
/* Landscape на мобільному — хедер займає більше відносного простору */
@media (max-width: 991px) and (orientation: landscape) {
  .hero {
    padding-top: 90px;
    min-height: 100svh;
  }
  .hero__subtitle {
    display: none;
  }
}
/* === 768px і менше (мобільні) ===== */
@media (max-width: 768px) {
  .hero {
    height: 100dvh;
    min-height: 100dvh;
    padding-top: 50px; /* менше на мобільному */
  }
  /* категорії */
  .categories__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ==контакти== */
  .contacts__columns {
    flex-direction: column; /* на мобільних колонки знову вертикально */
    gap: 24px;
  }

  .contacts__col {
    width: 100%; /* колонки займають всю ширину */
  }

  .contacts__map {
    height: 300px;
  }

  .contacts__invite {
    font-size: 16px;
    margin-top: 20px;
  }

  .partners {
    padding: clamp(30px, 5vw, 80px) 0;
  }

  .partners__logos-track {
    /* ← правильний клас */
    --logo-h: clamp(50px, 18vw, 70px);
    --gap: 24px;
    animation-duration: 20s;
  }
}

@media (max-width: 480px) {
  .partners {
    padding: clamp(20px, 4vw, 60px) 0;
  }

  .partners__title {
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  }

  .partners__logos-track {
    --logo-h: 58px;
    --gap: 20px;
    animation-duration: 16s;
  }
}
