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

:root {
    --rp-feat-container-width: 1230px;
    --rp-feat-radius: 1.5rem;
    --rp-feat-font: 'iransansx', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rp-features-section,
.rp-features-section * {
    box-sizing: border-box !important;
    font-family: var(--rp-feat-font) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ==========================================================================
   ۲. کارت اصلی سفید فیچرباکس با گوشه‌های منحنی و سایه نرم
   ========================================================================== */
.rp-features-card {
    width: 100%;
    background-color: #ffffff;
    border-radius: var(--rp-feat-radius);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    border: 1px solid #f1f5f9;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    align-items: center;
}

/* ==========================================================================
   ۳. چیدمان هر آیتم فیچر
   ========================================================================== */
.rp-feature-item {
    display: flex;
    align-items: center;
    gap: 1.125rem;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
    cursor: default;
}

.rp-feature-item:hover {
    transform: translateY(-2px);
    background-color: #f8fafd;
}

/* باکس آیکون وکتور با گوشه‌های گرد نرم */
.rp-feature-icon-wrap {
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
    border-radius: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rp-feature-item:hover .rp-feature-icon-wrap {
    transform: scale(1.08);
}

/* رنگ‌بندی پاستلی و تمیز متناظر با تصویر */
/* ۱. آبی: ارسال سریع */
.rp-icon-blue {
    background-color: #f0f7ff;
    color: #032c64;
}

/* ۲. سبز زمردی: تضمین اصالت */
.rp-icon-green {
    background-color: #ecfdf5;
    color: #059669;
}

/* ۳. زرد/کهربایی: ۷ روز ضمانت بازگشت */
.rp-icon-amber {
    background-color: #fffbeb;
    color: #d97706;
}

/* ۴. بنفش: پشتیبانی تخصصی */
.rp-icon-purple {
    background-color: #faf5ff;
    color: #9333ea;
}

/* ==========================================================================
   ۴. استایل متون و عناوین
   ========================================================================== */
.rp-feature-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rp-feature-title {
    margin: 0 0 0.3rem 0 !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em;
}

.rp-feature-desc {
    margin: 0 !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    line-height: 1.4 !important;
}

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

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

    .rp-features-card {
        padding: 1.25rem 1.5rem !important;
        gap: 1rem !important;
    }

    .rp-feature-item {
        gap: 0.75rem !important;
        padding: 0.35rem 0.5rem !important;
    }

    .rp-feature-icon-wrap {
        width: 3rem !important;
        height: 3rem !important;
        min-width: 3rem !important;
    }

    .rp-feature-icon-wrap svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    .rp-feature-title {
        font-size: 0.875rem !important;
    }

    .rp-feature-desc {
        font-size: 0.75rem !important;
    }
}

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

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

    /* شبکه ۲ ستونه و ۲ سطری (گرید ۲×۲) */
    .rp-features-card {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important; /* فاصله ۱۲ پیکسل بین کارت‌ها */
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        align-items: stretch !important;
    }

    /* هر فیچر باکس به یک کارت مستقل سفید با گوشه‌های گرد ۱۶px تبدیل می‌شود */
    .rp-feature-item {
        background-color: #ffffff !important;
        border: 1px solid #f1f5f9 !important;
        border-radius: 1rem !important; /* ۱۶ پیکسل طبق نمونه ارسالی */
        padding: 0.75rem 0.625rem !important;
        box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04), 0 1px 3px -1px rgba(15, 23, 42, 0.02) !important;
        gap: 0.625rem !important; /* ۱۰ پیکسل فاصله آیکون تا متون */
        align-items: center !important;
        min-width: 0 !important;
        height: 100% !important;
    }

    /* کادر آیکون جمع‌وجور و متناسب با کارت در موبایل */
    .rp-feature-icon-wrap {
        width: 2.625rem !important;  /* ۴۲ پیکسل */
        height: 2.625rem !important; /* ۴۲ پیکسل */
        min-width: 2.625rem !important;
        border-radius: 0.75rem !important; /* ۱۲ پیکسل */
        flex-shrink: 0 !important;
    }

    .rp-feature-icon-wrap svg {
        width: 1.25rem !important;  /* ۲۰ پیکسل */
        height: 1.25rem !important; /* ۲۰ پیکسل */
    }

    /* متون فیچرباکس */
    .rp-feature-text {
        overflow: hidden !important;
        min-width: 0 !important;
        text-align: right !important;
    }

    .rp-feature-title {
        font-size: 0.8125rem !important; /* ۱۳ پیکسل */
        font-weight: 800 !important;
        margin: 0 0 0.2rem 0 !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .rp-feature-desc {
        font-size: 0.6875rem !important; /* ۱۱ پیکسل */
        font-weight: 500 !important;
        margin: 0 !important;
        line-height: 1.35 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* بهینه‌سازی اختصاصی برای صفحات فوق کوچک کمتر از ۳۶۰ پیکسل */
@media (max-width: 360px) {
    .rp-features-card {
        gap: 0.5rem !important;
    }

    .rp-feature-item {
        padding: 0.625rem 0.5rem !important;
        gap: 0.5rem !important;
        border-radius: 0.875rem !important;
    }

    .rp-feature-icon-wrap {
        width: 2.35rem !important;
        height: 2.35rem !important;
        min-width: 2.35rem !important;
        border-radius: 0.625rem !important;
    }

    .rp-feature-icon-wrap svg {
        width: 1.125rem !important;
        height: 1.125rem !important;
    }

    .rp-feature-title {
        font-size: 0.75rem !important;
    }

    .rp-feature-desc {
        font-size: 0.625rem !important;
    }
}
