/**
  * SimpleAdaptiveSlider by itchief
  * Финальная версия с исправленным позиционированием индикаторов
  */

/* ============================================================
   БАЗОВЫЕ СТИЛИ СЛАЙДЕРА
   ============================================================ */
.itcss {
  position: relative;
  margin-right: auto;
  margin-left: auto;
}

.itcss__wrapper {
  position: relative;
  overflow: hidden;
  background-color: #eee;
}

.itcss__items {
  display: flex;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.5s ease;
  will-change: transform;
}

.itcss__item {
  position: relative;
  flex: 0 0 100%;
  max-width: 100%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
}

.transition-none {
  transition: none;
}

.d-none {
  display: none;
}

/* ============================================================
   КНОПКИ УПРАВЛЕНИЯ (Квадратные, белый бордюр)
   ============================================================ */
.itcss__controls {
  position: absolute;
  bottom: 30px;
  right: 30px;
  display: flex;
  gap: 12px;
  z-index: 30;
}

.itcss__btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border: 2px solid #ffffff;
  border-radius: 0;
  background-color: rgba(128, 128, 128, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.itcss__btn:hover {
  background-color: rgba(128, 128, 128, 0.75);
}

.itcss__btn:focus {
  outline: none;
}

.itcss__btn_hide {
  display: none;
}

.itcss__btn::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: transparent no-repeat center center;
  background-size: 100% 100%;
}

.itcss__btn_prev::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

.itcss__btn_next::before {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.itcss__btn_pause::before {
  width: 14px;
  height: 16px;
  background: none;
  border-left: 4px solid #fff;
  border-right: 4px solid #fff;
}

.itcss__btn_play::before {
  width: 0;
  height: 0;
  background: none;
  border: none;
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

/* ============================================================
   ИНДИКАТОРЫ (ПОЗИЦИОНИРОВАНИЕ - ГЛАВНОЕ ИСПРАВЛЕНИЕ)
   ============================================================ */

/* БАЗА (Десктоп и планшеты > 830px) */
.itcss__indicators {
  position: absolute;
  bottom: 40px;               /* Отступ снизу для десктопа */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  z-index: 20;
}



.itcss__indicator {
  width: 56px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.itcss__indicator_active {
  background-color: rgba(255, 255, 255, 0.6);
}

.itcss__indicator:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* ============================================================
   СЛАЙДЫ: ФОН И ВИДЕО
   ============================================================ */
.slider__bg {
  height: 895px;
  width: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
}

.slide_poverh {
height: 895px; 
width: 100%;
display: flex; 
flex-direction: column;
justify-content: space-between;
}

.slide_otstup {
  margin-bottom: 100px;
}

.slider__bg--video {
  overflow: hidden;
}

.slider__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.slider__bg--video .container {
  position: relative;
  z-index: 1;
}

.buttonslide {
  /* background-color: none; */
  background-color: rgba(128, 128, 128, 0.45);
  /* border: none; */
  /* border-radius: 25px; */
  border: solid 2px #ffffff;
  color: #ffffff;
  text-transform: uppercase;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  display: inline-block;
  padding: 5px 30px;
  position: relative;
  height: 44px;
  margin: 20px 0px;
}

.buttonslide:hover {
  background: red;
  /* background-color: #de002c; */
  cursor: pointer;
  border: solid 2px white;
  color: white;
}

.uppertext {
  text-transform: uppercase;
  font-size: 44px;
  text-align: center;
}

.uppertext svg {
  height: 32px;
  width: 329px;
}

/* ============================================================
   АДАПТИВ (МОБИЛЬНЫЕ УСТРОЙСТВА <= 830px)
   ============================================================ */
@media screen and (max-width: 830px) {
  /* --- Индикаторы: поднимаем наверх --- */
  


     .itcss__indicators {
        bottom: auto;
        top: 16px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        /* экран минус поля по 16px, но не шире 6 табов по 56 + 5 gap по 8 */
        width: min(calc(100% - 32px), 376px);
        gap: 8px;
        justify-content: center;
    }

      /* Табы: база 40px, но могут сжиматься и растягиваться,
       максимум — прежние 56px */
  .itcss__indicator {
      width: auto;
      flex: 1 1 40px;
      max-width: 56px;
  }

  /* --- Остальные мобильные стили (фон, контейнеры) --- */
  .slider__bg {
    height: 560px;
    background-position: center top;
  }

  .slide_poverh {
    height: 560px; 
    width: 100%;
    display: flex; 
    flex-direction: column;
    justify-content: space-between;
  }

  .slide_otstup {
    margin-bottom: 90px;
  }

 

  .dark-gray {
    bottom: 0px;
    background-color: #363c4f;
  }

  .categories {
    margin-bottom: 0px;
    top: 0px;
  }

  .slider {
    margin-top: 0 !important;
    top: auto !important;
    height: 420px !important;
    max-height: 500px !important;
    transform: none !important;
  }

  .uppertext {
    text-transform: uppercase;
    font-size: 40px;
    text-align: center;
  }

  .uppertext svg {
    height: 28px;
    width: 288px;
  }
}

/* ============================================================
   АДАПТИВ (ДЕСКТОП > 830px)
   ============================================================ */
@media screen and (min-width: 831px) {
  .slider {
    position: relative;
    width: 100% !important;
    height: auto !important;
    z-index: 1;
  }

  .sdvig {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: auto;
    max-width: 1200px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }

  .sdvig.dark-gray .container {
    width: 830px;
  }
}


.text-center-col {
    display: flex !important;
    justify-content: center !important; /* Центрирует по горизонтали */
    align-items: center !important;     /* Центрирует по вертикали внутри ячейки */
    text-align: center !important;      /* На случай, если внутри будет просто текст */
    width: 100% !important;             /* Гарантируем полную ширину колонки */
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Стопка — абсолютный фон на весь слайд */
.slide-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #2a2a2a 0%, #000 100%);
}

/* Сетка */

/* 1. БАЗОВОЕ СОСТОЯНИЕ (Мобильные < 660px) */
.slide-grid {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;       /* Вертикально */
    gap: 20px;
}

.slide-grid__text {
    flex: 0 0 auto;               /* Текст не растягивается */
    width: 100%;                  /* Текст на всю ширину */
    text-align: center;           /* Центрируем текст на мобильном */
    padding-top: 40px; /* Отступ сверху для всех экранов */
    box-sizing: border-box;
}

.slide-grid__watch {
    position: relative;
    flex: 1;                      /* Колонка часов забирает всё место */
    min-height: 400px;           /* Минимальная высота, чтобы часы не сплющились */
    width: 100%;                  /* Часы на всю ширину колонки */
}

/* 2. ПЛАНШЕТЫ И ШИРОКИЕ МОБИЛЬНЫЕ (>= 660px) */
@media (min-width: 500px) {
    .slide-grid {
        flex-direction: row;      /* Горизонтально */
        align-items: center;      /* Центрируем по вертикали */
        justify-content: space-between; /* Разносим текст и часы */
        max-width: 980px;
        margin: 0 auto;
        padding: 0 16px;
    }

    .slide-grid__text {
        flex: 0 0 45%;            /* Текст занимает 45% ширины */
        text-align: left;         /* Текст слева */
        align-self: center;       /* По центру вертикали */
    }

    .slide-grid__watch {
        flex: 0 0 55%;            /* Часы занимают 55% ширины */
        min-height: 400px;        /* Чуть выше на десктопе */
        width: auto;              /* Ширина задана через flex-basis */
    }
}

/* 3. ДЕСКТОП (>= 830px) - только для картинок, сетка уже настроена выше */
@media (min-width: 830px) {

    
    .slide-grid__watch {
        min-height: 700px;        /* Часы крупнее на десктопе */
    }
}

/* Стопка — только механика кроссфейда, растянута на колонку */
.fade-stack {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.fade-img,
.fade-img_first {
    position: absolute;
    inset: 0;
    margin: 0;
}
.fade-img_first { opacity: 1; }

.fade-img {
    opacity: 0;
    animation: crossfade 9s infinite;
    pointer-events: none;
}
.fade-img:nth-child(2) { animation-delay: 3s; }
.fade-img:nth-child(3) { animation-delay: 6s; }

.fade-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right bottom;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, 0) 90%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, 0) 90%, transparent 100%);
}

@keyframes crossfade {
    0%   { opacity: 0; }
    5%   { opacity: 1; }
    30%  { opacity: 1; }
    37%  { opacity: 0; }
    100% { opacity: 0; }
}


/* Логотип */
.slide-text__logo {
    margin-bottom: 15px;
    width: 100%;
}

.polar-logo-svg {
    display: block;
    width: 100%;
    max-width: 206px;
    height: auto;
}

/* Подзаголовок */
.slide-text__subtitle {
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 25px; /* Отступ между текстом и кнопкой */
}

/* ============================================================
   МОБИЛЬНЫЕ УСТРОЙСТВА (< 500px)
   ============================================================ */
@media (max-width: 499px) {
    .slide-grid__text {
        text-align: center; /* Для строчных элементов */
    }

    /* ЖЕЛЕЗНОЕ ЦЕНТРИРОВАНИЕ ЛОГОТИПА */
    .slide-text__logo {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    
    .polar-logo-svg {
        margin-left: auto;
        margin-right: auto;
        display: block;
        max-width: 180px; /* Чуть уменьшаем на совсем узких экранах */
    }

    /* Шрифт на мобильном */
    .slide-text__subtitle {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    /* ГЛАВНОЕ ИСПРАВЛЕНИЕ: Убираем margin у кнопки на мобильном */
    .slide-otstup {
        margin: 0 !important; 
    }
    
    .buttonslide {
        /* Если у кнопки есть свои margin, сбрасываем их здесь */
        margin: 0 !important; 
    }
}

/* ============================================================
   ПЛАНШЕТЫ (500px - 830px)
     ============================================================ */
@media (min-width: 500px) and (max-width: 830px) {
    .slide-text__subtitle {
        font-size: 1.5rem; /* Твой запрос */
        line-height: 1.1;
        text-align: left;
    }

    .slide-text__logo {
        margin-bottom: 10px;
        text-align: left;
    }
    
    .polar-logo-svg {
        max-width: 206px;
        width: 100%;
          margin-left: auto;
        margin-right: auto;
    }

    .slide-grid__text {
      padding-top: 0px;
    }
}

/* ============================================================
   ДЕСКТОП (> 830px)
   Стандартные размеры
   ============================================================ */
@media (min-width: 831px) {
    .slide-grid__text {
        padding-top: 40px; /* Отступ сверху только на больших экранах */
        text-align: left;
    }

    .slide-text__subtitle {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    .slide-text__logo {
        margin-bottom: 20px;
    }
}


/* Обёртки для пары видео (десктоп/мобайл) */
.slider__video-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0; /* контент (.slide_poverh) остаётся выше — у него z-index: 1 */
}

/* По умолчанию: видно мобильное, десктопное скрыто */
.slider__video-wrap--desktop { display: none; }
.slider__video-wrap--mobile  { display: block; }

@media screen and (min-width: 831px) {
    .slider__video-wrap--desktop { display: block; }
    .slider__video-wrap--mobile  { display: none; }
}