/* فرانت اسلایدر — وابسته به Swiper Bundle */

/* بحرانی: اگر swiper-bundle.css لود نشود، اسلایدها زیر هم نمی‌افتند */
.hpb-slider .swiper {
    overflow: hidden !important;
    position: relative;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 1;
    display: block;
}

.hpb-slider .swiper-wrapper {
    display: flex !important;
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition-property: transform;
    transition-timing-function: ease;
    box-sizing: content-box;
}

.hpb-slider .swiper-slide {
    flex-shrink: 0 !important;
    width: 100% !important;
    height: 100%;
    position: relative;
    display: block;
}

.hpb-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    direction: rtl;
    overflow: hidden;
    box-sizing: border-box;
}

.hpb-slider--arrows-outside,
.hpb-slider--arrows-sides {
    overflow: visible;
}

.hpb-slider *,
.hpb-slider *::before,
.hpb-slider *::after {
    box-sizing: border-box;
}

.hpb-slider__swiper {
    width: 100%;
    min-height: var(--hpb-slider-h, 380px);
    aspect-ratio: var(--hpb-slider-ratio, 16 / 9);
}

/* وقتی ارتفاع در تنظیمات ست شده، aspect-ratio آن را نادیده می‌گیرد */
.hpb-slider--has-height .hpb-slider__frame,
.hpb-slider--has-height .hpb-slider__swiper {
    aspect-ratio: unset;
    height: var(--hpb-slider-h);
    min-height: var(--hpb-slider-h);
}

.hpb-slider--has-height .hpb-slider__swiper.swiper {
    height: var(--hpb-slider-h);
}

.hpb-slider__swiper.swiper {
    overflow: hidden;
}

.hpb-slider .swiper-slide {
    height: auto;
    min-height: var(--hpb-slider-h, 380px);
}

.hpb-slider--has-height .swiper-slide,
.hpb-slider--has-height .hpb-slide,
.hpb-slider--has-height .hpb-slide__inner {
    height: var(--hpb-slider-h);
    min-height: var(--hpb-slider-h);
}

.hpb-slide {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

.hpb-slide__inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.hpb-slide__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: #1e293b;
    background-repeat: no-repeat;
}

/* دسکتاپ پیش‌فرض */
.hpb-slide__bg--desktop {
    display: block;
}

.hpb-slide__bg--tablet,
.hpb-slide__bg--mobile {
    display: none;
}

/* تبلت: ۷۶۸px تا ۱۰۲۴px */
@media (max-width: 1024px) {
    .hpb-slide--has-tablet-bg .hpb-slide__bg--desktop {
        display: none;
    }

    .hpb-slide--has-tablet-bg .hpb-slide__bg--tablet {
        display: block;
    }
}

/* موبایل: تا ۷۶۷px */
@media (max-width: 767px) {
    .hpb-slide--has-mobile-bg .hpb-slide__bg--desktop,
    .hpb-slide--has-mobile-bg .hpb-slide__bg--tablet {
        display: none;
    }

    .hpb-slide--has-mobile-bg .hpb-slide__bg--mobile {
        display: block;
    }

    .hpb-slide:not(.hpb-slide--has-mobile-bg).hpb-slide--has-tablet-bg .hpb-slide__bg--desktop {
        display: none;
    }

    .hpb-slide:not(.hpb-slide--has-mobile-bg).hpb-slide--has-tablet-bg .hpb-slide__bg--tablet {
        display: block;
    }
}

/* موبایل: ارتفاع جدا — مربع ۱:۱ یا ارتفاع اختصاصی (دسکتاپ نادیده گرفته می‌شود) */
@media (max-width: 767px) {
    .hpb-slider--mobile-square .hpb-slider__frame,
    .hpb-slider--mobile-square .hpb-slider__swiper,
    .hpb-slider--mobile-square .hpb-slider__swiper.swiper,
    .hpb-slider--mobile-square .swiper-slide,
    .hpb-slider--mobile-square .hpb-slide,
    .hpb-slider--mobile-square .hpb-slide__inner {
        aspect-ratio: 1 / 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .hpb-slider--mobile-square.hpb-slider--has-height .hpb-slider__frame,
    .hpb-slider--mobile-square.hpb-slider--has-height .hpb-slider__swiper,
    .hpb-slider--mobile-square.hpb-slider--has-height .hpb-slider__swiper.swiper,
    .hpb-slider--mobile-square.hpb-slider--has-height .swiper-slide,
    .hpb-slider--mobile-square.hpb-slider--has-height .hpb-slide,
    .hpb-slider--mobile-square.hpb-slider--has-height .hpb-slide__inner {
        height: auto !important;
        min-height: 0 !important;
    }

    .hpb-slider--has-height-mobile:not(.hpb-slider--mobile-square) .hpb-slider__frame,
    .hpb-slider--has-height-mobile:not(.hpb-slider--mobile-square) .hpb-slider__swiper,
    .hpb-slider--has-height-mobile:not(.hpb-slider--mobile-square) .hpb-slider__swiper.swiper,
    .hpb-slider--has-height-mobile:not(.hpb-slider--mobile-square) .swiper-slide,
    .hpb-slider--has-height-mobile:not(.hpb-slider--mobile-square) .hpb-slide,
    .hpb-slider--has-height-mobile:not(.hpb-slider--mobile-square) .hpb-slide__inner {
        aspect-ratio: unset !important;
        height: var(--hpb-slider-h-mobile) !important;
        min-height: var(--hpb-slider-h-mobile) !important;
    }

    .hpb-slider--mobile-hide-overlay .hpb-slide__title,
    .hpb-slider--mobile-hide-overlay .hpb-slide__caption,
    .hpb-slider--mobile-hide-overlay .hpb-slide__buttons {
        display: none !important;
    }
}

.hpb-slide__content-img {
    position: absolute;
    z-index: 1;
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    pointer-events: none;
}

.hpb-slide__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.hpb-slide__overlay .hpb-slide__buttons {
    pointer-events: auto;
}

.hpb-slide__title,
.hpb-slide__caption,
.hpb-slide__buttons {
    position: absolute;
    z-index: 3;
    margin: 0;
    padding: 0 16px;
    max-width: 92%;
    line-height: 1.35;
}

.hpb-slide__title {
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hpb-slide__caption {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.hpb-slide__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.hpb-slide__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* موقعیت ۹-گانه */
.hpb-pos--top-left { top: 10%; left: 6%; right: auto; bottom: auto; transform: none; }
.hpb-pos--top-center { top: 10%; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); }
.hpb-pos--top-right { top: 10%; right: 6%; left: auto; bottom: auto; transform: none; }
.hpb-pos--middle-left { top: 50%; left: 6%; right: auto; bottom: auto; transform: translateY(-50%); }
.hpb-pos--middle-center { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); }
.hpb-pos--middle-right { top: 50%; right: 6%; left: auto; bottom: auto; transform: translateY(-50%); }
.hpb-pos--bottom-left { bottom: 14%; left: 6%; top: auto; right: auto; }
.hpb-pos--bottom-center { bottom: 14%; left: 50%; top: auto; right: auto; transform: translateX(-50%); }
.hpb-pos--bottom-right { bottom: 14%; right: 6%; left: auto; top: auto; }

/* ناوبری Swiper */
.hpb-slider__arrow,
.hpb-slider .swiper-button-prev,
.hpb-slider .swiper-button-next {
    color: var(--hpb-nav-color, #fff) !important;
    width: var(--hpb-nav-size, 44px) !important;
    height: var(--hpb-nav-size, 44px) !important;
    background: var(--hpb-nav-bg, rgba(0, 0, 0, 0.4)) !important;
    border-radius: 50%;
    margin-top: 0 !important;
    top: 50% !important;
    transform: translateY(-50%);
}

.hpb-slider .swiper-button-prev::after,
.hpb-slider .swiper-button-next::after {
    font-size: 18px !important;
    font-weight: 700;
}

/* قاب اسلایدر + فلش خارج از باکس */
.hpb-slider__frame {
    position: relative;
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.hpb-slider__frame > .hpb-slider__swiper {
    flex: 1 1 auto;
    min-width: 0;
}

.hpb-slider--arrows-outside .hpb-slider__frame {
    padding: 0 calc(var(--hpb-nav-size, 44px) + 12px);
}

.hpb-slider--arrows-sides .hpb-slider__frame {
    padding: 0 calc(var(--hpb-nav-size, 44px) + 28px);
}

.hpb-slider__arrow--outside {
    position: relative !important;
    flex: 0 0 var(--hpb-nav-size, 44px);
    align-self: center;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none;
    z-index: 12;
}

.hpb-slider--arrows-outside .hpb-slider__arrow--outside.swiper-button-prev,
.hpb-slider--arrows-sides .hpb-slider__arrow--outside.swiper-button-prev {
    order: 0;
    margin-inline-end: 8px;
}

.hpb-slider--arrows-outside .hpb-slider__arrow--outside.swiper-button-next,
.hpb-slider--arrows-sides .hpb-slider__arrow--outside.swiper-button-next {
    order: 2;
    margin-inline-start: 8px;
}

.hpb-slider--arrows-outside .hpb-slider__swiper,
.hpb-slider--arrows-sides .hpb-slider__swiper {
    order: 1;
}

/* صفحه‌بندی — بیرون از swiper تا clip نشود */
.hpb-slider--pagination-on {
    padding-bottom: 44px;
}

.hpb-slider__pagination.swiper-pagination {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 10px !important;
    width: 100% !important;
    z-index: 15;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: auto;
}

.hpb-slider--pag-progressbar {
    padding-bottom: 28px;
}

.hpb-slider--pag-progressbar .hpb-slider__pagination.swiper-pagination-progressbar {
    top: auto !important;
    height: 4px !important;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.hpb-slider--pag-progressbar .swiper-pagination-progressbar-fill {
    background: var(--hpb-dot-active, #0d6efd) !important;
}

.hpb-slider--pag-fraction .hpb-slider__pagination.swiper-pagination-fraction {
    color: var(--hpb-dot-color, #fff);
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.hpb-slider--pag-bullets .hpb-slider__pagination .swiper-pagination-bullet {
    width: var(--hpb-dot-size, 10px);
    height: var(--hpb-dot-size, 10px);
    background: var(--hpb-dot-color, #fff);
    opacity: 0.55;
    margin: 0 4px !important;
}

.hpb-slider--pag-bullets .hpb-slider__pagination .swiper-pagination-bullet-active {
    background: var(--hpb-dot-active, #0d6efd);
    opacity: 1;
}

.hpb-dots--square .swiper-pagination-bullet {
    border-radius: 2px;
}

.hpb-dots--bar .swiper-pagination-bullet {
    width: calc(var(--hpb-dot-size, 10px) * 2.5);
    border-radius: 3px;
}

.hpb-slider--nav-beside_dots .hpb-slider__frame {
    padding-bottom: 8px;
}

.hpb-slider--nav-beside_dots.hpb-slider--pagination-on {
    padding-bottom: 52px;
}
