/**
 * استایل‌های ماژول فوتر اختصاصی rpkala
 * هماهنگ با طراحی مدرن، پالت رنگی اختصاصی (#23437c) و عرض کانتینر ۱۲۳۰ پیکسل
 *
 * @package RPKala_Toolkit
 * @since   1.0.0
 */

:root {
    --rp-footer-font: 'iransansx', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rp-footer-container-width: 1230px;

    /* پالت رنگی رسمی و اختصاصی برند rpkala */
    --rp-footer-primary: #23437c;
    --rp-footer-secondary: #4A6FA5;
    --rp-footer-dark: #101828;
    --rp-footer-slate: #334155;
    --rp-footer-muted: #64748b;
    --rp-footer-light-muted: #94a3b8;
    --rp-footer-border: #e2e8f0;
    --rp-footer-border-subtle: #f1f5f9;
    --rp-footer-bg-gray: #f8fafc;
    --rp-footer-social-bg: #f1f5f9;
}

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

/* تگ اصلی فوتر */
.rp-main-footer {
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid var(--rp-footer-border);
    color: var(--rp-footer-muted);
    direction: rtl !important;
    position: relative;
    z-index: 10;
    margin: 0 !important;
    margin-top: 3rem !important; /* فاصله ایمن و استاندارد از سکشن‌های محتوایی قبل از فوتر */
    padding-top: 3.5rem;
    padding-bottom: 1.5rem;
}

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

/* ریسپانسیو در صفحات کوچک‌تر از عرض کانتینر (۱۲۶۰ پیکسل به پایین) */
@media screen and (max-width: 1260px) {
    .rp-footer-container {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
}

/* گرید اصلی ۴ ستونه فوتر با چیدمان دقیق ۳۰٪ ۲۰٪ ۲۰٪ ۲۰٪ */
.rp-footer-grid {
    display: grid;
    grid-template-columns: 30% 20% 20% 20%;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 2.75rem;
    border-bottom: 1px solid var(--rp-footer-border-subtle);
}

/* ستون ۱: معرفی فروشگاه و لوگو */
.rp-footer-about-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.125rem;
}

.rp-footer-logo-wrap {
    display: inline-flex;
    align-items: center;
}

.rp-footer-logo-wrap .custom-logo-link,
.rp-footer-logo-wrap .rp-footer-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
    transition: opacity 0.2s ease;
}

.rp-footer-logo-wrap .custom-logo-link:hover,
.rp-footer-logo-wrap .rp-footer-logo-link:hover {
    opacity: 0.9;
}

/* کنترل دقیق سایز لوگوی فوتر */
.rp-footer-logo-wrap img,
.rp-footer-logo-wrap .custom-logo,
.rp-footer-logo-img {
    height: auto !important;
    max-height: 2.75rem !important; /* ارتفاع متناسب و شکیل لوگو */
    width: auto !important;
    max-width: 10.5rem !important; /* حداکثر عرض ۱۶۸ پیکسل */
    object-fit: contain !important;
    display: block !important;
}

/* فال‌بک متنی لوگو در صورت نبود تصویر */
.rp-footer-logo-fallback {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--rp-footer-primary);
    text-decoration: none !important;
}

.rp-footer-logo-brand {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--rp-footer-primary);
}

.rp-footer-about-text {
    font-size: 0.8125rem;
    line-height: 1.95;
    color: var(--rp-footer-muted);
    margin: 0;
    max-width: 95%;
}

/* تیتر ستون‌های فوتر با خط عمودی شاخص در سمت راست */
.rp-footer-col-title {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--rp-footer-dark);
    margin: 0 0 1.25rem 0;
    padding-right: 0.625rem;
    border-right: 3px solid var(--rp-footer-primary);
    line-height: 1.2;
    display: flex;
    align-items: center;
}

/* ستون ۲: دسترسی سریع */
.rp-footer-quick-col {
    display: flex;
    flex-direction: column;
}

.rp-footer-links-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rp-footer-links-list li {
    margin: 0 !important;
    padding: 0 !important;
}

.rp-footer-link-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rp-footer-slate);
    text-decoration: none !important;
    transition: color 0.2s ease, transform 0.2s ease;
    line-height: 1.6;
    padding: 0;
}

.rp-footer-link-item:hover {
    color: var(--rp-footer-primary);
    transform: translateX(-4px);
}

/* ستون ۳: راه‌های ارتباطی و شبکه‌های اجتماعی */
.rp-footer-contact-col {
    display: flex;
    flex-direction: column;
}

.rp-footer-contact-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rp-footer-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--rp-footer-slate);
    line-height: 1.6;
}

.rp-footer-contact-icon {
    width: 1.125rem;
    height: 1.125rem;
    stroke: var(--rp-footer-primary);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.rp-footer-contact-label {
    font-weight: 600;
    color: var(--rp-footer-dark);
}

.rp-footer-contact-value {
    color: var(--rp-footer-slate);
    font-weight: 700;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

a.rp-footer-contact-value:hover {
    color: var(--rp-footer-primary);
}

.rp-footer-contact-phone {
    font-family: inherit;
    direction: ltr;
    display: inline-block;
}

/* بخش شبکه‌های اجتماعی */
.rp-footer-socials-wrap {
    margin-top: 1.25rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--rp-footer-border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.rp-footer-socials-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rp-footer-slate);
}

.rp-footer-social-icons {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.rp-footer-social-btn {
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 50%;
    background-color: var(--rp-footer-social-bg);
    color: var(--rp-footer-slate);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.rp-footer-social-svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.rp-footer-social-btn:hover {
    background-color: var(--rp-footer-primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 67, 124, 0.28);
}

.rp-footer-social-btn:hover .rp-footer-social-svg {
    transform: scale(1.1);
}

/* ستون ۴: مجوزها و نماد اعتماد الکترونیکی */
.rp-footer-trust-col {
    display: flex;
    flex-direction: column;
}

.rp-footer-badge-card {
    background-color: var(--rp-footer-bg-gray);
    border: 1px solid var(--rp-footer-border);
    border-radius: 0.875rem;
    padding: 0.75rem 0.625rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    width: fit-content;
    min-width: 6.5rem;
}

.rp-footer-badge-card:hover {
    border-color: rgba(35, 67, 124, 0.3);
    background-color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.rp-footer-enamad-embed {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.rp-footer-enamad-embed img {
    width: 85px !important;
    height: auto !important;
    max-width: 100% !important;
}

.rp-footer-badge-caption {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--rp-footer-slate);
    margin-top: 0.375rem;
    line-height: 1.3;
}

/* ===================================================
   ردیف کف فوتر: کپی‌رایت و شناسنامه توسعه‌دهنده
=================================================== */
.rp-footer-bottom-bar {
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--rp-footer-light-muted);
}

.rp-footer-copyright-text {
    margin: 0;
    color: var(--rp-footer-light-muted);
    line-height: 1.5;
}

.rp-footer-developer-text {
    margin: 0;
    color: var(--rp-footer-muted);
    font-weight: 600;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.rp-footer-developer-link {
    color: inherit;
    text-decoration: none !important;
}

.rp-footer-developer-link:hover {
    color: var(--rp-footer-primary);
}

/* ===================================================
   ریسپانسیو فوتر (تبلت و موبایل)
=================================================== */

/* تبلت (۱۰۲۴ پیکسل به پایین) */
@media screen and (max-width: 1024px) {
    .rp-footer-grid {
        grid-template-columns: 1.5fr 1fr;
        gap: 2rem;
    }

    .rp-footer-about-col {
        grid-column: span 2;
    }

    .rp-footer-about-text {
        max-width: 100%;
    }
}

/* موبایل‌های عریض و تبلت‌های کوچک (۷۶۸ پیکسل به پایین) */
@media screen and (max-width: 768px) {
    .rp-main-footer {
        padding-top: 2.5rem;
        padding-bottom: 5.5rem; /* فضای امن جهت عدم هم‌پوشانی با باتم‌بار موبایل */
    }

    .rp-footer-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        padding-bottom: 2rem;
    }

    .rp-footer-about-col {
        grid-column: span 1;
    }

    .rp-footer-bottom-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.625rem;
    }
}
