/**
 * Home V2 — override استایل HPB (بعد از ماژول‌ها)
 */

.crafto-home .hpb-module {
    margin: 0 !important;
    padding: 0 !important;
}

/* فقط گرید دسته‌ها — cols کاروسل از inline style خودش (جلوگیری از shift 5→8) */
.crafto-categories .hpb-grid {
    --hpb-gap: 6px !important;
}

.crafto-products .hpb-carousel {
    --hpb-gap: 16px !important;
    --hpb-cols: 5 !important;
    --hpb-cols-tablet: 3 !important;
    --hpb-cols-mobile: 2 !important;
}

.crafto-news .hpb-carousel {
    --hpb-gap: 16px !important;
    --hpb-cols: 4 !important;
    --hpb-cols-tablet: 2 !important;
    --hpb-cols-mobile: 1 !important;
}

.crafto-home .hpb-grid:not(.crafto-categories .hpb-grid) {
    --hpb-gap: 14px !important;
}

.crafto-home .hpb-carousel__frame,
.crafto-home .hpb-carousel__swiper {
    padding: 0 !important;
}

.crafto-home .crafto-products .hpb-card,
.crafto-home .crafto-news .hpb-post-card,
.crafto-home .crafto-products .hamta-product-card,
.crafto-home .crafto-products .hpb-product-loop.product-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: hidden;
    height: 100%;
}

.crafto-home .hpb-card__body,
.crafto-home .hamta-product-card .product-info {
    padding: 10px 12px 12px !important;
}

.crafto-home .hpb-post-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: #fff !important;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.crafto-home .hpb-post-card .hpb-card__body {
    flex: 1;
}

.crafto-home .hpb-module-title {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
    padding: 0 !important;
}

.crafto-home .hpb-module-title__heading {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    color: #0a3578 !important;
}

.crafto-home .hpb-module-title__link {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #0d48a2 !important;
    white-space: nowrap;
}

.crafto-home .hpb-carousel .swiper-button-prev,
.crafto-home .hpb-carousel .swiper-button-next {
    display: flex !important;
    width: 38px !important;
    height: 38px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* progress — فقط محصولات */
.crafto-products .hpb-carousel__pagination,
.crafto-products .swiper-pagination-progressbar {
    display: block !important;
    visibility: visible !important;
    height: 3px !important;
    margin-top: 10px !important;
    background: #e2e8f0 !important;
}

.crafto-products .swiper-pagination-progressbar-fill {
    background: #0d48a2 !important;
}

/* اخبار — حذف نوار progress بالای کارت‌ها */
.crafto-news-block .hpb-carousel__pagination,
.crafto-news-block .swiper-pagination-progressbar,
.crafto-news-block .hpb-mega-top-arrow-pagination,
.crafto-news-block .hpb-carousel__progress-nav,
.crafto-news .hpb-carousel__pagination,
.crafto-news .swiper-pagination-progressbar,
.crafto-news .hpb-mega-top-arrow-pagination,
.crafto-news .hpb-carousel__progress-nav {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    border: none !important;
}

.crafto-news-block .hpb-carousel--pag-progressbar,
.crafto-news-block .hpb-carousel--pagination-on,
.crafto-news .hpb-carousel--pag-progressbar,
.crafto-news .hpb-carousel--pagination-on {
    padding-bottom: 0 !important;
}

.crafto-news-block .hpb-carousel__swiper,
.crafto-news .hpb-carousel__swiper {
    padding-bottom: 0 !important;
}

.crafto-categories .hpb-module-title,
.crafto-products .hpb-module-title {
    display: none !important;
}

/* محصولات — تب‌ها و «مشاهده همه» کافی است؛ عنوان/لینک تکراری کاروسل مگا */
.crafto-products .hpb-mega-top-arrow-header__title,
.crafto-products .hpb-mega-top-arrow-link {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.crafto-products .hpb-mega-top-arrow-header {
    margin-bottom: 8px !important;
    min-height: 0 !important;
}

.crafto-products .hpb-mega-top-arrow-header__tools {
    margin-inline-start: auto;
}

.crafto-home .hpb-grid__cell img,
.crafto-home .hpb-grid__item .hpb-card__image img,
.crafto-home .hpb-grid__item img {
    max-width: 100%;
    height: auto;
}

.crafto-home .container.p-0,
.crafto-home .container.my-2 {
    padding: 0 !important;
    margin: 0 !important;
}

.crafto-products .hpb-carousel .swiper-slide {
    height: auto;
}

.crafto-products .hamta-product-card .product-title,
.crafto-products .hpb-product-loop .product-title,
.crafto-products .hamta-product-card .product-title a,
.crafto-products .hpb-product-loop .product-title a {
    font-size: 12px !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crafto-products .hamta-product-card .product-price,
.crafto-products .hpb-product-loop .product-price,
.crafto-products .hamta-product-card .price,
.crafto-products .hpb-product-loop .price {
    display: flex !important;
    width: 100% !important;
    color: #000 !important;
    font-weight: 400 !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 6px !important;
}

.crafto-products .hamta-product-card .product-price:has(.original-price) .original-price,
.crafto-products .hpb-product-loop .product-price:has(.original-price) .original-price {
    order: 1 !important;
}

.crafto-products .hamta-product-card .product-price:has(.original-price) .current-price,
.crafto-products .hpb-product-loop .product-price:has(.original-price) .current-price {
    order: 2 !important;
    margin-inline-start: auto !important;
}

.crafto-products .hamta-product-card .product-price:has(.original-price) .product-badge-org,
.crafto-products .hpb-product-loop .product-price:has(.original-price) .product-badge-org {
    order: 3 !important;
    position: static !important;
    inset: auto !important;
}

.crafto-products .hamta-product-card .product-price .current-price {
    color: #000 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
}

.crafto-products .hamta-product-card .product-price .current-price .price-amount {
    font-weight: 800 !important;
    color: #000 !important;
}

.crafto-products .hamta-product-card .product-price .current-price .price-currency {
    font-weight: 400 !important;
    color: #000 !important;
}

.crafto-products .hamta-product-card .product-price .original-price {
    color: #c62828 !important;
    text-decoration: line-through !important;
    text-decoration-color: #b71c1c !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.crafto-news .hpb-post-card__badge,
.crafto-news .hpb-card__badge {
    background: #0d48a2 !important;
    border-radius: 6px !important;
}

/* ─── Home V2 موبایل — چیدمان فشرده وب‌اپ ─── */
@media (max-width: 991.98px) {
    body.hpb-home-v2 {
        background: #fff !important;
    }

    .crafto-home {
        --h-gap: 8px;
        --h-pad: 0;
        padding: 0 0 8px;
        gap: 8px;
    }

    .crafto-categories .hpb-grid__inner {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 6px !important;
        grid-template-columns: unset !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .crafto-categories .hpb-grid__inner::-webkit-scrollbar {
        display: none;
    }

    .crafto-categories .hpb-grid__item {
        flex: 0 0 clamp(72px, 16vw, 92px) !important;
        scroll-snap-align: start;
        grid-column: unset !important;
        grid-row: unset !important;
        min-width: 0;
    }

    .crafto-categories .hpb-grid__item > .hpb-card,
    .crafto-categories .hpb-grid__item > a {
        padding: 5px 3px !important;
    }

    .crafto-categories .hpb-card__title {
        font-size: 0.58rem !important;
        line-height: 1.25 !important;
    }

    .crafto-categories .hpb-card__body {
        padding: 2px 3px 4px !important;
    }

    .crafto-categories .hpb-card__image {
        max-height: 42px !important;
        aspect-ratio: 1 / 1 !important;
    }

    .crafto-categories .hpb-card__image img {
        max-height: 36px !important;
    }

    .crafto-home .crafto-products .hpb-carousel__swiper,
    .crafto-home .crafto-news .hpb-carousel__swiper,
    .crafto-home .crafto-partners .hpb-carousel__swiper {
        min-height: 0 !important;
        contain: none !important;
    }

    .crafto-home .crafto-products .hpb-carousel__slide,
    .crafto-home .crafto-news .hpb-carousel__slide {
        min-height: 0 !important;
        height: auto !important;
    }

    .crafto-home .hpb-carousel__swiper:not(.swiper-initialized) .swiper-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .crafto-products__header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .crafto-products__tabs {
        width: auto;
        justify-content: flex-start;
    }

    .crafto-view-all {
        display: inline-flex;
        align-items: center;
        margin-inline-start: auto;
        text-align: start;
        white-space: nowrap;
    }

    .crafto-consult__showcase {
        padding: 18px 14px;
    }

    .crafto-consult__layout {
        gap: 14px;
    }

    .crafto-home .hpb-module-title__heading {
        font-size: 0.92rem !important;
    }

    .crafto-home .hpb-module-title__link {
        font-size: 0.78rem !important;
    }

    .crafto-products .hamta-product-card .product-title,
    .crafto-products .hpb-product-loop .product-title,
    .crafto-products .hamta-product-card .product-title a,
    .crafto-products .hpb-product-loop .product-title a {
        font-size: 12px !important;
        font-weight: 400 !important;
    }

    .crafto-products .hamta-product-card .product-price,
    .crafto-products .hpb-product-loop .product-price,
    .crafto-products .hamta-product-card .price,
    .crafto-products .hpb-product-loop .price {
        font-size: 12px !important;
        font-weight: 400 !important;
        color: #000 !important;
        white-space: nowrap !important;
    }

    .crafto-promo-banners__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .crafto-promo-banner--large {
        grid-column: 1 / -1 !important;
    }

    .crafto-promo-banner--compact .crafto-promo-banner__body h3 {
        font-size: 0.8rem !important;
    }

    .crafto-newsletter-wrap {
        margin-bottom: 16px;
    }
}

/* اسلایدر هیرو — فقط موبایل واقعی (نه تبلت/دسکتاپ) */
@media (max-width: 767px) {
    .crafto-hero .hpb-slider,
    .crafto-hero .hpb-slider .hpb-slider__swiper,
    .crafto-hero .hpb-slider__frame {
        min-height: 0 !important;
        aspect-ratio: unset !important;
        height: auto !important;
    }

    .crafto-hero .hpb-slider--has-height .hpb-slider__frame,
    .crafto-hero .hpb-slider--has-height .hpb-slider__swiper,
    .crafto-hero .hpb-slider--has-height .swiper-slide,
    .crafto-hero .hpb-slider--has-height .hpb-slide,
    .crafto-hero .hpb-slider--has-height .hpb-slide__inner {
        aspect-ratio: unset !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .crafto-hero .hpb-slider--pagination-on,
    .crafto-hero .hpb-slider--nav-beside_dots.hpb-slider--pagination-on,
    .crafto-hero .hpb-slider--pag-progressbar {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .crafto-hero .hpb-slider .swiper-button-prev,
    .crafto-hero .hpb-slider .swiper-button-next,
    .crafto-hero .hpb-slider__arrow {
        position: absolute !important;
        top: 50% !important;
        bottom: auto !important;
        margin: 0 !important;
        transform: translateY(-50%) !important;
        z-index: 20;
    }

    .crafto-hero .hpb-slider .swiper-button-prev,
    .crafto-hero .hpb-slider__arrow--prev {
        right: 8px !important;
        left: auto !important;
    }

    .crafto-hero .hpb-slider .swiper-button-next,
    .crafto-hero .hpb-slider__arrow--next {
        left: 8px !important;
        right: auto !important;
    }

    .crafto-home .hpb-slider,
    .crafto-home .hpb-slider .hpb-slider__swiper {
        min-height: 0 !important;
    }
}

/* صفحه /loan-plans/ — سطر و ستون صفحه‌ساز */
main[data-page-key="wp_43482"] {
    --lp-ink: #1e293b;
    --lp-muted: #475569;
    --lp-brand: #812990;
    --lp-soft: #f7f3f9;
    padding-bottom: 12px;
}

main[data-page-key="wp_43482"] > .crafto-content-block {
    padding: 20px 16px 0;
}

main[data-page-key="wp_43482"] .crafto-content-block__inner {
    max-width: none;
}

main[data-page-key="wp_43482"] .crafto-content-block__title {
    margin: 0 0 4px;
    font-size: clamp(1.4rem, 2.5vw, 1.95rem);
    font-weight: 800;
    line-height: 1.5;
    color: var(--lp-ink);
    text-align: right;
}

main[data-page-key="wp_43482"] .hpb-colsrow-section {
    padding: 10px 16px;
}

main[data-page-key="wp_43482"] .hpb-colsrow__col {
    color: var(--lp-muted);
    font-size: 1rem;
    line-height: 1.95;
}

main[data-page-key="wp_43482"] .hpb-lp-lead {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--lp-ink);
    margin: 0 0 0.85rem;
}

main[data-page-key="wp_43482"] .hpb-lp-box {
    height: 100%;
    background: var(--lp-soft);
    border: 1px solid rgba(129, 41, 144, 0.1);
    border-radius: 16px;
    padding: 16px 18px;
}

main[data-page-key="wp_43482"] .hpb-lp-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    min-height: 160px;
}

main[data-page-key="wp_43482"] .hpb-lp-icons img,
main[data-page-key="wp_43482"] .hpb-lp-ico {
    width: 64px;
    height: 64px;
    display: block;
}

main[data-page-key="wp_43482"] > .crafto-partners {
    padding: 4px 16px 8px;
}

main[data-page-key="wp_43482"] .crafto-partners .hpb-module-title {
    margin-bottom: 8px !important;
}

main[data-page-key="wp_43482"] .crafto-partners .hpb-module-title__link {
    display: none !important;
}

main[data-page-key="wp_43482"] > .crafto-section:has(.hpb-cta) {
    padding: 0 16px 12px;
}

main[data-page-key="wp_43482"] .hpb-cta--layout-bank-offers-list,
main[data-page-key="wp_43482"] .hpb-cta--layout-newsletter-contact {
    padding-top: 8px !important;
    padding-bottom: 12px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible;
}

main[data-page-key="wp_43482"] .hpb-cta__inner {
    max-width: none;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offers-search {
    margin-bottom: 14px;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas: "logo content" "btn btn";
    align-items: start;
    gap: 10px 14px;
    padding: 14px;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer__logo {
    grid-area: logo;
    width: 72px;
    height: 72px;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer__content {
    grid-area: content;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer__action {
    grid-area: btn;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer__btn {
    display: flex;
    width: 100%;
    justify-content: center;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer-row__logo {
    width: 72px;
    height: 72px;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer-row__card {
    padding: 16px 16px 58px;
    min-height: 0;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer-row__fields {
    grid-template-columns: 1fr 1fr;
}

main[data-page-key="wp_43482"] .hpb-cta-bank-offer-row__btn,
main[data-page-key="wp_43482"] .hpb-cta-bank-offer-row__btn:hover,
main[data-page-key="wp_43482"] .hpb-cta-bank-offer-row__btn:focus {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 12px;
    transform: none;
    min-width: 0;
    width: auto;
}

@media (max-width: 767.98px) {
    main[data-page-key="wp_43482"] > .crafto-content-block {
        padding: 16px 12px 0;
    }

    main[data-page-key="wp_43482"] .crafto-content-block__title {
        font-size: 1.28rem;
    }

    main[data-page-key="wp_43482"] .hpb-cta-bank-offers {
        grid-template-columns: 1fr;
    }

    main[data-page-key="wp_43482"] .hpb-lp-icons {
        min-height: 0;
        flex-direction: row;
        justify-content: center;
        padding: 4px 0 8px;
    }
}
