﻿/* =========================================================
   Shop Layout
========================================================= */

.shop-layout {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 30px 0 50px;
    position: relative;
    gap: 30px;
}

/* =========================================================
   Shop Sidebar
========================================================= */

.shop-sidebar {
    width: 27%;
    transition: none;
}

.filter-title {
    display: none;
}

.shop-overlay {
    display: none;
}

.filters-layout {
    display: flex;
    flex-direction: column;
    row-gap: 20px;
    position: sticky;
    top: 30px;
}

/* =========================================================
   Shop Content
========================================================= */

.shop-content {
    width: 70%;
    min-width: 0;
}

/* =========================================================
   Shop Accordion
========================================================= */

.shop-sidebar-item {
    background: var(--white);
    border-radius: 4px;
    width: 100%;
    border: 1px solid var(--grey220);
}

/* Button */

.shop-sidebar-btn {
    width: 100%;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--secondary);
    color: var(--black);
    cursor: pointer;
    outline: none;
    transition: color 0.3s ease;
    border-start-start-radius: 4px;
    border-start-end-radius: 4px;
}

.shop-sidebar-btn-active {
    color: var(--primary);
    border-bottom: 1px solid var(--grey220);
}

.shop-sidebar-btn span {
    text-align: start;
}

.shop-filter-icon-active {
    color: var(--primary);
}

.shop-sidebar-btn .icon {
    transition: transform 0.3s ease;
}

/* =========================================================
   Accordion Content
========================================================= */

.shop-sidebar-content {
    overflow: hidden;
    background: var(--white);
    transition: max-height 0.4s ease;
    border: 2px solid var(--secondary);
    border-top: none;
    border-end-start-radius: 4px;
    border-end-end-radius: 4px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* =========================================================
   Filter Icon
========================================================= */

.shop-filter-icon {
    font-size: 20px;
}

/* =========================================================
   Category Filter
========================================================= */

.shop-cat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
}

/* =========================================================
   Price Slider
========================================================= */

.price-slider-container {
    width: 100%;
    position: relative;
}

/* All Values */

.values {
    display: flex;
    justify-content: center;
    column-gap: 5px;
    margin: 10px 0 0;
    font-size: 14px;
}

    .values span {
        color: var(--primary);
        white-space: nowrap;
    }

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 8px;
    background-color: var(--secondary);
    border-radius: 4px;
    margin-top: 15px;
    direction: ltr;
}

.progress {
    position: absolute;
    background-color: var(--primary);
    height: 100%;
    border-radius: 4px;
    z-index: 1;
}

.range-input {
    position: relative;
    width: 100%;
    direction: ltr;
}

    .range-input input[type="range"] {
        position: absolute;
        top: -6px;
        height: 8px;
        width: 100%;
        background: transparent;
        pointer-events: none;
        -webkit-appearance: none;
        appearance: none;
        margin: 0;
    }

        /* =========================================================
   Range Input Handles
========================================================= */

        .range-input input[type="range"]::-webkit-slider-thumb {
            pointer-events: all;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--secondary);
            border: 3px solid var(--primary);
            box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            -webkit-appearance: none;
            appearance: none;
            margin-top: -8px;
            position: relative;
            z-index: 3;
            transition: background-color 0.2s ease;
        }

        .range-input input[type="range"]::-moz-range-thumb {
            pointer-events: all;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--secondary);
            border: 3px solid var(--primary);
            box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            appearance: none;
            transition: background-color 0.2s ease;
        }

        .range-input input[type="range"]::-webkit-slider-runnable-track {
            background: transparent;
            border: none;
            height: 8px;
        }

        .range-input input[type="range"]::-moz-range-track {
            background: transparent;
            border: none;
            height: 8px;
        }

        .range-input input[type="range"]:focus::-webkit-slider-thumb {
            background-color: var(--secondary);
        }

        .range-input input[type="range"]:focus {
            outline: none;
        }

/* =========================================================
   Sort Layout
========================================================= */

.sort-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px;
    background-color: var(--secondary);
    border-radius: 4px;
    border: 1px solid var(--grey220);
    gap: 10px;
}

    .sort-layout select {
        outline: none;
        padding: 2px;
        border-radius: 2px;
        color: var(--primary);
        border: 1px solid var(--grey220);
        max-width: 100%;
    }

/* =========================================================
   Products Layout
========================================================= */

.product-layout {
    margin: 20px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: space-between;
    gap: 30px 20px;
    width: 100%;
}

    /* =========================================================
   Product Item
========================================================= */

    .product-layout .product-item {
        cursor: pointer;
        width: 100%;
        min-width: 0;
        border-start-end-radius: 50%;
        border-start-start-radius: 50%;
        border-end-end-radius: 8px;
        border-end-start-radius: 8px;
        transition: transform 0.5s ease;
        overflow: hidden;
    }

        .product-layout .product-item:hover {
            transform: scale(1.03);
        }

/* =========================================================
   Product Top / Image
   Ratio = 3 / 5
========================================================= */

.product-item .product-top {
    position: relative;
    width: 100%;
    /* مهم: نسبت تصویر 3 به 5 */
    aspect-ratio: 3 / 5;
    /* جلوگیری از کش آمدن بیش از حد */
    min-height: 0;
    padding: 10px;
    display: flex;
    align-items: end;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-start-end-radius: 50%;
    border-start-start-radius: 50%;
    border: 1px solid var(--grey220);
    overflow: hidden;
}

/* =========================================================
   Product Bottom
========================================================= */

.product-item .bottom-product {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--secondary);
    padding: 10px;
    border-end-end-radius: 8px;
    border-end-start-radius: 8px;
    border: 1px solid var(--grey220);
    border-top: unset;
    min-width: 0;
}

/* =========================================================
   Product Title
========================================================= */

.bottom-product .product-title {
    color: var(--primary);
    line-height: 1.8;
    overflow: hidden;
}

/* =========================================================
   Latin Title
========================================================= */

.bottom-product .latin-title {
    color: gray;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
    text-align: justify;
    line-height: 1.7;
    overflow: hidden;
}

/* =========================================================
   Product Price / Button
========================================================= */

.bottom-product .btn-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

    .bottom-product .btn-price button {
        font-size: 12px;
        border: 2px solid var(--primary);
        border-radius: 2px;
        color: var(--white);
        background-color: var(--primary);
        padding: 3px 5px;
        height: fit-content;
        width: fit-content;
        transition: all 0.5s ease;
        cursor: pointer;
        white-space: nowrap;
    }

        .bottom-product .btn-price button:hover {
            background-color: var(--secondary);
            color: var(--primary);
        }

    .bottom-product .btn-price div {
        display: flex;
        flex-direction: column;
        row-gap: 2px;
        align-items: flex-end;
        min-width: 0;
    }

    .bottom-product .btn-price p:nth-child(1) {
        font-size: 12px;
        color: gray;
        text-decoration: line-through;
        white-space: nowrap;
    }

    .bottom-product .btn-price p:nth-child(2) {
        font-size: 14px;
        color: var(--black);
        transition: all 0.5s ease;
        white-space: nowrap;
    }

/* =========================================================
   Mobile Filter Button
========================================================= */

.filter-mobile-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: none;
    background-color: var(--secondary);
    border: 2px solid var(--primary);
    box-shadow: 0 0 5px var(--black);
    z-index: 20;
}

    .filter-mobile-btn:hover {
        background-color: var(--primary);
        color: var(--white);
    }

/* =========================================================
   Desktop
========================================================= */

@media (min-width: 1151px) {

    .product-item .product-top {
        aspect-ratio: 3 / 5;
    }
}

/* =========================================================
   Tablet - 2 Products
========================================================= */

@media (max-width: 1150px) {

    .product-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 25px 20px;
    }

    .product-item .product-top {
        aspect-ratio: 3 / 5;
    }
}

/* =========================================================
   Hide Mobile Filter List on Desktop
========================================================= */

@media (min-width: 992px) {

    .mobile-filter-list {
        display: none;
    }
}

/* =========================================================
   Tablet / Mobile - 992px
========================================================= */

@media (max-width: 992px) {

    /* Shop Layout */

    .shop-layout {
        display: block;
        margin: 20px 0 40px;
    }

    /* Hide Sidebar */

    .shop-sidebar {
        display: none;
    }

    /* Overlay */

    .shop-overlay {
        top: 0;
        left: 0;
        position: fixed;
        display: none;
        transition: opacity 0.5s ease-out;
        opacity: 0;
        background-color: rgba(0, 0, 0, 0.7);
        width: 100vw;
        height: 100vh;
        z-index: 5;
    }

        .shop-overlay.open {
            display: block;
            opacity: 1;
        }

    /* Remove Padding */

    .unset-padding {
        padding: 0 !important;
    }

    /* Filter Title */

    .filter-title {
        display: flex;
        justify-content: center;
        padding: 10px 0;
        font-weight: bold;
        color: var(--primary);
    }

    /* Mobile Filter List */

    .mobile-filter-list {
        position: fixed;
        max-height: 80vh;
        height: fit-content !important;
        background-color: var(--white);
        width: 100%;
        z-index: 10;
        border-top: 1px solid var(--primary);
        padding: 20px;
        overflow-y: auto;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
        transition: transform 0.5s ease;
    }

        .mobile-filter-list.open {
            transform: translateY(0);
            height: fit-content !important;
        }

    /* Filter Button */

    .filter-mobile-btn {
        display: flex;
        column-gap: 5px;
        align-items: center;
        justify-content: center;
    }

    /* Shop Content */

    .shop-content {
        width: 100%;
        padding: 0 20px;
    }

    /* Products */

    .product-layout {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 25px 20px;
    }

    .product-item .product-top {
        aspect-ratio: 3 / 5;
    }
}

/* =========================================================
   Mobile - 768px
========================================================= */

@media (max-width: 768px) {

    .shop-content {
        padding: 0 15px;
    }

    .product-layout {
        gap: 20px 15px;
    }

    /*
       حفظ نسبت 3 به 5
    */

    .product-item .product-top {
        aspect-ratio: 3 / 5;
        height: auto;
        min-height: 0;
        padding: 8px;
    }

    .product-layout .product-item:hover {
        transform: none;
    }

    .bottom-product {
        padding: 10px;
    }

        .bottom-product .product-title {
            font-size: 14px;
        }

        .bottom-product .latin-title {
            font-size: 11px;
        }

        .bottom-product .btn-price button {
            font-size: 11px;
            padding: 4px 6px;
        }

        .bottom-product .btn-price p:nth-child(1) {
            font-size: 10px;
        }

        .bottom-product .btn-price p:nth-child(2) {
            font-size: 13px;
        }
}

/* =========================================================
   Mobile - 600px
========================================================= */

@media (max-width: 600px) {

    .shop-layout {
        margin-top: 15px;
    }

    .shop-content {
        width: 100%;
        padding: 0 12px;
    }

    /*
       One product per row
    */

    .product-layout {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
        margin-top: 15px;
    }

        /*
       Full width product card
    */

        .product-layout .product-item {
            width: 100%;
            max-width: 100%;
            margin: 0;
        }

    /*
       ================================================
       مهم‌ترین قسمت موبایل
       نسبت عکس دقیقاً 3 به 5
       ================================================
    */

    .product-item .product-top {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 3 / 5;
        padding: 8px;
        background-size: cover;
        background-position: center;
    }

    /*
       Product Bottom
    */

    .product-item .bottom-product {
        width: 100%;
        padding: 12px;
        gap: 8px;
    }

    /*
       Product Title
    */

    .bottom-product .product-title {
        font-size: 14px;
        line-height: 1.9;
    }

    /*
       Latin Title
    */

    .bottom-product .latin-title {
        font-size: 11px;
        line-height: 1.8;
    }

    /*
       Price and Button
    */

    .bottom-product .btn-price {
        width: 100%;
        margin-bottom: 5px;
    }

        .bottom-product .btn-price button {
            font-size: 11px;
            padding: 5px 8px;
        }

        .bottom-product .btn-price p:nth-child(1) {
            font-size: 10px;
        }

        .bottom-product .btn-price p:nth-child(2) {
            font-size: 13px;
        }
}

/* =========================================================
   Small Mobile - 400px
========================================================= */

@media (max-width: 400px) {

    .shop-content {
        padding: 0 10px;
    }

    .product-layout {
        gap: 20px;
    }

    /*
       همچنان نسبت 3 به 5
    */

    .product-item .product-top {
        aspect-ratio: 3 / 5;
        height: auto;
        min-height: 0;
    }

    .product-item .bottom-product {
        padding: 10px;
    }

    .bottom-product .product-title {
        font-size: 13px;
    }

    .bottom-product .latin-title {
        font-size: 10px;
    }

    .bottom-product .btn-price button {
        font-size: 10px;
        padding: 4px 6px;
    }

    .bottom-product .btn-price p:nth-child(2) {
        font-size: 12px;
    }
}

/* =========================================================
   Very Small Mobile - 350px
========================================================= */

@media (max-width: 350px) {

    .shop-content {
        padding: 0 8px;
    }

    .product-layout {
        gap: 20px;
    }

    /*
       نسبت ثابت 3 به 5
    */

    .product-item .product-top {
        aspect-ratio: 3 / 5;
        height: auto;
        min-height: 0;
    }

    .bottom-product .btn-price {
        gap: 5px;
    }

        .bottom-product .btn-price button {
            font-size: 9px;
            padding: 4px 5px;
        }

        .bottom-product .btn-price p:nth-child(2) {
            font-size: 11px;
        }
}

/* =========================================================
   Order Table Pagination
========================================================= */

.order-table-pagination {
    display: flex;
    align-items: center;
    margin: 30px auto 0;
    gap: 15px;
    justify-content: center;
}

    .order-table-pagination span {
        cursor: pointer;
        font-size: 14px;
        padding: 0 3px;
        transition: all 0.5s ease;
    }

        .order-table-pagination span:hover {
            color: var(--primary);
        }

        .order-table-pagination span.active {
            color: var(--primary);
            border-bottom: 2px solid var(--primary);
        }
