/* Hero Banner — фронт (Swiper upstream integration) */

.hero-banner {
  --hero-dur: 6500ms;
  position: relative;
  width: 100%;
  aspect-ratio: 1984 / 800;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 0;
  outline: none;
}

/* Theme styles must not leak into the carousel controls or slide content. */
.hero-banner,
.hero-banner *,
.hero-banner *::before,
.hero-banner *::after {
  box-sizing: border-box;
}

.hero-banner a,
.hero-banner button,
.hero-banner img,
.hero-banner strong,
.hero-banner span {
  font-family: inherit;
}

.hero-banner.swiper {
  position: relative;
  list-style: none;
  padding: 0;
  z-index: 1;
  display: block;
}

.hero-banner .swiper-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  transition-property: transform;
  box-sizing: content-box;
}

.hero-banner .swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
  transition-property: transform, opacity;
  display: block;
  overflow: hidden;
}

.hero-banner .hero-banner__slide {
  color: inherit;
  text-decoration: none;
}

.hero-banner__img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: unset;
  object-fit: cover;
  object-position: center center;
  border: 0 !important;
  border-radius: 0 !important;
}

/* Скрим под текст справа — товар всегда в левой половине */
.hero-banner__slide--with-text::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(270deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .62) 36%, rgba(255, 255, 255, 0) 58%);
  pointer-events: none;
}

/* Текстовый слой в правой пустой половине */
.hero-banner__copy {
  position: absolute;
  z-index: 2;
  left: auto;
  right: 5.5%;
  top: 50%;
  transform: translateY(-50%);
  width: 42%;
  max-width: 42%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  color: #171717;
}

.hero-banner__badge {
  padding: .32rem .8rem;
  border-radius: 99px;
  background: #171717;
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero-banner__title {
  font-size: clamp(1.15rem, 2.2vw, 2.15rem);
  line-height: 1.15;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-banner__subtitle {
  font-size: clamp(.85rem, 1.25vw, 1.25rem);
  line-height: 1.35;
  color: #3f3f46;
}

.hero-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .35rem;
  padding: .55rem 1.1rem;
  border-radius: 99px;
  background: #171717;
  color: #fff !important;
  font-size: clamp(.75rem, .9vw, .95rem);
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.hero-banner__cta svg { flex: 0 0 auto; }

.hero-banner__slide:hover .hero-banner__cta {
  background: #000;
  transform: translateX(2px);
}

.hero-banner .swiper-button-prev,
.hero-banner .swiper-button-next {
  all: unset;
  position: absolute;
  z-index: 10;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  color: #171717;
  cursor: pointer;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .16);
  opacity: .9;
  transition: background .2s ease, opacity .2s ease, color .2s ease;
}

.hero-banner .swiper-button-prev,
.hero-banner .swiper-button-next {
  box-sizing: border-box;
  color: #171717;
  font: inherit;
  line-height: 1;
}

.hero-banner .swiper-button-prev svg,
.hero-banner .swiper-button-next svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.hero-banner .swiper-button-prev::after,
.hero-banner .swiper-button-next::after {
  display: none;
}

.hero-banner .swiper-button-prev { left: .7rem; }
.hero-banner .swiper-button-next { right: .7rem; }

.hero-banner:hover .swiper-button-prev,
.hero-banner:hover .swiper-button-next {
  opacity: 1;
}

.hero-banner .swiper-button-prev:hover,
.hero-banner .swiper-button-next:hover {
  background: rgba(255, 255, 255, .85);
  color: #171717;
}

.hero-banner .swiper-button-prev:focus-visible,
.hero-banner .swiper-button-next:focus-visible,
.hero-banner__bar:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 2px;
}

/* Прогресс-бары / пагинация */
.hero-banner .swiper-pagination.hero-banner__progress {
  position: absolute;
  z-index: 10;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  width: auto;
}

.hero-banner button.hero-banner__bar {
  all: unset;
  position: relative;
  box-sizing: border-box;
  flex: 0 0 34px !important;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 4px !important;
  min-height: 4px !important;
  max-height: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 99px !important;
  background: rgba(23, 23, 23, .22) !important;
  box-shadow: none !important;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.75;
  font-size: 0 !important;
  line-height: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.hero-banner button.hero-banner__bar.is-active,
.hero-banner button.hero-banner__bar.swiper-pagination-bullet-active {
  opacity: 1;
  flex-basis: 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
}

.hero-banner__bar-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #171717;
  transform: scaleX(0);
  transform-origin: left;
}

.hero-banner__bar.is-run .hero-banner__bar-fill {
  animation: hero-banner-fill var(--hero-dur) linear forwards;
}

/* Woodmart applies button and Swiper rules globally; keep its branch explicit. */
.hero-banner--theme-woodmart .swiper-button-prev,
.hero-banner--theme-woodmart .swiper-button-next,
.hero-banner--theme-woodmart button.hero-banner__bar {
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
}

.hero-banner--theme-woodmart button.hero-banner__bar {
  flex: 0 0 34px !important;
}

.hero-banner.is-paused .hero-banner__bar-fill {
  animation-play-state: paused;
}

@keyframes hero-banner-fill {
  to { transform: scaleX(1); }
}

/* Мобильные адаптации */
@media (max-width: 768px) {
  .hero-banner {
    aspect-ratio: 1984 / 800;
  }

  .hero-banner__copy {
    left: auto;
    right: 4.5%;
    width: 46%;
    max-width: 46%;
    gap: .4rem;
  }

  .hero-banner__cta {
    padding: .45rem .9rem;
    font-size: .8rem;
  }

  .hero-banner .swiper-button-prev,
  .hero-banner .swiper-button-next {
    width: 38px;
    height: 38px;
  }

  .hero-banner .swiper-button-prev svg,
  .hero-banner .swiper-button-next svg {
    width: 19px;
    height: 19px;
  }

  .hero-banner .swiper-button-prev { left: .4rem; }
  .hero-banner .swiper-button-next { right: .4rem; }

  .hero-banner button.hero-banner__bar {
    flex-basis: 24px !important;
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
  }
  .hero-banner button.hero-banner__bar.is-active,
  .hero-banner button.hero-banner__bar.swiper-pagination-bullet-active {
    flex-basis: 32px !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }
}

@media (max-width: 640px) {
  .hero-banner {
    aspect-ratio: 16 / 9;
    min-height: 220px;
  }

  .hero-banner__img {
    object-position: 18% center;
  }

  /* Готовый баннер содержит текст внутри изображения: сохраняем левую часть. */
  .hero-banner__slide--ready .hero-banner__img {
    object-position: left center;
  }

  .hero-banner__slide--with-text::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, .35) 100%);
  }

  .hero-banner__copy {
    left: 5%;
    right: 5%;
    width: auto;
    max-width: none;
    top: auto;
    bottom: 1.7rem;
    transform: none;
    padding: .5rem .7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    gap: .2rem;
  }

  .hero-banner__title {
    font-size: 1rem;
    line-height: 1.22;
    -webkit-line-clamp: 2;
  }

  .hero-banner__subtitle {
    font-size: .8rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-banner__cta {
    display: none;
  }

  .hero-banner .swiper-button-prev,
  .hero-banner .swiper-button-next {
    display: none;
  }

  .hero-banner .swiper-pagination.hero-banner__progress {
    bottom: .45rem;
  }

  .hero-banner button.hero-banner__bar {
    flex-basis: 18px !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
  }
  .hero-banner button.hero-banner__bar.is-active,
  .hero-banner button.hero-banner__bar.swiper-pagination-bullet-active {
    flex-basis: 26px !important;
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-banner .swiper-slide { transition: none !important; }
  .hero-banner__bar.is-run .hero-banner__bar-fill {
    animation: none;
    transform: scaleX(1);
  }
}
