/**
 * استایل‌های اختصاصی ماژول اسلایدر و بنرهای کناری هیروسکشن (سکشن ۲)
 * طراحی مدرن، بنرهای کناری مربعی ۱ در ۱، فواصل دقیق ۲.۵ رِم و کانتینر استاندارد ۱۲۳۰ پیکسل
 *
 * @package RPKala_Toolkit
 * @since   1.0.0
 */

:root {
    --rp-hero-container-width: 1230px;
    --rp-hero-primary: #23437c;
    --rp-hero-primary-dark: #032c64;
    --rp-hero-radius: 1.5rem;         /* ۲۴ پیکسل شعاع گوشه مدرن هماهنگ با طرح */
    --rp-hero-side-size: 200px;       /* ابعاد دقیق بنرهای مربعی ۱ در ۱ (۲۰۰ × ۲۰۰ پیکسل) */
    --rp-hero-gap: 1.5rem;            /* فاصله افقی بین اسلایدر و بنرها (۲۴ پیکسل) */
    --rp-hero-banner-gap: 1.25rem;    /* فاصله عمودی بین دو بنر مربعی (۲۰ پیکسل) */
    /* ارتفاع کل هیروسکشن: دقیقاً برابر با مجموع ارتفاع ۲ بنر مربعی + فاصله بین آن‌ها (۴۲۰ پیکسل) */
    --rp-hero-height: calc((var(--rp-hero-side-size) * 2) + var(--rp-hero-banner-gap));
    --rp-hero-font: 'iransansx', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* اعمال استاندارد باکس سایزینگ و ریست فونت */
.rp-hero-section,
.rp-hero-section * {
    box-sizing: border-box !important;
    font-family: var(--rp-hero-font) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   ۱. کانتینر اصلی سکشن ۲ هیرو در صفحه اصلی (فاصله ۲.۵ رِم و تراز ۱۲۳۰ پیکسل)
   ========================================================================== */
.rp-hero-section {
    width: 100%;
    margin-top: 0 !important;
    margin-bottom: 2.5rem !important; /* فاصله استاندارد ۲.۵ رِم بین سکشن‌ها */
    position: relative;
    z-index: 4;
    direction: rtl !important;
}

/* کانتینر استاندارد ۱۲۳۰ پیکسل - تراز دقیق بدون پدینگ چپ و راست در دسکتاپ */
.rp-hero-container {
    width: 100%;
    max-width: var(--rp-hero-container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ==========================================================================
   ۲. چیدمان گرید ستونی (اسلایدر در راست + بنرهای مربعی ۱:۱ در چپ)
   ========================================================================== */
.rp-hero-grid {
    width: 100%;
    display: grid;
    align-items: stretch;
}

/* در حالت RTL ستون اول (اسلایدر) در سمت راست قرار می‌گیرد و ستون دوم (بنرهای مربعی) در چپ */
.rp-hero-grid.has-side-banners {
    grid-template-columns: 1fr var(--rp-hero-side-size);
    gap: var(--rp-hero-gap);
}

/* در صورت عدم وجود بنرهای کناری، اسلایدر تمام عرض ۱۲۳۰px را می‌گیرد */
.rp-hero-grid.slider-only {
    grid-template-columns: 1fr;
}

/* ==========================================================================
   ۳. اسلایدر اصلی هیرو (ستون راست)
   ========================================================================== */
.rp-hero-slider-wrap {
    width: 100%;
    height: var(--rp-hero-height);
    position: relative;
}

.rp-hero-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--rp-hero-radius);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    background: linear-gradient(135deg, #021838 0%, #0b3366 50%, #1c4b8b 100%);
    box-shadow: 0 10px 25px -5px rgba(2, 24, 56, 0.12), 0 8px 10px -6px rgba(2, 24, 56, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* تِرَک نگهدارنده اسلایدها با جلوگیری از پرش و تغییر ابعاد (Zero CLS) */
.rp-hero-slider-track {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* هر اسلاید با ترنزیشن نرم Fade */
.rp-hero-slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s ease;
    z-index: 1;
}

.rp-hero-slide.is-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 2 !important;
}

/* تگ لینک سراسری کلیک بنر */
.rp-hero-slide-link {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    text-decoration: none !important;
    outline: none !important;
    cursor: pointer;
}

/* تصویر بنر اسلایدر: بدون کشیدگی و پر کننده کامل */
.rp-hero-slide-img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    transform: none !important;
}

/* غیرفعال‌سازی بزرگ‌نمایی تصویر اسلایدر اصلی در حالت هاور طبق دستور کاربر */
.rp-hero-slider-container:hover .rp-hero-slide.is-active .rp-hero-slide-img,
.rp-hero-slider-container:hover .rp-hero-slide-img {
    transform: none !important;
}

/* ==========================================================================
   ۴. دکمه‌های ناوبری قبلی و بعدی (شیشه‌ای مدرن)
   ========================================================================== */
.rp-hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.92);
    width: 2.75rem !important;
    height: 2.75rem !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    z-index: 10 !important;
    padding: 0 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.rp-hero-nav svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

/* در هاور روی اسلایدر، فلش‌ها آشکار می‌شوند */
.rp-hero-slider-container:hover .rp-hero-nav {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(-50%) scale(1) !important;
}

.rp-hero-nav:hover {
    background: rgba(255, 255, 255, 0.85) !important;
    transform: translateY(-50%) scale(1.08) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2) !important;
}

.rp-hero-nav:hover svg {
    stroke: var(--rp-hero-primary-dark) !important;
}

/* موقعیت فلش‌ها در حالت راست‌چین RTL */
.rp-hero-nav-prev {
    right: 1.25rem !important; /* دکمه قبلی سمت راست */
}

.rp-hero-nav-prev:hover svg {
    transform: translateX(2px);
}

.rp-hero-nav-next {
    left: 1.25rem !important;  /* دکمه بعدی سمت چپ */
}

.rp-hero-nav-next:hover svg {
    transform: translateX(-2px);
}

/* ==========================================================================
   ۵. نشانگرهای پیجینیشن نقطه‌ای و کپسولی (شیشه‌ای در گوشه پایین چپ)
   ========================================================================== */
.rp-hero-pagination-wrapper {
    position: absolute !important;
    bottom: 1.25rem !important;
    left: 1.5rem !important; /* گوشه پایین سمت چپ */
    z-index: 10 !important;
    pointer-events: auto !important;
}

.rp-hero-pagination {
    display: inline-flex !important;
    flex-direction: row !important;
    direction: rtl !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: rgba(3, 44, 100, 0.4) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    padding: 6px 12px !important;
    border-radius: 9999px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.rp-hero-bullet {
    width: 0.45rem !important;
    height: 0.45rem !important;
    border-radius: 50% !important;
    background-color: rgba(255, 255, 255, 0.5) !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    outline: none !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.rp-hero-bullet:hover {
    background-color: rgba(255, 255, 255, 0.85) !important;
    transform: scale(1.2);
}

.rp-hero-bullet.is-active {
    width: 1.75rem !important; /* تبدیل نقطه به کپسول زیبا در حالت فعال */
    height: 0.45rem !important;
    border-radius: 9999px !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
}

/* ==========================================================================
   ۶. بنرهای عمودی کناری (ستون چپ - ۲ بنر مربع با نسبت ۱:۱ دقیق)
   ========================================================================== */
.rp-hero-banners-wrap {
    width: var(--rp-hero-side-size);
    height: var(--rp-hero-height);
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--rp-hero-banner-gap);
}

.rp-hero-side-banner {
    width: var(--rp-hero-side-size) !important;
    height: var(--rp-hero-side-size) !important;
    aspect-ratio: 1 / 1 !important; /* نسبت مربع ۱ در ۱ قطعی */
    flex-shrink: 0;
    border-radius: var(--rp-hero-radius);
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #0c234b 0%, #1e3a6a 100%);
    box-shadow: 0 10px 25px -5px rgba(2, 24, 56, 0.1), 0 8px 10px -6px rgba(2, 24, 56, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.rp-hero-side-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px -6px rgba(2, 24, 56, 0.16), 0 10px 12px -5px rgba(2, 24, 56, 0.1);
}

.rp-hero-banner-link {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    text-decoration: none !important;
    outline: none !important;
    cursor: pointer;
}

.rp-hero-banner-img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    aspect-ratio: 1 / 1 !important; /* حفظ نسبت دقیق ۱ در ۱ تصویر مربع */
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    transform: scale(1);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.rp-hero-side-banner:hover .rp-hero-banner-img {
    transform: scale(1.04);
}

/* ==========================================================================
   ۷. ریسپانسیو تبلت (عرض ۷۶۹ تا ۱۰۲۴ پیکسل)
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .rp-hero-section {
        margin-bottom: 2rem !important;
    }

    .rp-hero-container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .rp-hero-grid.has-side-banners {
        grid-template-columns: 1fr 180px !important;
        gap: 1rem !important;
    }

    .rp-hero-slider-wrap {
        height: 380px !important;
    }

    .rp-hero-banners-wrap {
        width: 180px !important;
        height: 380px !important;
        gap: 1rem !important;
    }

    .rp-hero-side-banner {
        width: 180px !important;
        height: 180px !important;
    }
}

/* ==========================================================================
   ۸. ریسپانسیو موبایل فوق‌حرفه‌ای و استاندارد (عرض حداکثر ۷۶۸ پیکسل)
   - اسلایدر به صورت منفرد و تمام‌عرض بدون بنرهای کناری
   - فاصله دقیق ۱ رِم از چپ و راست موبایل
   - نسبت ابعاد استاندارد ۱۶:۹ جهت نمایش ایده‌آل و بدون دفرمگی عکس‌ها
   - فلش‌های ناوبری دایره‌ای شیشه‌ای شناور و همیشه نمایان با آیکون تیره
   - پیجینیشن کپسولی سرمه‌ای و نقطه‌ای زیر اسلایدر منطبق بر تصویر ارسالی
   ========================================================================== */
@media (max-width: 768px) {
    .rp-hero-section {
        margin-top: 0 !important;
        margin-bottom: 1.5rem !important; /* فاصله استاندارد ۱.۵ رِم در نسخه موبایل */
    }

    .rp-hero-container {
        padding-left: 1rem !important;  /* فاصله دقیق ۱ رِم از چپ */
        padding-right: 1rem !important; /* فاصله دقیق ۱ رِم از راست */
        width: 100% !important;
        max-width: 100% !important;
    }

    .rp-hero-grid,
    .rp-hero-grid.has-side-banners,
    .rp-hero-grid.slider-only {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        width: 100% !important;
    }

    /* بنرهای کناری در موبایل به هیچ وجه نمایش داده نمی‌شوند (در موبایل اصلاً رندر نمی‌شوند) */
    .rp-hero-banners-wrap {
        display: none !important;
    }

    /* ابعاد اسلایدر در موبایل به صورت نسبت تصویر استاندارد ۱۶ به ۹ */
    .rp-hero-slider-wrap {
        width: 100% !important;
        height: auto !important;
        position: relative !important;
    }

    /* ابعاد اسلایدر در موبایل کاملاً هم‌نسبت با دسکتاپ (جهت آپلود یک سایز واحد بدون کوچک‌ترین برش) */
    .rp-hero-slider-container {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1006 / 420 !important; /* نسبت دقیقاً یکسان با دسکتاپ (۲.۴ به ۱) جهت نمایش ۱۰۰٪ عکس بدون برش */
        border-radius: 1.25rem !important; /* گوشه‌های گرد مدرن ۲۰ پیکسل طبق تصویر ارسالی */
        box-shadow: 0 4px 16px -2px rgba(2, 24, 56, 0.08) !important;
    }

    .rp-hero-slide-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    /* فلش‌های ناوبری در موبایل: شناور روی عکس، همیشه قابل رویت و با زمینه شیشه‌ای ملایم */
    .rp-hero-nav {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        width: 2.25rem !important;  /* ۳۶ پیکسل طبق نمونه */
        height: 2.25rem !important; /* ۳۶ پیکسل طبق نمونه */
        transform: translateY(-50%) !important;
        background: rgba(255, 255, 255, 0.78) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        border: 1px solid rgba(255, 255, 255, 0.6) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14) !important;
    }

    .rp-hero-nav svg {
        width: 1rem !important;
        height: 1rem !important;
        stroke: #0f172a !important; /* رنگ تیره آیکون فلش طبق تصویر ارسالی */
        stroke-width: 2.6 !important;
        filter: none !important;
    }

    .rp-hero-nav-prev {
        right: 0.625rem !important;
    }

    .rp-hero-nav-next {
        left: 0.625rem !important;
    }

    /* پیجینیشن نقطه‌ای در موبایل: در زیر اسلایدر به صورت وسط‌چین طبق تصویر ارسالی */
    .rp-hero-pagination-wrapper {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        margin-top: 0.75rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        z-index: 5 !important;
    }

    .rp-hero-pagination {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.375rem !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .rp-hero-bullet {
        width: 7px !important;
        height: 7px !important;
        border-radius: 50% !important;
        background-color: #cbd5e1 !important; /* رنگ طوسی روشن برای اسلایدهای غیرفعال */
        border: none !important;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .rp-hero-bullet.is-active {
        width: 1.5rem !important; /* کپسول کشیده سرمه‌ای طبق تصویر */
        height: 7px !important;
        border-radius: 9999px !important;
        background-color: #032c64 !important; /* رنگ سرمه‌ای برند */
        box-shadow: none !important;
    }
}