﻿/* =================================
   ARIONepc PRODUCTS PAGE
================================= */

.products-page {
    width: 100%;
    min-height: 600px;
    background: #ffffff;
    padding: 30px 0 60px;
}


/* =================================
   PAGE HEADER
================================= */

.products-page-header {
    width: calc(100% - 40px);
    max-width: 1450px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}


    .products-page-header h1 {
        font-size: 28px;
        font-weight: 800;
        color: #26332d;
        margin-bottom: 7px;
    }


    .products-page-header p {
        color: var(--text-soft);
        font-size: 13px;
    }


/* =================================
   SORT
================================= */

.sort-box {
    display: flex;
    align-items: center;
    gap: 8px;
}


    .sort-box label {
        color: #79837e;
        font-size: 12px;
    }


    .sort-box select {
        height: 42px;
        padding: 0 13px;
        min-width: 150px;
        border: 1px solid var(--border);
        border-radius: 11px;
        background: #ffffff;
        color: #39443f;
        font-family: inherit;
        font-size: 12px;
        outline: none;
        cursor: pointer;
    }


        .sort-box select:focus {
            border-color: var(--green);
        }


/* =================================
   LAYOUT
================================= */

.products-layout {
    width: calc(100% - 40px);
    max-width: 1450px;
    margin: auto;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 25px;
    align-items: start;
}


/* =================================
   FILTER
================================= */

.products-filter {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(40,70,55,.04);
    position: sticky;
    top: 125px;
}


.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 17px;
    border-bottom: 1px solid #edf1ee;
}


    .filter-header h2 {
        font-size: 16px;
        font-weight: 800;
        color: #29352f;
    }


    .filter-header button {
        border: none;
        background: transparent;
        color: var(--green-dark);
        font-family: inherit;
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
    }


/* =================================
   FILTER GROUP
================================= */

.filter-group {
    padding: 20px 0;
    border-bottom: 1px solid #edf1ee;
}


    .filter-group:last-of-type {
        border-bottom: none;
    }


.filter-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 800;
    color: #38443e;
    margin-bottom: 14px;
}


    .filter-group-title span {
        color: #8b958f;
        font-size: 13px;
    }


/* =================================
   CHECKBOX OPTIONS
================================= */

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 11px;
}


    .filter-options label,
    .price-options label {
        display: flex;
        align-items: center;
        gap: 9px;
        color: #69756f;
        font-size: 12px;
        cursor: pointer;
    }


    .filter-options input,
    .price-options input {
        width: 16px;
        height: 16px;
        accent-color: var(--green-dark);
        cursor: pointer;
    }


/* =================================
   PRICE
================================= */

.price-options {
    display: flex;
    flex-direction: column;
    gap: 11px;
}


/* =================================
   AVAILABLE SWITCH
================================= */

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #69756f;
    font-size: 12px;
    cursor: pointer;
}


    .switch-row input {
        width: 40px;
        height: 21px;
        appearance: none;
        -webkit-appearance: none;
        background: #dfe7e2;
        border-radius: 20px;
        position: relative;
        cursor: pointer;
        transition: .25s;
    }


        .switch-row input::after {
            content: "";
            position: absolute;
            width: 17px;
            height: 17px;
            border-radius: 50%;
            background: white;
            top: 2px;
            right: 2px;
            transition: .25s;
            box-shadow: 0 2px 5px rgba(0,0,0,.12);
        }


        .switch-row input:checked {
            background: var(--green-dark);
        }


            .switch-row input:checked::after {
                transform: translateX(-19px);
            }


/* =================================
   APPLY FILTER
================================= */

.apply-filter-button {
    display: none;
}


/* =================================
   PRODUCTS CONTENT
================================= */

.products-content {
    min-width: 0;
}


.results-info {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #8a938e;
    font-size: 11px;
    margin-bottom: 10px;
}


    .results-info #resultsCount {
        color: var(--green-dark);
        font-weight: 800;
    }


/* =================================
   PRODUCT GRID
================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}


    /* =================================
   PRODUCT CARD
   هماهنگ با کارت‌های قبلی
================================= */

    .products-grid .product-card {
        width: 100%;
        min-width: 0;
        height: 345px;
        background: white;
        border: 1px solid var(--border);
        border-radius: 18px;
        padding: 12px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: 0 5px 18px rgba(40,70,55,.045);
        transition: .3s ease;
    }


        .products-grid .product-card:hover {
            border-color: rgba(72,168,120,.35);
            box-shadow: 0 12px 30px rgba(40,70,55,.10);
            transform: translateY(-4px);
        }


    .products-grid .product-image {
        width: 100%;
        height: 220px;
        border-radius: 14px;
        background: #f7f9f8;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }


        .products-grid .product-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 12px;
            display: block;
            transition: transform .35s ease;
        }


    .products-grid .product-card:hover
    .product-image img {
        transform: scale(1.05);
    }


    .products-grid .product-info {
        display: flex;
        flex-direction: column;
        flex: 1;
        padding: 15px 5px 4px;
    }


        .products-grid .product-info h3 {
            font-size: 18px;
            font-weight: 700;
            line-height: 1.8;
            color: var(--text);
            margin: 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }


    .products-grid .product-price {
        margin-top: auto;
        display: flex;
        align-items: baseline;
        gap: 5px;
    }


        .products-grid .product-price strong {
            font-size: 17px;
            font-weight: 800;
            color: #202622;
        }


        .products-grid .product-price span {
            font-size: 11px;
            color: var(--text-soft);
        }


/* =================================
   HIDDEN RESULT
================================= */

.product-card.filtered-out {
    display: none !important;
}


.no-products {
    display: none;
    text-align: center;
    padding: 80px 20px;
    border: 1px dashed #dbe5df;
    border-radius: 18px;
    margin-top: 15px;
}


    .no-products.show {
        display: block;
    }


    .no-products > div {
        font-size: 35px;
        margin-bottom: 12px;
    }


    .no-products h3 {
        font-size: 17px;
        margin-bottom: 7px;
    }


    .no-products p {
        color: #7c8781;
        font-size: 12px;
    }


/* =================================
   MOBILE FILTER BUTTON
================================= */

.mobile-filter-button {
    display: none;
}


/* =================================
   OVERLAY
================================= */

.filter-overlay {
    display: none;
}


/* =================================
   TABLET
================================= */

@media (max-width: 1200px) {

    .products-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }


    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* =================================
   MOBILE
================================= */

@media (max-width: 800px) {

    .products-page {
        padding-top: 20px;
    }


    .products-page-header {
        width: calc(100% - 16px);
        margin-bottom: 12px;
        align-items: flex-end;
    }


        .products-page-header h1 {
            font-size: 23px;
        }


        .products-page-header p {
            font-size: 11px;
        }


    .sort-box {
        flex-direction: column;
        align-items: flex-end;
        gap: 3px;
    }


        .sort-box select {
            height: 38px;
            min-width: 118px;
            font-size: 11px;
        }


    /* دکمه فیلتر */

    .mobile-filter-button {
        width: calc(100% - 16px);
        height: 44px;
        margin: 0 auto 15px;
        border: 1px solid var(--green-dark);
        border-radius: 12px;
        background: var(--green-light);
        color: var(--green-dark);
        font-family: inherit;
        font-size: 12px;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
    }


    .products-layout {
        width: calc(100% - 16px);
        display: block;
    }


    /* فیلتر موبایل */

    .products-filter {
        position: fixed;
        top: 0;
        right: -100%;
        width: 88%;
        max-width: 360px;
        height: 100vh;
        overflow-y: auto;
        border-radius: 0;
        z-index: 5000;
        padding: 22px;
        box-shadow: -12px 0 35px rgba(0,0,0,.12);
        transition: right .3s ease;
    }


        /* ✅ اصلاح شد: open → active */
        .products-filter.active {
            right: 0;
        }


    .filter-overlay {
        position: fixed;
        inset: 0;
        background: rgba(20,30,25,.35);
        z-index: 4500;
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: .3s;
    }


        /* ✅ اصلاح شد: show → active */
        .filter-overlay.active {
            opacity: 1;
            visibility: visible;
        }


    .apply-filter-button {
        display: block;
        width: 100%;
        height: 46px;
        margin-top: 20px;
        border: none;
        border-radius: 12px;
        background: var(--green-dark);
        color: white;
        font-family: inherit;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
    }


    /* محصولات */

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }


        .products-grid .product-card {
            height: 285px;
            padding: 8px;
            border-radius: 15px;
        }


        .products-grid .product-image {
            height: 175px;
            border-radius: 11px;
        }


            .products-grid .product-image img {
                padding: 8px;
            }


        .products-grid .product-info {
            padding: 10px 3px 3px;
        }


            .products-grid .product-info h3 {
                font-size: 14px;
                line-height: 1.7;
            }


        .products-grid .product-price strong {
            font-size: 14px;
        }


        .products-grid .product-price span {
            font-size: 9px;
        }


    .results-info {
        min-height: 35px;
        font-size: 10px;
    }
}
