/* Main banner slider — Figma 02 / Баннер */

.sp-banner {
  box-sizing: border-box;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 20px;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  transition: margin-top 0.18s ease;
}

/* Под compact-шапкой убираем верхний «воздух», баннер ближе к липкой полосе */
html.sp-header-compact .sp-banner {
  margin-top: 0;
}

.sp-banner *,
.sp-banner *::before,
.sp-banner *::after {
  box-sizing: border-box;
}

.sp-banner__frame {
  position: relative;
  width: 100%;
  max-width: 1880px;
  margin: 0 auto;
  height: 680px;
  border-radius: 32px;
  overflow: hidden;
  isolation: isolate;
}

.sp-banner__swiper,
.sp-banner__swiper .swiper-wrapper,
.sp-banner__slide {
  width: 100%;
  height: 100%;
}

.sp-banner__slide {
  position: relative;
  overflow: hidden;
  background-color: #1a1f2c;
}

.sp-banner__picture {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Анонс (ПК) / детальная (моб.) — cover по контейнеру */
.sp-banner__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.sp-banner__overlay {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.34) 0%,
    rgba(0, 0, 0, 0.288) 39.62%,
    rgba(0, 0, 0, 0.242) 45.34%,
    rgba(0, 0, 0, 0) 60.03%
  );
}

.sp-banner__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  /* низ: стрелки 52 + bottom 60 + зазор */
  padding: 80px 220px 124px;
  transition: padding-top 0.18s ease;
}

html.sp-header-compact .sp-banner__inner {
  padding-top: 48px;
}

.sp-banner__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 64px;
  width: min(800px, 100%);
  max-width: 800px;
  z-index: 1;
}

.sp-banner__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}

.sp-banner__title {
  margin: 0;
  width: 100%;
  font-weight: 500;
  font-size: 64px;
  line-height: 1.15;
  color: #fff;
  overflow: visible;
}

.sp-banner__text {
  margin: 0;
  width: 100%;
  font-weight: 400;
  font-size: 18px;
  line-height: 28px;
  color: #fff;
  opacity: 0.86;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.sp-banner__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sp-banner__btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  height: 52px;
  padding: 14px 23px;
  border: 0;
  border-radius: 10px;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 18px;
  line-height: 24px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.sp-banner__btn--light,
a.sp-banner__btn--light.button-popup,
.sp-banner a.sp-banner__btn--light.button-popup {
  width: 173px;
  flex: none;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  color: #131927 !important;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.sp-banner__btn--light:hover,
a.sp-banner__btn--light.button-popup:hover,
.sp-banner a.sp-banner__btn--light.button-popup:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  background-color: rgba(255, 255, 255, 0.9) !important;
  color: #131927 !important;
}

.sp-banner__btn--ghost {
  background: rgba(255, 255, 255, 0.2);
  color: #fff !important;
  backdrop-filter: blur(4px);
}

.sp-banner__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff !important;
}

.sp-banner__controls {
  position: absolute;
  left: 220px;
  right: 220px;
  bottom: 60px;
  z-index: 5;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  pointer-events: none;
}

.sp-banner__pagination,
.sp-banner__nav {
  pointer-events: auto;
}

.sp-banner__pagination {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  height: 4px;
}

.sp-banner__pagination .swiper-pagination-bullet {
  display: block;
  width: 8px;
  height: 4px;
  margin: 0 !important;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.4);
  opacity: 1;
  transition: width 0.2s ease, background 0.2s ease;
}

.sp-banner__pagination .swiper-pagination-bullet-active {
  width: 28px;
  background: rgba(255, 255, 255, 0.95);
}

.sp-banner__nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.sp-banner__arrow {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 52px;
  height: 52px;
  padding: 14px;
  border: 0;
  border-radius: 150px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.sp-banner__arrow:hover {
  background: rgba(255, 255, 255, 0.9);
}

.sp-banner__arrow:disabled {
  opacity: 0.5;
  cursor: default;
}

.sp-banner__arrow:disabled:hover {
  background: #fff;
}

.sp-banner__arrow svg {
  display: block;
  width: 24px;
  height: 24px;
}

/* Desktop only for now — legacy mobile banners can stay elsewhere later */
@media (max-width: 1439px) {
  .sp-banner__inner {
    padding: 40px 48px 112px;
  }

  html.sp-header-compact .sp-banner__inner {
    padding-top: 28px;
  }

  .sp-banner__controls {
    left: 48px;
    right: 48px;
    bottom: 48px;
  }

  .sp-banner__title {
    font-size: 48px;
  }
}

@media (max-width: 991px) {
  .sp-banner {
    margin-top: 12px;
    padding: 0 12px;
  }

  html.sp-header-compact .sp-banner {
    margin-top: 0;
  }

  .sp-banner__frame {
    height: 420px;
    border-radius: 20px;
  }

  .sp-banner__inner {
    padding: 32px 24px 100px;
  }

  .sp-banner__content {
    gap: 24px;
  }

  .sp-banner__copy {
    gap: 12px;
  }

  .sp-banner__title {
    font-size: 32px;
  }

  .sp-banner__text {
    font-size: 16px;
    line-height: 24px;
  }

  .sp-banner__controls {
    left: 24px;
    right: 24px;
    bottom: 24px;
  }

  .sp-banner__arrow {
    width: 44px;
    height: 44px;
    padding: 10px;
  }
}

/* Mobile — Figma: без стрелок, только пагинация снизу */
@media (max-width: 776px) {
  .sp-banner {
    margin-top: 16px;
    padding: 0 0 40px;
  }

  html.sp-header-compact .sp-banner {
    margin-top: 16px;
  }

  .sp-banner__frame {
    height: 620px;
    border-radius: 24px;
    overflow: hidden;
  }

  /* Swiper transform ломает скругление родителя — дублируем radius */
  .sp-banner__swiper,
  .sp-banner__swiper .swiper-wrapper,
  .sp-banner__slide,
  .sp-banner__picture,
  .sp-banner__media {
    border-radius: 24px;
  }

  .sp-banner__overlay {
    background: linear-gradient(
      360deg,
      rgba(0, 0, 0, 0.54) 26.03%,
      rgba(0, 0, 0, 0.457582) 53.5%,
      rgba(0, 0, 0, 0.383831) 57.47%,
      rgba(0, 0, 0, 0) 67.65%
    );
  }

  .sp-banner__inner {
    justify-content: flex-end;
    align-items: stretch;
    /* низ: padding 40 + точки 4 + gap 40 */
    padding: 240px 16px 84px;
  }

  html.sp-header-compact .sp-banner__inner {
    padding-top: 240px;
  }

  .sp-banner__content {
    width: 100%;
    max-width: none;
    gap: 24px;
  }

  .sp-banner__copy {
    gap: 16px;
  }

  .sp-banner__title {
    font-size: 32px;
    line-height: 40px;
  }

  .sp-banner__text {
    font-size: 14px;
    line-height: 20px;
    opacity: 1;
    -webkit-line-clamp: 4;
  }

  .sp-banner__actions {
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }

  .sp-banner__btn {
    flex: 0 0 auto;
    width: auto;
    min-width: auto;
    height: 44px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 400;
    font-size: 15px;
    line-height: 20px;
    white-space: nowrap;
  }

  .sp-banner__btn--light,
  a.sp-banner__btn--light.button-popup,
  .sp-banner a.sp-banner__btn--light.button-popup {
    width: auto;
    border-radius: 6px !important;
  }

  .sp-banner__controls {
    left: 16px;
    right: 16px;
    bottom: 40px;
    justify-content: center;
    gap: 0;
  }

  .sp-banner__nav {
    display: none;
  }

  .sp-banner__pagination {
    justify-content: center;
  }
}

/* When modern banner is present, hide legacy mainslider chrome leftovers */
body:has(.sp-banner) .mainslider > .mainslider_arrow_curcle,
body:has(.sp-banner) .mainslider > .mainslider_arrow_left,
body:has(.sp-banner) .mainslider > .mainslider_arrow_right {
  display: none !important;
}
