* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: #111827;
  background: #f6f7fb;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  display: block;
}

/* Первый экран с видеофоном */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;

  /*
    Fallback-фон, если видео не загрузится.
    Положите рядом с HTML-файлом картинку background-mobile.jpg
  */
  background-image: url("background-mobile.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Само видео */
.hero__video {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 100%;
  height: 100%;

  object-fit: cover;
  transform: translate(-50%, -50%);

  z-index: 0;
}

/* Затемнение поверх видео, чтобы текст читался */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

/* Контент поверх видео */
.hero__content {
  position: relative;
  z-index: 2;

  min-height: 100vh;
  padding: 24px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  text-align: center;
  color: #ffffff;
}

.hero__content h1 {
  margin: 0 0 18px;
  max-width: 900px;

  font-size: clamp(36px, 7vw, 80px);
  line-height: 1.05;
  font-weight: 700;
}

.hero__content p {
  margin: 0;
  max-width: 680px;

  font-size: clamp(16px, 3vw, 24px);
  line-height: 1.5;
}

.hero__button {
  margin-top: 32px;
  padding: 14px 28px;

  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;

  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);

  backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero__button:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

/* Общие секции */
.section,
.catalog {
  padding: 86px 24px;
}

.section--about {
  background: #ffffff;
}

.catalog {
  background: #f6f7fb;
}

.section__inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.section__label {
  margin: 0 0 10px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section h2,
.catalog h2 {
  margin: 0 0 16px;
  color: #111827;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
}

.section p,
.catalog__intro {
  max-width: 760px;
  margin: 0;
  color: #4b5563;
  font-size: 18px;
  line-height: 1.65;
}

.section__button {
  margin-top: 28px;
}

/* Каталог */
.catalog__intro {
  margin-bottom: 34px;
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

/* Карточка товара */
.product-card {
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.product-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.55);
  outline-offset: 4px;
}

.product-card a,
.product-card button {
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.16);
}

.product-card__body {
  padding: 22px;
}

.product-card h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 21px;
  line-height: 1.25;
}

.product-card__price {
  margin: 0 0 18px;
  color: #111827;
  font-size: 22px;
  font-weight: 800;
}

.product-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Галерея внутри карточки */
.product-gallery {
  position: relative;
  background: #eef2ff;
}

.product-gallery__viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.product-gallery__image {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.product-gallery__image.is-active {
  opacity: 1;
}

video.product-gallery__image {
  background: #111827;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;

  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;

  color: #111827;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);

  font-size: 30px;
  line-height: 1;
  cursor: pointer;

  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-arrow:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.04);
}

.gallery-arrow--prev {
  left: 12px;
}

.gallery-arrow--next {
  right: 12px;
}

.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;

  display: flex;
  gap: 7px;

  transform: translateX(-50%);
}

.gallery-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.gallery-dot.is-active {
  width: 22px;
  background: #ffffff;
}

/* Кнопки */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;
  padding: 12px 18px;

  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  text-align: center;

  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.button--primary {
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.button--primary:hover {
  background: #1d4ed8;
}

.button--secondary {
  color: #111827;
  background: #f3f4f6;
}

.button--secondary:hover {
  background: #e5e7eb;
}

/* Страница товара */
.product-page {
  min-height: 100vh;
  padding: 36px 24px 86px;
  background: #f6f7fb;
}

.product-page__top {
  width: min(1180px, 100%);
  margin: 0 auto 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover {
  text-decoration: underline;
}

.product-detail {
  width: min(1180px, 100%);
  margin: 0 auto;

  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 36px;
  align-items: start;
}

.product-detail__gallery,
.product-detail__info {
  overflow: hidden;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 16px 46px rgba(15, 23, 42, 0.12);
}

.product-detail__gallery .product-gallery__viewport {
  aspect-ratio: 1 / 0.78;
}

.product-detail__info {
  padding: clamp(24px, 4vw, 42px);
}

.product-detail__label {
  margin: 0 0 12px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-detail h1 {
  margin: 0 0 16px;
  color: #111827;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.06;
}

.product-detail__price {
  margin: 0 0 22px;
  color: #111827;
  font-size: 30px;
  font-weight: 900;
}

.product-detail__description {
  margin: 0 0 28px;
  color: #4b5563;
  font-size: 18px;
  line-height: 1.65;
}

.product-detail__features {
  margin: 0 0 30px;
  padding: 0;
  list-style: none;

  display: grid;
  gap: 12px;
}

.product-detail__features li {
  padding: 14px 16px;
  border-radius: 16px;
  color: #374151;
  background: #f3f4f6;
}

.product-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Планшеты */
@media (max-width: 1024px) {
  .catalog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-detail {
    grid-template-columns: 1fr;
  }
}

/* Мобильные устройства */
@media (max-width: 768px) {
  .hero {
    /*
      100svh лучше подходит для мобильных браузеров,
      потому что учитывает адресную строку.
    */
    min-height: 100svh;
  }

  .hero__content {
    min-height: 100svh;
    padding: 20px;
  }

  .hero__overlay {
    background: rgba(0, 0, 0, 0.58);
  }

  .hero__button {
    width: 100%;
    max-width: 280px;
  }

  .section,
  .catalog {
    padding: 62px 18px;
  }

  .catalog__grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .product-card {
    border-radius: 22px;
  }

  .product-card__actions {
    grid-template-columns: 1fr;
  }

  .gallery-arrow {
    width: 34px;
    height: 34px;
    font-size: 26px;
  }

  .product-page {
    padding: 24px 16px 64px;
  }

  .product-detail__info {
    border-radius: 24px;
  }

  .product-detail__actions {
    display: grid;
  }
}

/* Если пользователь отключил анимации в системе */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__video {
    display: none;
  }

  .hero__button,
  .product-card,
  .button,
  .gallery-arrow,
  .product-gallery__image {
    transition: none;
  }

  .hero__button:hover,
  .product-card:hover,
  .button:hover,
  .gallery-arrow:hover {
    transform: none;
  }
}
