/* ============ سایدبار دسکتاپ ============ */
.sp-side{
    background:#fff;border:1px solid #eef0f3;border-radius:14px;
    padding:6px;box-shadow:0 4px 16px rgba(0,0,0,.05);
}
.sp-group{border-bottom:1px solid #f1f3f6}
.sp-group:last-child{border-bottom:0}
.sp-group[open] .sp-group-chev{transform:rotate(180deg)}

.sp-group-head{
    display:flex;align-items:center;justify-content:space-between;
    padding:12px 14px;cursor:pointer;user-select:none;list-style:none;
    font-weight:800;font-size:13.5px;color:#0f172a;
    border-radius:10px;transition:.15s;
}
.sp-group-head::-webkit-details-marker{display:none}
.sp-group-head:hover{background:#fafbfc}
.sp-group-title{display:inline-flex;align-items:center;gap:6px}
.sp-group-chev{font-size:11px;color:#94a3b8;transition:transform .2s}
.sp-group-body{padding:0 14px 12px}

.sp-side-options{display:flex;flex-direction:column;gap:2px;max-height:230px;overflow-y:auto}
.sp-side-options::-webkit-scrollbar{width:6px}
.sp-side-options::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:3px}

/* چک‌باکس مدرن */
.sp-check{
    display:flex;align-items:center;gap:9px;
    font-size:13px;color:#475569;cursor:pointer;
    padding:7px 6px;border-radius:8px;transition:.15s;
    user-select:none;
}
.sp-check:hover{background:#f8fafc}
.sp-check.is-checked{color:#0f172a;font-weight:700;background:#fffbea}
.sp-check.is-disabled{opacity:.4;cursor:not-allowed}
.sp-check input[type=checkbox]{display:none}
.sp-check-box{
    flex:0 0 18px;width:18px;height:18px;border-radius:5px;
    border:1.5px solid #cbd5e1;background:#fff;position:relative;
    transition:.15s;
}
.sp-check:hover .sp-check-box{border-color:#94a3b8}
.sp-check.is-checked .sp-check-box{
    background:#ffc20e;border-color:#ffc20e;
    box-shadow:0 0 0 3px rgba(255,194,14,.2);
}
.sp-check.is-checked .sp-check-box::after{
    content:"";position:absolute;left:5px;top:1.5px;
    width:5px;height:9px;
    border:solid #0f172a;border-width:0 2px 2px 0;
    transform:rotate(45deg);
}
.sp-check-label{flex:1;min-width:0}
.sp-count{margin-inline-start:auto;font-size:11px;color:#94a3b8;font-style:normal;font-weight:600}

.sp-side-apply{
    width:100%;margin-top:12px;padding:10px;
    background:#ffc20e;border:0;border-radius:10px;
    font-weight:800;font-size:13.5px;cursor:pointer;color:#0f172a;
}
.sp-side-apply:hover{background:#e5ac00}
.sp-side-reset{display:block;text-align:center;margin-top:8px;font-size:12px;color:#b91c1c}

/* اسلایدر قیمت */
.sp-price-values{display:flex;justify-content:space-between;font-size:12px;color:#475569;margin-bottom:6px}
.sp-range-wrap{position:relative;height:34px}
.sp-range{
    position:absolute;left:0;right:0;bottom:0;width:100%;
    -webkit-appearance:none;background:none;pointer-events:none;
}
.sp-range::-webkit-slider-thumb{
    -webkit-appearance:none;pointer-events:all;width:16px;height:16px;
    border-radius:50%;background:#ffc20e;border:2px solid #fff;cursor:pointer;
    box-shadow:0 0 0 3px rgba(255,194,14,.25);
}
.sp-range-track{
    position:absolute;left:0;right:0;top:50%;height:6px;
    background:#e5e7eb;border-radius:3px;transform:translateY(-50%);
}
.sp-range-fill{position:absolute;height:100%;background:#ffc20e;border-radius:3px}

#products-list.sp-loading{opacity:.4;pointer-events:none;transition:.15s}

/* ============ چیپ‌ها و Bottom Sheet (موبایل) ============ */
/*.sp-chips{display:none}*/

.sp-chips-row { display: none; }

@media (max-width:900px){
    .sp-side{display:none}

        .sp-chips-row {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding: 6px 0;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .sp-chips-row::-webkit-scrollbar { display: none; }

        /* ردیف ۱: دسته‌بندی‌ها — رنگ متمایز */
        .sp-chips-categories {
            padding-top: 10px;
            border-bottom: 1px dashed #f1f5f9;
            margin-bottom: 4px;
            padding-bottom: 10px;
        }
        .sp-chip-cat {
            background: #f8fafc;
            border-color: #e2e8f0;
            font-weight: 700;
        }
        .sp-chip-cat.active {
            background: #fff7d6;
            border-color: #ffc20e;
            color: #78350f;
        }

        /* ردیف ۲: فیلترهای ویژگی — ظاهر قبلی */
        .sp-chips-filters { padding-top: 4px; padding-bottom: 4px; }

        /* ردیف ۳: محبوب‌ترین‌ها */
        .sp-chips-popular {
            padding-top: 4px;
            padding-bottom: 10px;
            border-top: 1px dashed #f1f5f9;
            align-items: center;
        }
        .sp-chips-label {
            flex: 0 0 auto;
            font-size: 11.5px;
            font-weight: 800;
            color: #b45309;
            padding-inline-end: 4px;
            white-space: nowrap;
        }

        /* خود چیپ */
        .sp-chip {
            flex: 0 0 auto;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            border-radius: 99px;
            background: #fff;
            border: 1px solid #e5e7eb;
            color: #333;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            font-family: inherit;
            transition: .15s;
        }
        .sp-chip:hover { border-color: #cbd5e1; }
        .sp-chip.active {
            background: #fff7d6;
            border-color: #ffc20e;
            color: #78350f;
        }
        .sp-chip .badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            border-radius: 99px;
            background: #ffc20e;
            color: #0f172a;
            font-size: 11px;
            font-weight: 800;
            font-style: normal;
        }
        .sp-chip .x {
            font-size: 14px;
            color: #b91c1c;
            font-style: normal;
            line-height: 1;
        }
        .sp-chip.reset {
            background: #fef2f2;
            border-color: #fecaca;
            color: #b91c1c;
        }

    /* Bottom Sheet */
    .sp-sheet{
        position:fixed;inset:0;z-index:9999;
        display:flex;align-items:flex-end;justify-content:center;
    }
    .sp-sheet[hidden]{display:none}
    .sp-sheet-backdrop{
        position:absolute;inset:0;background:rgba(15,23,42,.5);
        backdrop-filter:blur(4px);animation:spFade .2s ease;
    }
    @keyframes spFade{from{opacity:0}to{opacity:1}}
    .sp-sheet-panel{
        position:relative;z-index:1;width:100%;max-width:640px;
        background:#fff;border-radius:20px 20px 0 0;
        max-height:80vh;display:flex;flex-direction:column;
        animation:spUp .25s ease;
    }
    @keyframes spUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
    .sp-sheet-head{
        display:flex;align-items:center;justify-content:space-between;
        padding:14px 18px;border-bottom:1px solid #eee;
    }
    .sp-sheet-head strong{font-size:15px;font-weight:800;color:#0f172a}
    .sp-sheet-head button{
        width:32px;height:32px;border-radius:50%;
        background:#f1f5f9;border:0;font-size:18px;cursor:pointer;color:#475569;
    }
    .sp-sheet-body{
        flex:1;overflow-y:auto;padding:12px 18px;
        -webkit-overflow-scrolling:touch;
    }
    .sp-sheet-body .sp-check{padding:10px 6px;font-size:14px}
    .sp-sheet-body .sp-price-values{font-size:13px}
    .sp-sheet-foot{
        display:flex;gap:10px;padding:12px 18px;
        border-top:1px solid #eee;
        padding-bottom:calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .sp-btn{
        flex:1;padding:11px;border-radius:10px;
        font-family:inherit;font-weight:800;font-size:13.5px;cursor:pointer;border:0;
    }
    .sp-btn.primary{background:#ffc20e;color:#0f172a}
    .sp-btn.ghost{background:#f1f5f9;color:#475569}
}

/* ============ فونت یکان ============ */
.force-yekan,
.force-yekan * { font-family:'YekanBakh', sans-serif !important; }

/* ============ توضیحات دسته / برند ============ */
.package-full-description-text,
.package-full-description-text *,
.package-full-description-text p,
.package-full-description-text span,
.package-full-description-text div,
.package-full-description-text strong,
.package-full-description-text em,
.package-full-description-text li,
.package-full-description-text a { font-family:'YekanBakh' !important; }

.package-full-description-text table{
    width:100% !important; max-width:100% !important;
    table-layout:auto !important; border-collapse:collapse;
}
.package-full-description-text table,
.package-full-description-text th,
.package-full-description-text td { box-sizing:border-box; }
.package-full-description-text td,
.package-full-description-text th { word-wrap:break-word; overflow-wrap:anywhere; }
.package-full-description-text table[style] { width:100% !important; }
.package-full-description-text * { max-width:100%; }

/* ============ SEO ============ */
.seo-content-section{padding-top:3rem;padding-bottom:3rem;line-height:1.8;color:#333}
.content-wrapper{background:#fff;border-radius:12px;box-shadow:0 2px 10px rgba(0,0,0,.08);overflow:hidden}
.preview-text,
.full-content{padding:30px}
.main-title{font-size:28px;font-weight:bold;color:#1a1a1a;margin-bottom:20px;line-height:1.5}
.intro-paragraph{
    font-size:16px;color:#51482d;background:#f8f9fa;padding:20px;
    border-right:4px solid #ffc20e;border-radius:8px;margin-bottom:20px;
}
.seo-content-section h2{font-size:24px;font-weight:bold;color:#51482d;margin:30px 0 15px;padding-bottom:10px}
.seo-content-section h3{font-size:20px;font-weight:600;color:#51482d;margin:25px 0 12px}
.seo-content-section h4{font-size:18px;font-weight:600;color:#555;margin:20px 0 10px}
.seo-content-section p{font-size:15px;margin-bottom:15px;color:#444}
.feature-list,
.types-list,
.benefits-list{margin:15px 0;padding-right:25px}
.feature-list li,
.types-list li,
.benefits-list li{margin-bottom:12px;line-height:1.7}
.note{
    background:#fff3cd;border-right:4px solid #ffc20e;padding:12px 15px;
    margin:15px 0;border-radius:6px;font-size:14px;
}
.factors-section{background:#f8f9fa;padding:25px;border-radius:10px;margin:20px 0}
.calculation-box{
    background:#fffbee;border:2px solid #ffc20e;padding:20px;
    border-radius:8px;margin:20px 0;
}
.calculation-box p{margin-bottom:10px;font-size:15px}
.full-content{display:none;animation:fadeIn .4s ease-in-out}
.full-content.show{display:block}
@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}
.read-more-wrapper{
    text-align:center;padding:20px;
    background:linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
}
.seo-content-section a{text-decoration:none}
.seo-content-section a:hover{color:#007bff;text-decoration:underline}
.read-more-content{max-height:180px;overflow:hidden;position:relative}
.read-more-content.is-expanded{max-height:none}
.read-more-btn{margin-top:12px;cursor:pointer}
@media (max-width:768px){
    .seo-content-section{padding:15px}
    .preview-text,
    .full-content{padding:20px}
    .main-title{font-size:22px}
    .seo-content-section h2{font-size:20px}
    .seo-content-section h3{font-size:18px}
}

/* ============ کارت محصول: تعویض تصویر با هاور ============ */
.product-media{position:relative;overflow:hidden;display:block}
.product-media a{display:block;position:relative}
.product-media picture:first-of-type{
    display:block;opacity:1;transition:opacity .4s ease;
    position:relative;z-index:1;
}
.product-media picture:last-of-type{
    display:block;opacity:0;position:absolute;top:0;left:0;
    width:100%;height:100%;z-index:2;transition:opacity .4s ease;
}
.product-media picture:last-of-type img{width:100%;height:100%;object-fit:cover}
.product-media:hover picture:first-of-type{opacity:0}
.product-media:hover picture:last-of-type{opacity:1}


.sp-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #eef0f3;
    transition: .15s;
}
.sp-cat-link:hover {
    background: #fff7d6;
    border-color: #ffc20e;
    color: #78350f;
}
.sp-cat-link.sp-cat-all {
    background: #fff7d6;
    border-color: #ffc20e;
    color: #78350f;
    font-weight: 800;
    justify-content: center;
}
.sp-cat-link em {
    font-style: normal;
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 700;
}

/* آیکون دراپ‌دان کنار چیپ */
.sp-chev {
    font-style: normal;
    font-size: 9px;
    color: #94a3b8;
    margin-inline-start: 2px;
    transition: transform .2s;
}
.sp-chip:hover .sp-chev { color: #78350f; }

/* چیپ بازگشت */
.sp-chip-back {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
}

/* مخفی کردن ردیف ۲ و ۳ تا اولین فیلتر */
.sp-chips-extra {
    display: none;
}
.sp-chips-extra.is-open {
    display: block;
}

/* فاصله بین ردیف‌ها در حالت موبایل */
@media (max-width: 900px) {
    .sp-chips-extra.is-open {
        border-top: 1px dashed #f1f5f9;
        margin-top: 6px;
        padding-top: 6px;
    }
    .sp-chips-categories {
        padding-bottom: 10px;
    }
}

/* ردیف سر دسته‌ها */
.sp-chips-main {
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 6px;
}
.sp-chip-main {
    background: #f8fafc;
    border-color: #e2e8f0;
    font-weight: 700;
    font-size: 13.5px;
}
.sp-chip-main.active {
    background: #ffc20e;
    border-color: #ffc20e;
    color: #0f172a;
    font-weight: 800;
}

/* ردیف زیردسته‌ها */
.sp-chips-sub {
    padding-top: 4px;
    padding-bottom: 10px;
}
.sp-chip-sub {
    background: #fff;
    border-color: #e5e7eb;
    color: #475569;
    font-weight: 600;
}
.sp-chip-sub.active {
    background: #fff7d6;
    border-color: #ffc20e;
    color: #78350f;
}

.sp-chips-empty {
    font-size: 12px;
    color: #94a3b8;
    padding: 6px 4px;
    white-space: nowrap;
}

/* =====================================================
   سطح ۱: راهنما و رنگ‌آمیزی
   ===================================================== */
.sp-chips-section {
    margin-bottom: 12px;
}

.sp-chips-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #6b7280;
    margin-bottom: 8px;
    padding: 0 2px;
}
.sp-chips-hint svg {
    color: #b45309;
    flex-shrink: 0;
}
.sp-chips-hint b {
    color: #0f172a;
    font-weight: 800;
}
.sp-chips-hint-sub {
    color: #92400e;
    background: #fffbea;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px dashed #fde68a;
}
.sp-chips-hint-sub svg {
    color: #b45309;
}

/* ردیف زیردسته‌ها — رنگ هم‌خانواده با والد */
.sp-chips-section-sub {
    padding-top: 4px;
    margin-bottom: 16px;
}

.sp-chips-sub {
    padding-top: 6px;
}

/* چیپ زیردسته: پایه */
.sp-chip-sub {
    position: relative;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: #475569;
    font-weight: 600;
    transition: all .15s;
}
.sp-chip-sub .sp-chip-arrow {
    font-size: 14px;
    opacity: 0;
    transform: translateX(-4px);
    transition: all .2s;
    color: #b45309;
    margin-inline-start: 2px;
}
.sp-chip-sub:hover {
    background: #fff7d6;
    border-color: #ffc20e;
    color: #78350f;
    transform: translateX(-2px);
}
.sp-chip-sub:hover .sp-chip-arrow {
    opacity: 1;
    transform: translateX(0);
}
.sp-chip-sub.active {
    background: #fff7d6;
    border-color: #ffc20e;
    color: #78350f;
    font-weight: 800;
}
.sp-chip-sub.active .sp-chip-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* =====================================================
   فلش دراپ‌دان بزرگ‌تر و واضح‌تر
   ===================================================== */
.sp-chev {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    margin-inline-start: 4px;
    transition: transform .2s, color .2s;
    flex-shrink: 0;
}
.sp-chip:hover .sp-chev {
    color: #b45309;
}

/* چیپ‌های ویژگی کمی برجسته‌تر */
.sp-chips-filters .sp-chip {
    border-width: 1.5px;
}
.sp-chips-filters .sp-chip.active {
    background: #fff7d6;
    border-color: #ffc20e;
    color: #78350f;
    font-weight: 700;
}

/* =====================================================
   چیپ دسته اصلی — برجسته‌تر
   ===================================================== */
.sp-chip-main {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #334155;
    font-weight: 700;
    font-size: 13.5px;
    padding: 9px 16px;
    transition: all .15s;
}
.sp-chip-main:hover {
    background: #fff7d6;
    border-color: #ffc20e;
    color: #78350f;
    transform: translateY(-1px);
}
.sp-chip-main.active {
    background: #ffc20e;
    border-color: #ffc20e;
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(255,194,14,.35);
}

/* =====================================================
   موبایل: فاصله و اندازه بهتر
   ===================================================== */
@media (max-width: 900px) {
    .sp-chips-hint {
        font-size: 11.5px;
        padding: 0 4px;
    }
    .sp-chip-main {
        padding: 8px 14px;
        font-size: 13px;
    }
    .sp-chip-sub {
        padding: 7px 12px;
        font-size: 12.5px;
    }
    .sp-chev {
        width: 13px;
        height: 13px;
    }
}

/* =====================================================
   سطح ۱: فشرده + نشانگر اتصال
   ===================================================== */
.sp-chips-stack {
    margin-bottom: 12px;
    position: relative;
}

.sp-chips-main {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.sp-chips-main::-webkit-scrollbar { display: none; }

.sp-chip-main {
    flex: 0 0 auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 99px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
}
.sp-chip-main:hover {
    background: #fff7d6;
    border-color: #ffc20e;
    color: #78350f;
}
.sp-chip-main.active {
    background: #ffc20e;
    border-color: #ffc20e;
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(255,194,14,.3);
}

/* خط منحنی اتصال — absolute، بدون فضا */
.sp-connect-line {
    position: absolute;
    right: 0;
    pointer-events: none;
    display: none; /* فقط وقتی دسته فعال داریم نمایش داده می‌شود */
    transform-origin: right top;
    transition: right .25s ease, top .25s ease;
    z-index: 1;
}
.sp-chips-stack.has-active .sp-connect-line {
    display: block;
}

/* ردیف زیردسته‌ها */
.sp-chips-sub {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
}
.sp-chips-sub::-webkit-scrollbar { display: none; }

.sp-chip-sub {
    flex: 0 0 auto;
    background: #fffbea;
    border: 1px solid #fde68a;
    color: #92400e;
    font-weight: 600;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 99px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    position: relative;
}
.sp-chip-sub:hover {
    background: #fff3c4;
    border-color: #ffc20e;
    color: #78350f;
}
.sp-chip-sub.active {
    background: #ffc20e;
    border-color: #ffc20e;
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(255,194,14,.3);
}

/* خط عمودی در ابتدای ردیف زیردسته‌ها — سمت چپ */
.sp-chips-sub::before {
    content: "";
    position: absolute;
    left: 0;            /* ← چپ */
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, transparent 0%, #ffc20e 30%, #ffc20e 70%, transparent 100%);
    border-radius: 2px;
    opacity: 0;
    transition: opacity .2s;
}
.sp-chips-stack.has-active .sp-chips-sub::before {
    opacity: 1;
}

/* موبایل */
@media (max-width: 900px) {
    .sp-chip-main { font-size: 12.5px; padding: 6px 12px; }
    .sp-chip-sub  { font-size: 12px;   padding: 5px 10px; }
}
