/* =========================================================
   UPHAAR PRODUCT FILTER
   ========================================================= */

.uphaar-filter-layout {
    display: grid;

    grid-template-columns: 260px minmax(0, 1fr);

    gap: 40px;

    width: 100%;
    max-width: 100%;

    align-items: start;

    box-sizing: border-box;
}

.uphaar-filter-layout *,
.uphaar-filter-layout *::before,
.uphaar-filter-layout *::after {
    box-sizing: border-box;
}


/* =========================================================
   FILTER SIDEBAR
   ========================================================= */

.uphaar-product-filter {
    width: 100%;
    max-width: 260px;

    margin: 0;

    box-sizing: border-box;
}


/* =========================================================
   FILTER HEADER
   ========================================================= */

.uphaar-filter-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 25px;
}

.uphaar-filter-header h3 {
    margin: 0;

    font-size: 24px;
    line-height: 1.2;
}


/* Close button is mobile only */

.uphaar-filter-close {
    display: none;

    border: 0;
    background: transparent;

    font-size: 30px;
    line-height: 1;

    padding: 0;

    cursor: pointer;
}


/* =========================================================
   CLEAR BUTTON
   ========================================================= */

.uphaar-filter-clear {
    border: 0;

    background: transparent;

    padding: 0;

    cursor: pointer;

    font-size: 14px;

    text-decoration: underline;
}


/* =========================================================
   FILTER GROUP
   ========================================================= */

.uphaar-filter-group {
    width: 100%;

    margin-bottom: 25px;
}

.uphaar-filter-group h4 {
    margin: 0 0 12px;

    font-size: 17px;
    line-height: 1.3;
}


/* =========================================================
   FILTER OPTIONS
   ========================================================= */

.uphaar-filter-option {
    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    margin: 0 0 9px;

    cursor: pointer;

    font-size: 16px;
    line-height: 1.4;
}

.uphaar-filter-option input {
    flex: 0 0 auto;

    width: 16px;
    height: 16px;

    margin: 0;

    cursor: pointer;
}


/* =========================================================
   RESULTS
   ========================================================= */

.uphaar-filter-results {
    width: 100%;
    max-width: 100%;

    min-width: 0;
}


/* =========================================================
   RESULTS HEADER
   ========================================================= */

.uphaar-filter-results-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    width: 100%;

    margin-bottom: 20px;
}

.uphaar-product-count {
    font-weight: 600;
}

.uphaar-filter-loading {
    display: none;

    font-size: 14px;
}


/* =========================================================
   MOBILE FILTER BUTTON
   ========================================================= */

.uphaar-mobile-filter-trigger {
    display: none;

    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 10px 18px;

    border: 1px solid #0e4e4a;

    border-radius: 8px;

    background: #ffffff;

    color: #0e4e4a;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
}


/* =========================================================
   PRODUCT GRID
   ========================================================= */

.uphaar-products-grid {
    display: grid;

    width: 100%;
    max-width: 100%;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 25px;
}

.uphaar-product-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.uphaar-product-image {
    display: block;

    width: 100%;

    overflow: hidden;

    border-radius: 12px;
}

.uphaar-product-image img {
    display: block;

    width: 100%;
    max-width: 100%;

    height: auto;
}

.uphaar-product-content {
    width: 100%;

    padding-top: 12px;
}

.uphaar-product-title {
    margin: 0 0 8px;

    font-size: 16px;
    line-height: 1.4;

    overflow-wrap: anywhere;
}

.uphaar-product-title a {
    color: inherit;

    text-decoration: none;
}

.uphaar-product-price {
    font-weight: 600;
}


/* =========================================================
   NO RESULTS
   ========================================================= */

.uphaar-no-results {
    grid-column: 1 / -1;

    width: 100%;

    padding: 60px 20px;

    text-align: center;
}


/* =========================================================
   MOBILE FILTER FOOTER
   ========================================================= */

.uphaar-mobile-filter-footer {
    display: none;
}


/* =========================================================
   FILTER OVERLAY
   ========================================================= */

.uphaar-filter-overlay {
    display: none;
}


/* =========================================================
   LOADING
   ========================================================= */

.uphaar-product-filter.is-loading {
    opacity: 0.65;
}


/* =========================================================
   LARGE DESKTOP
   ========================================================= */

@media (min-width: 1200px) {

    .uphaar-products-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

    .uphaar-filter-layout {
        grid-template-columns: 220px minmax(0, 1fr);

        gap: 25px;
    }

    .uphaar-product-filter {
        max-width: 220px;
    }

    .uphaar-products-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 18px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    /* ---------------------------------------------
       Main layout
       --------------------------------------------- */

    .uphaar-filter-layout {
        display: block;

        width: 100%;
        max-width: 100%;
    }


    /* ---------------------------------------------
       Results
       --------------------------------------------- */

    .uphaar-filter-results {
        width: 100%;
        max-width: 100%;
    }


    /* ---------------------------------------------
       Results header
       --------------------------------------------- */

    .uphaar-filter-results-header {
        display: flex;

        align-items: center;
        justify-content: space-between;

        gap: 10px;

        margin-bottom: 20px;
    }


    /* ---------------------------------------------
       Mobile filter button
       --------------------------------------------- */

    .uphaar-mobile-filter-trigger {
        display: flex;
    }


    /* ---------------------------------------------
       Filter drawer
       --------------------------------------------- */

    .uphaar-product-filter {

        position: fixed;

        top: 0;
        right: 0;
        bottom: 0;

        z-index: 99999;

        width: 88%;
        max-width: 390px;

        height: 100vh;
        height: 100dvh;

        margin: 0;

        padding: 24px 20px 0;

        background: #ffffff;

        overflow-y: auto;

        transform: translateX(100%);

        transition:
            transform 0.3s ease;

        box-shadow:
            -8px 0 30px rgba(0, 0, 0, 0.12);
    }


    /* Drawer open */

    body.uphaar-filter-open .uphaar-product-filter {

        transform: translateX(0);

    }


    /* ---------------------------------------------
       Overlay
       --------------------------------------------- */

    .uphaar-filter-overlay {

        position: fixed;

        inset: 0;

        z-index: 99998;

        display: block;

        background:
            rgba(0, 0, 0, 0.45);

        opacity: 0;

        visibility: hidden;

        pointer-events: none;

        transition:
            opacity 0.3s ease,
            visibility 0.3s ease;
    }


    body.uphaar-filter-open .uphaar-filter-overlay {

        opacity: 1;

        visibility: visible;

        pointer-events: auto;
    }


    /* ---------------------------------------------
       Drawer header
       --------------------------------------------- */

    .uphaar-filter-header {

        position: sticky;

        top: -24px;

        z-index: 5;

        margin:

            -24px

            -20px

            20px;

        padding:

            18px

            20px;

        background: #ffffff;

        border-bottom:

            1px solid #eeeeee;
    }


    .uphaar-filter-header h3 {

        font-size: 22px;

    }


    .uphaar-filter-close {

        display: block;

        margin-left: auto;

    }


    .uphaar-filter-clear {

        display: none;

    }


    /* ---------------------------------------------
       Filter groups
       --------------------------------------------- */

    .uphaar-filter-group {

        margin-bottom: 25px;

    }


    .uphaar-filter-group h4 {

        font-size: 17px;

    }


    /* ---------------------------------------------
       Filter options
       --------------------------------------------- */

    .uphaar-filter-option {

        min-height: 40px;

        margin-bottom: 5px;

        font-size: 16px;

    }


    .uphaar-filter-option input {

        width: 18px;

        height: 18px;

    }


    /* ---------------------------------------------
       Mobile footer
       --------------------------------------------- */

    .uphaar-mobile-filter-footer {

        position: sticky;

        bottom: 0;

        z-index: 10;

        display: block;

        margin:

            20px

            -20px

            0;

        padding:

            15px

            20px;

        background: #ffffff;

        border-top:

            1px solid #eeeeee;

    }


    .uphaar-mobile-filter-count {

        display: block;

        margin-bottom: 10px;

        font-size: 14px;

        font-weight: 600;

    }


    .uphaar-mobile-filter-apply {

        display: block;

        width: 100%;

        padding: 13px 20px;

        border: 0;

        border-radius: 8px;

        background: #0e4e4a;

        color: #ffffff;

        font-size: 16px;

        font-weight: 600;

        cursor: pointer;
    }
    .uphaar-mobile-filter-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 10px;
}

.uphaar-mobile-filter-footer-top
.uphaar-mobile-filter-clear {
    display: block;

    font-size: 14px;

    color: #0e4e4a;

    text-decoration: none;
}


    /* ---------------------------------------------
       Product grid
       --------------------------------------------- */

    .uphaar-products-grid {

        width: 100%;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 18px 12px;
    }


    .uphaar-product-title {

        font-size: 14px;

        line-height: 1.35;

    }


    .uphaar-product-price {

        font-size: 14px;

    }


    /* ---------------------------------------------
       Prevent page scrolling while drawer open
       --------------------------------------------- */

    body.uphaar-filter-open {

        overflow: hidden;

    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .uphaar-product-filter {

        width: 92%;

    }

    .uphaar-products-grid {

        gap: 16px 10px;

    }

    .uphaar-product-title {

        font-size: 13px;

    }

}