/* -------------------- استایل‌های مربوط به آرشیو محصولات  -------------------- */



/* ساختار کلی آرشیو محصولات (فلکس باکس) */
.product-archive-layout {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}



/* -------------------- محصولات -------------------- */
.product-content {
    flex-grow: 1;
}

/* گرید محصولات */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    justify-content: center;
}

/* کارت محصول */
.product-item {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-align: center;
    padding-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 100%;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.product-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.product-item img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    margin: 0 auto 10px auto;
    border-bottom: 1px solid #eee;
}

.product-item h3 {
    font-size: 1.4em;
    padding: 0 10px;
    min-height: 45px;
}

.product-item h3 a {
    color: #34495e;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 600;
}

.product-item h3 a:hover {
    color: #059FB7;
}

.product-excerpt {
    font-size: 1em;
    color: #393939;
    line-height: 1.7;
    margin-bottom: 2px;
    padding: 5px 10px;
    flex-grow: 1;
}

.product-technical-specs {
    font-size: 0.8em;
    color: #777;
    line-height: 1.7;
    margin-bottom: 2px;
    padding: 5px 5px;
    flex-grow: 1;
}

.product-content,
.container.section-common,
.site-main {
    overflow: visible !important;
    height: auto !important;
    position: relative !important;
}



/* -------------------- Responsive Design (واکنش‌گرا) برای آرشیو محصولات -------------------- */
@media (max-width: 992px) {
    .product-archive-layout {
        flex-direction: column;
        align-items: center;
        padding: 0 15px;
    }

    .product-content {
        order: 0;
        width: 100%;
        max-width: 400px;
    }

    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 30px;
    }

    .product-item {
        max-width: 100%;
        margin: 0 auto;
        padding-bottom: 25px;
    }

    .product-item img {
        height: auto;
        margin-bottom: 5px;
    }

    .product-item h3 {
        font-size: 1.6em;
        min-height: 50px;
        padding: 0 20px;
    }

    .product-excerpt {
        font-size: 0.98em;
        margin-bottom: 10px;
        padding: 0 20px;
    }

    .read-more-button {
        padding: 12px 25px;
    }
}

@media (max-width: 576px) {
    .filter-sidebar,
    .product-content {
        max-width: 320px;
    }

    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .product-item {
        max-width: 100%;
        padding-bottom: 25px;
    }

    .product-item h3 {
        font-size: 1.3em;
    }

    .product-item img {
        height: auto;
    }

    .read-more-button {
        padding: 10px 20px;
    }

    .pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        padding: 8px 12px;
    }
}

@media (max-width: 576px) {
    .product-content {
        padding-bottom: 5px; /* فضای بیشتر */
    }

    .product-list {
        margin-bottom: 5px; /* فاصله بیشتر */
    }
}


/* -------------------- فیلتر محصولات مدرن -------------------- */
.filter-sidebar {
    flex-shrink: 0;
    width: 300px;
    background: linear-gradient(145deg, #ffffff, #f9f9f9);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

    top: 30px;
    height: fit-content;
    border: none;
}

/* تیتر فیلتر با آیکون  */
.filter-sidebar h4 {
    font-size: 1.2em;
    margin: 25px 0 20px;
    color: #2c3e50;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-sidebar h4::before {
    content: '\f0b0';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #033f61;
    font-size: 1em;
}

/* گروه چک‌باکس‌ها */
.category-checkboxes,
.brand-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 2px;
}

/* لیبل چک‌باکس به شکل کارت */
.filter-sidebar label {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.94em;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    gap: 10px;
}

.filter-sidebar label:hover {
    background-color: #D2D3D5;
    border-color: #033f61;
    color: #333 ;
    transform: translateX(3px);
}
.brand-logo {
    width: 30px; /* اندازه عرض لوگو را به ۲۵ پیکسل محدود می‌کند */
    height: auto; /* ارتفاع را به صورت خودکار تنظیم می‌کند تا تصویر از نسبت اصلی خارج نشود */
    margin-right: auto;
    margin-left: 5px;
}

/* چک‌باکس سفارشی */
.filter-sidebar input[type="checkbox"] {
    appearance: none;
    margin-right: 5px;
    width: 17px;
    height: 17px;
    border: 2px solid #bbb;
    border-radius: 4px;
    background-color: #fff;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;

}

.filter-sidebar input[type="checkbox"]:checked {
    background-color: #059FB7;
    border-color: #033f61;
}

.filter-sidebar input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* -------------------- Responsive Design -------------------- */
@media (max-width: 992px) {
    .filter-sidebar {
        position: static !important; /* یا relative */
        top: unset !important;
        width: 100%;
        max-width: 400px;
        margin: 0 auto 40px auto;
        padding: 20px;
        border-radius: 12px;
    }

    .filter-sidebar h4 {
        font-size: 1.1em;
        margin: 20px 0 15px;
    }

    .filter-sidebar label {
        font-size: 0.9em;
        padding: 7px 10px;
        gap: 8px;
    }

    .filter-sidebar input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-right: 8px;
        border-radius: 3px;
    }

    .filter-sidebar input[type="checkbox"]:checked::after {
        top: 2px;
        left: 4px;
        width: 3px;
        height: 7px;
    }
}

@media (max-width: 576px) {
    .filter-sidebar {
        max-width: 320px;
        padding: 15px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    }

    .filter-sidebar h4 {
        font-size: 1em;
        gap: 6px;
    }

    .filter-sidebar label {
        font-size: 0.88em;
        padding: 6px 9px;
    }

    .filter-sidebar input[type="checkbox"] {
        width: 15px;
        height: 15px;
        margin-right: 7px;
    }

    .filter-sidebar input[type="checkbox"]:checked::after {
        top: 2px;
        left: 4px;
        width: 3px;
        height: 6px;
    }
}



/* -------------------- فیلتر اکاردئونی -------------------- */

/* ساختار اصلی آکاردئون */
.accordion-toggle {
    cursor: pointer;
    position: relative; /* مطمئن شید که این هست */
    padding: 8px 0;
    font-weight: bold;
    transition: all 0.3s ease;
    /* این display: flex کمک میکنه که متن و فلش کنار هم باشن */
    display: flex;
    justify-content: space-between; /* متن و فلش رو به دو طرف میفرسته */
    align-items: center; /* فلش و متن رو در یک راستا قرار میده */
}

/* فلش زیبا در حالت پیش‌فرض (رو به پایین) */
.accordion-toggle::after {
    content: "";
    /* position: absolute;  وقتی display: flex استفاده میکنیم، نیازی به absolute نیست مگر برای موارد خاص */
    /* right: 0; */ /* این دیگه لازم نیست چون با flex جابجا میشه */
    /* top: 50%; */
    /* transform: translateY(-50%) rotate(135deg); */ /* چرخش در حالت عادی */
    width: 8px;
    height: 8px;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
    transform-origin: center;
    transition: transform 0.3s ease;
    /* margin-left: 8px; */ /* این فاصله رو میتونید با gap در flex تنظیم کنید */
    transform: rotate(135deg); /* فلش رو به پایین */
    flex-shrink: 0; /* مطمئن شه که فلش کوچک نمیشه */
}

/* وقتی آکاردئون باز شده (چرخش فلش به بالا) */
.accordion-toggle.active::after {
    transform: rotate(-45deg); /* فلش رو به بالا */
}

/* محتوای مخفی‌شونده */
.accordion-content {
    display: none;
    margin-top: 10px;
}

/* فاصله بین آیتم‌ها */
.filter-section {
    margin-bottom: 30px;
}

/* استایل لیبل‌ها (چک‌باکس‌ها) */
.filter-sidebar label {
    display: flex; /* تغییر به flex برای align کردن بهتر چک‌باکس و متن */
    align-items: center;
    margin-bottom: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* چک‌باکس‌ها */
.filter-sidebar input[type="checkbox"] {
    /* margin-left: 5px; */ /* اگر flex استفاده میکنید، بهتره از gap یا margin در والد استفاده کنید */
    transform: scale(1.1);
    cursor: pointer;
    margin-left: 5px; /* برای RTL, margin-left بعد از چک باکس بهتره */
}