/* =========================================================
   MaviHam Product Category
   ========================================================= */

.mavi-category-page {
    direction: rtl;
    padding: 45px 0 80px;
    background: #fff;
}

.mavi-category-container {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
}


/* =========================================================
   Category Header
   ========================================================= */

.mavi-category-header {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 55px;
    align-items: center;

    margin-bottom: 50px;
    padding: 35px;

    background: #f8f9fb;
    border: 1px solid #edf0f4;
    border-radius: 18px;
}


/* Title */

.mavi-category-title-row {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 20px;
}

.mavi-category-title-row h1 {
    margin: 0;

    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.4;
    font-weight: 800;

    color: #171b22;
}

.mavi-category-line {
    width: 5px;
    height: 38px;

    flex: 0 0 auto;

    background: #2167e8;
    border-radius: 5px;
}


/* Description */

.mavi-category-description {
    max-width: 760px;

    color: #626b78;

    font-size: 15px;
    line-height: 2.15;
}

.mavi-category-description p {
    margin: 0 0 12px;
}

.mavi-category-description p:last-child {
    margin-bottom: 0;
}


/* Category image */

.mavi-category-image {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 230px;

    background: #fff;

    border-radius: 14px;
    overflow: hidden;
}

.mavi-category-image img {
    display: block;

    width: 100%;
    height: 260px;

    object-fit: contain;

    transition: transform .3s ease;
}

.mavi-category-image:hover img {
    transform: scale(1.03);
}


/* =========================================================
   Products
   ========================================================= */

.mavi-category-products {
    width: 100%;
}


/* Toolbar */

.mavi-category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;

    padding-bottom: 18px;

    border-bottom: 1px solid #e9edf2;
}

.mavi-category-count {
    color: #6b7280;

    font-size: 14px;
    font-weight: 600;
}


/* WooCommerce ordering */

.mavi-category-order .woocommerce-ordering {
    margin: 0;
    float: none;
}

.mavi-category-order select {
    min-width: 190px;

    padding: 10px 38px 10px 14px;

    border: 1px solid #dfe4ea;
    border-radius: 8px;

    background: #fff;

    color: #343a40;

    font-family: inherit;
    font-size: 13px;
}


/* =========================================================
   Product Grid
   ========================================================= */

/*
 * WooCommerce خودش ساختار ul.products را تولید می‌کند.
 * اینجا فقط ظاهر Grid را کنترل می‌کنیم.
 */

.mavi-category-products ul.products {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 25px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.mavi-category-products ul.products::before,
.mavi-category-products ul.products::after {
    display: none !important;
}

.mavi-category-products ul.products li.product {
    width: auto !important;
    float: none !important;

    margin: 0 !important;
}


/* =========================================================
   Pagination
   ========================================================= */

.mavi-category-pagination {
    margin-top: 45px;

    display: flex;
    justify-content: center;
}

.mavi-category-pagination .page-numbers {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.mavi-category-pagination .page-numbers li {
    list-style: none;
}

.mavi-category-pagination .page-numbers a,
.mavi-category-pagination .page-numbers span {
    display: flex;

    align-items: center;
    justify-content: center;

    min-width: 40px;
    height: 40px;

    padding: 0 10px;

    border: 1px solid #e2e6eb;
    border-radius: 8px;

    color: #333;

    background: #fff;

    font-size: 13px;
    text-decoration: none;

    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease;
}

.mavi-category-pagination .page-numbers a:hover {
    color: #2167e8;
    border-color: #2167e8;
}

.mavi-category-pagination .page-numbers .current {
    color: #fff;

    background: #2167e8;
    border-color: #2167e8;
}


/* =========================================================
   Empty State
   ========================================================= */

.mavi-category-empty {
    padding: 70px 20px;

    text-align: center;

    border: 1px solid #edf0f4;
    border-radius: 16px;

    background: #fafbfc;
}

.mavi-category-empty h2 {
    margin: 0 0 10px;

    font-size: 22px;
    color: #20242a;
}

.mavi-category-empty p {
    margin: 0 0 25px;

    color: #707782;
}

.mavi-category-back {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 0 22px;

    border-radius: 8px;

    background: #2167e8;
    color: #fff;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;
}

.mavi-category-back:hover {
    color: #fff;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1024px) {

    .mavi-category-header {
        grid-template-columns: 1fr 280px;

        gap: 30px;

        padding: 28px;
    }

    .mavi-category-products ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));

        gap: 20px;
    }

}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767px) {

    .mavi-category-page {
        padding: 25px 0 55px;
    }

    .mavi-category-container {
        width: min(100% - 24px, 600px);
    }

    .mavi-category-header {
        grid-template-columns: 1fr;

        gap: 25px;

        padding: 20px;

        margin-bottom: 35px;

        border-radius: 14px;
    }

    .mavi-category-title-row {
        margin-bottom: 14px;
    }

    .mavi-category-title-row h1 {
        font-size: 25px;
    }

    .mavi-category-line {
        width: 4px;
        height: 30px;
    }

    .mavi-category-description {
        font-size: 14px;
        line-height: 2;
    }

    .mavi-category-image {
        min-height: 190px;
    }

    .mavi-category-image img {
        height: 190px;
    }

    .mavi-category-toolbar {
        align-items: flex-start;

        flex-direction: column;

        margin-bottom: 20px;
    }

    .mavi-category-order {
        width: 100%;
    }

    .mavi-category-order .woocommerce-ordering {
        width: 100%;
    }

    .mavi-category-order select {
        width: 100%;
    }

    .mavi-category-products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 14px;
    }

}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 480px) {

    .mavi-category-products ul.products {
        gap: 10px;
    }

    .mavi-category-title-row h1 {
        font-size: 22px;
    }

    .mavi-category-description {
        font-size: 13px;
    }

}