/*!
 * abp_slider 1.1.0 — стилі слайдера (підключає контролер модуля: document->addStyle, версія в імені файлу).
 * Основа — css/abp_slider.css джерела (abplanalp.ua, зібрано з _abp_slider.scss). Зміни 1.1.0 (#D43):
 *   — кольори теми — CSS-змінні з запасними значеннями abplanalp.ua (тема Deals має власні змінні --ds-*):
 *       --abp-slider-c-primary  = var(--ds-primary-color, #CC3F43)   (заповнення активної смужки, hover стрілки, рамка фокусу)
 *       --abp-slider-c-text     = var(--ds-dark-text-color, #212121) (колір стрілки)
 *       --abp-slider-c-bg       = var(--ds-border-color, #F0F0F0)    (фон сцени, поки зображення не завантажилось)
 *     межа «телефон» 767.98px (Bootstrap 5 md у темі Deals; у джерелі 767.9px — $md abplanalp.ua);
 *   — обгортка content_top: #content (OpenCart default) або #common-home (головна теми Deals) — стають position: static;
 *   — тривалість переходу — --abp-slider-speed (налаштування «Тривалість переходу, мс»; у джерелі було 0.6s);
 *   — іконки стрілок: Font Awesome (.fas, 16 px як в abplanalp.ua) або вбудований SVG (.abp-slider__icon, шаблон теми Deals).
 * Розміри слайдера (висота десктоп/мобайл, межа) — НЕ тут: їх задає адмінка, шаблон кладе їх у custom properties
 * (--abp-slider-h, -h-m, -bp і числами -hn, -hn-m, -bpn). 1920 у формулах — ширина десктопного зображення
 * (те саме число — IMAGE_WIDTH_DESKTOP в admin/controller/extension/module/abp_slider.php).
 */
#content:has(> .abp-slider),
#common-home:has(> .abp-slider) {
  position: static;
}
.abp-slider {
  --abp-slider-c-primary: var(--ds-primary-color, #CC3F43);
  --abp-slider-c-text: var(--ds-dark-text-color, #212121);
  --abp-slider-c-bg: var(--ds-border-color, #F0F0F0);
  --abp-slider-vw: var(--abp-slider-w, 100vw);
  --abp-slider-sw-d: calc((100vw - var(--abp-slider-bp, 768px) + 0.02px) * 100000);
  --abp-slider-sw-m: calc((var(--abp-slider-bp, 768px) - 100vw) * 100000);
  --abp-slider-hd: min(calc(var(--abp-slider-vw) * var(--abp-slider-hn, 560) / 1920 /* ширина десктопного зображення = $abp-slider-img-w = IMAGE_WIDTH_DESKTOP */), var(--abp-slider-h, 560px));
  --abp-slider-hm: calc(var(--abp-slider-vw) * 2 * var(--abp-slider-hn-m, 420) / var(--abp-slider-bpn, 768));
  --abp-slider-hh: max(min(var(--abp-slider-hd), var(--abp-slider-sw-d)), min(var(--abp-slider-hm), var(--abp-slider-sw-m)));
  --abp-slider-pt: max(min(calc(var(--abp-slider-hn, 560) / 1920 /* те саме 1920 */ * 100%), var(--abp-slider-sw-d)), min(calc(2 * var(--abp-slider-hn-m, 420) / var(--abp-slider-bpn, 768) * 100%), var(--abp-slider-sw-m)));
  --abp-slider-cap: max(min(var(--abp-slider-h, 560px), var(--abp-slider-sw-d)), var(--abp-slider-sw-m));
  height: var(--abp-slider-hh);
}
.abp-slider__stage {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  max-height: var(--abp-slider-cap);
  overflow: hidden;
  background-color: var(--abp-slider-c-bg);
}
.abp-slider__stage:before {
  content: "";
  display: block;
  padding-top: var(--abp-slider-pt);
}
.abp-slider__track {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  touch-action: pan-y;
  transition: transform var(--abp-slider-speed, 600ms) ease;
}
@media (prefers-reduced-motion: reduce) {
  .abp-slider__track {
    transition: none;
  }
}
.abp-slider__slide {
  flex: 0 0 100%;
  height: 100%;
}
.abp-slider__link, .abp-slider__picture {
  display: block;
  height: 100%;
}
.abp-slider__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
}
.abp-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.85);
  color: var(--abp-slider-c-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background-color 0.25s ease, color 0.25s ease;
}
.abp-slider__arrow .fas {
  font-size: 16px;
}
.abp-slider__icon {
  display: block;
  width: 16px;
  height: 16px;
}
.abp-slider__arrow:hover {
  background-color: #fff;
  color: var(--abp-slider-c-primary);
}
.abp-slider__arrow:focus {
  outline: 0;
}
.abp-slider__arrow:focus-visible {
  outline: 2px solid var(--abp-slider-c-primary);
  outline-offset: 2px;
}
.abp-slider__arrow--prev {
  left: 16px;
}
.abp-slider__arrow--next {
  right: 16px;
}
@media (max-width: 767.98px) {
  .abp-slider__arrow {
    width: 32px;
    height: 32px;
    margin-top: -16px;
    font-size: 13px;
    background-color: rgba(255, 255, 255, 0.75);
  }
  .abp-slider__arrow--prev {
    left: 8px;
  }
  .abp-slider__icon {
    width: 12px;
    height: 12px;
  }
  .abp-slider__arrow--next {
    right: 8px;
  }
}
.abp-slider__dots {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  z-index: 2;
  display: flex;
  gap: 0.5rem;
  transform: translateX(-50%);
}
@media (max-width: 767.98px) {
  .abp-slider__dots {
    bottom: 0.75rem;
  }
}
.abp-slider__dot {
  position: relative;
  display: block;
  width: 48px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.abp-slider__dot:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 4px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
.abp-slider__dot:focus {
  outline: 0;
}
.abp-slider__dot:focus-visible {
  outline: 2px solid var(--abp-slider-c-primary);
  outline-offset: 2px;
}
@media (max-width: 767.98px) {
  .abp-slider__dot {
    width: 32px;
  }
}
.abp-slider__dot-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 4px;
  border-radius: 2px;
  background-color: var(--abp-slider-c-primary);
  transform: scaleX(0);
  transform-origin: left center;
}
.abp-slider__dot.is-active .abp-slider__dot-fill {
  transform: scaleX(1);
}
.abp-slider.is-ready .abp-slider__dot.is-active .abp-slider__dot-fill {
  animation: abp-slider-fill var(--abp-slider-interval, 5s) linear forwards;
}
.abp-slider.is-paused .abp-slider__dot.is-active .abp-slider__dot-fill {
  animation-play-state: paused;
}
@keyframes abp-slider-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
