/* ========================================================
   فوتر سایت (Footer)
======================================================== */
.ksn-site-footer {
    direction: rtl;
    text-align: right;
    background: #ffffff;
    border-top: 1px solid var(--ksn-border);
    margin-top: 40px;
    font-size: 14px;
    color: var(--ksn-text-muted);
}

.ksn-footer-features-section {
    padding: 24px 0;
}

.ksn-features-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.ksn-footer-logo {
    max-width: 142px;
    height: auto;
    display: block;
}

.ksn-features-contact {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.ksn-back-to-top {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--ksn-border);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ksn-text-muted);
}



.ksn-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    font-size: 13px;
    font-weight: bold;
    color: var(--ksn-text-muted);
}

.ksn-footer-menus-section {
    border-bottom: 1px solid var(--ksn-border);
}

.ksn-footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.ksn-footer-title,
.ksn-footer-col h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ksn-text-main);
    margin-bottom: 16px;
}

.ksn-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ksn-footer-links a,
.ksn-footer-links li a {
    color: var(--ksn-text-muted);
    text-decoration: none;
    font-size: 13px;
    line-height: 2;
    transition: color 0.2s ease;
}

.ksn-footer-links a:hover,
.ksn-footer-links li a:hover {
    color: var(--ksn-primary);
}

.ksn-footer-bottom-section {
    padding: 32px 0;
    background: var(--ksn-bg-subtle);
    border-top: 1px solid var(--ksn-border);
}

.ksn-footer-bottom-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}

.ksn-footer-intro {
    flex: 1;
}

.ksn-footer-brand-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--ksn-text-main);
}

.ksn-footer-desc {
    line-height: 1.8;
    color: var(--ksn-text-muted);
    font-size: 13.5px;
    margin: 0;
}

.ksn-footer-licenses {
    flex-shrink: 0;
}

.ksn-license-card img {
    max-width: 220px;
    height: auto;
    border: 1px solid var(--ksn-border);
    border-radius: 8px;
    padding: 6px;
}

.ksn-footer-copyright {
    border-top: 1px solid var(--ksn-border);
    text-align: center;
    font-size: 12px;
    color: var(--ksn-text-sub);
    padding: 12px 0;
}

.ksn-social-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ksn-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.ksn-social-icon:hover {
    transform: translateY(-2px);
}

/* ========================================================
   بخش مزایای کوشانیک - همیشه ۴ ستون در یک ردیف (دسکتاپ و موبایل)
======================================================== */
.ksn-features-grid,
.ks-v2-product .ks-v2-features-section .ksn-features-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px;
    align-items: center;
    width: 100%;
}

/* اگر در برگه محصول نیاز به تغییر شفافیت بود */
.ks-v2-product .ks-v2-features-section .ksn-features-grid {
    opacity: 0.5;
}

.ksn-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: bold;
    color: var(--ksn-text-muted);
    min-width: 0; /* جلوگیری از سرریز شدن گرید در موبایل */
    justify-content: flex-start;
}

/* متن‌ها بدون قطع‌شدگی، در صورت نیاز دو خطی شوند و در مرکز بمانند */
.ksn-features-grid .ksn-feat-text,
.ks-v2-product .ks-v2-features-section .ksn-features-grid span,
.ks-v2-product .ks-v2-features-section .ksn-features-grid p,
.ks-v2-product .ks-v2-features-section .ksn-features-grid div {
    white-space: normal !important;
    text-overflow: clip;
    overflow: visible;
    text-align: center;
    width: 100%;
    font-size: 11.5px; /* اندازه بهینه برای جای‌گیری متوازن دو خط در موبایل */
    line-height: 1.4;
    word-break: keep-all; /* جلوگیری از شکستن کلمات وسط حروف */
}


/* ریسپانسیو ستون‌های فوتر (بدون تأثیر روی مزایا) */
@media (max-width: 992px) {
    .ksn-footer-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    .ksn-footer-bottom-row {
        flex-direction: column;
    }
}

/* ==========================================================================
   آکاردئون فوتر در موبایل
   ========================================================================== */
@media (max-width: 768px) {
    .ksn-footer-menus-section .ksn-footer-columns {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 16px !important;
    }

    /* ستون‌های منو (به‌جز شبکه‌های اجتماعی) */
    .ksn-footer-col:not(.ksn-col-social) {
        border-bottom: 1px solid #f1f5f9;
        margin-bottom: 0 !important;
    }

    /* عنوان به شکل کلیک‌خور و کشویی */
    .ksn-footer-col:not(.ksn-col-social) .ksn-footer-title {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        cursor: pointer;
        margin: 0 !important;
        padding: 14px 0 !important;
        font-size: 0.95rem !important;
        color: #1e293b;
        user-select: none;
    }

    /* فلش کشویی */
    .ksn-footer-col:not(.ksn-col-social) .ksn-footer-title::after {
        content: "";
        width: 8px;
        height: 8px;
        border-left: 2px solid #64748b;
        border-bottom: 2px solid #64748b;
        transform: rotate(-45deg);
        transition: transform 0.25s ease;
        margin-right: 8px;
    }

    /* چرخش فلش هنگام باز شدن */
    .ksn-footer-col.is-open .ksn-footer-title::after {
        transform: rotate(135deg);
        border-color: #0f172a;
    }

    /* مخفی بودن منو در حالت اولیه موبایل */
    .ksn-footer-col:not(.ksn-col-social) .ksn-footer-links {
        display: none;
        padding: 4px 0 16px 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .ksn-footer-col:not(.ksn-col-social) .ksn-footer-links li {
        padding: 6px 0;
    }

    /* ستون همراه ما باشید (ثابت در زیر منوها) */
    .ksn-footer-col.ksn-col-social {
        padding-top: 18px !important;
        text-align: right;
    }
}
@media (max-width: 768px) {
    .ksn-footer-desc {
        max-height: 90px;
        overflow: hidden;
        position: relative;
        transition: max-height 0.3s ease;
    }

    .ksn-footer-desc.ks-footer-expanded {
        max-height: 500px !important;
    }

    .ksn-footer-expand-btn {
        background: none;
        border: none;
        color: #0284c7;
        font-weight: 600;
        padding: 6px 0;
        cursor: pointer;
        font-size: 0.85rem;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-top: 6px;
    }
}





@media (max-width: 768px) {
    /* فلش فقط برای ستون‌هایی که منو دارند */
    .ksn-footer-col:has(.ksn-footer-links) .ksn-footer-title {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .ksn-footer-col:has(.ksn-footer-links) .ksn-footer-title::after {
        content: '';
        display: inline-block;
        width: 7px;
        height: 7px;
        border-right: 2px solid #64748b;
        border-bottom: 2px solid #64748b;
        transform: rotate(45deg);
        transition: transform 0.25s ease;
        margin-left: 8px;
    }

    .ksn-footer-col.is-open .ksn-footer-title::after {
        transform: rotate(-135deg);
    }
}

@media (max-width: 768px) {
    /* نمایش لینک‌ها زمانی که آکاردئون باز است */
    .ksn-footer-col.is-open .ksn-footer-links {
        display: block !important;
    }
}

.ks-collapsible-wrapper {
    max-height: 320px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.25s ease-out;
}
.ks-collapsible-wrapper.is-expanded {
    max-height: 3000px !important;
}

