/* ==================================================
   HEMRITU CATEGORY PAGE
   Product Grid
================================================== */

/* Desktop */
@media (min-width: 992px){

    body.woocommerce.archive ul.products{
        display:grid !important;
        grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
        gap:28px 20px !important;
    }

    body.woocommerce.archive ul.products li.product{
        width:100% !important;
        margin:0 !important;
        float:none !important;
    }
}

/* Mobile */
@media (max-width: 767px){

    body.woocommerce.archive ul.products{
        display:grid !important;
        grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
        gap:20px 12px !important;
    }

    body.woocommerce.archive ul.products li.product{
        width:100% !important;
        margin:0 !important;
        float:none !important;
    }
}
/* ==================================================
   CATEGORY TOP BANNER
================================================== */

.woocommerce.archive .hemritu-category-banner{
    width:100%;
    aspect-ratio:4 / 1;
    margin:0 0 40px;
    overflow:hidden;
}

.woocommerce.archive .hemritu-category-banner-image{
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
}

/* Hide Category Breadcrumb and Title */

body.tax-product_cat .woocommerce-breadcrumb,
body.tax-product_cat .woocommerce-products-header{
    display:none !important;
}

/* ==================================================
   HEMRITU RELATIVE CATEGORY NAVIGATION
================================================== */

.hemritu-category-navigation{
    width:100%;
    margin:40px 0 45px;
}

/* All Levels */
.hemritu-category-level{
    width:100%;
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    align-items:flex-start;
}

/* Category Card */
.hemritu-category-card{
    display:block;
    box-sizing:border-box;
    text-align:center;
    text-decoration:none !important;
    border:1px solid #e5e7eb;
    background:#fff;
    overflow:hidden;
}

/* Image */
.hemritu-category-card-image{
    width:100%;
    aspect-ratio:1 / 1;
    overflow:hidden;
    background:#fff;
    border-bottom:1px solid #e5e7eb;
}

.hemritu-category-card-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

/* Category Name */
.hemritu-category-card-name{
    padding:10px 8px;
    color:#111827;
    font-size:14px;
    font-weight:600;
    line-height:1.3;
}


/* LEVEL 1 — 4 per row */
.hemritu-category-level-1{
    gap:24px;
    margin-bottom:35px;
}

.hemritu-category-level-1 .hemritu-category-card{
    flex:0 0 calc((100% - 72px) / 4);
}


/* LEVEL 2 — 5 per row */
.hemritu-category-level-2{
    gap:20px;
    margin-bottom:30px;
}

.hemritu-category-level-2 .hemritu-category-card{
    flex:0 0 calc((100% - 80px) / 5);
}


/* LEVEL 3 — 6 per row */
.hemritu-category-level-3{
    gap:18px;
    margin-bottom:30px;
}

.hemritu-category-level-3 .hemritu-category-card{
    flex:0 0 calc((100% - 90px) / 6);
}

/* ==================================================
   CATEGORY CARD SIZE & VISUAL POLISH
================================================== */

.hemritu-category-card{
    padding:12px;
    border:1px solid #e5e7eb;
    background:#fafafa;
    border-radius:2px;
}

/* Image ko card ke andar chhota rakho */
.hemritu-category-card-image{
    width:85%;
    margin:0 auto;
    border:1px solid #eeeeee;
    background:#ffffff;
}

/* Name */
.hemritu-category-card-name{
    margin-top:10px;
    padding:8px 5px 2px;
    border-top:1px solid #e5e7eb;
}

/* Level 1: 4 cards, but controlled width */
.hemritu-category-level-1 .hemritu-category-card{
    flex-basis:220px;
    max-width:220px;
}

/* Level 2 */
.hemritu-category-level-2 .hemritu-category-card{
    flex-basis:170px;
    max-width:170px;
}

/* Level 3 */
.hemritu-category-level-3 .hemritu-category-card{
    flex-basis:130px;
    max-width:130px;
}

/* ==================================================
   MOBILE — ALL CATEGORY LEVELS 2 PER ROW
================================================== */

@media (max-width:767px){

    .hemritu-category-level-1,
    .hemritu-category-level-2,
    .hemritu-category-level-3{
        display:grid !important;
        grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
        gap:12px !important;
        width:100% !important;
    }

    .hemritu-category-level-1 .hemritu-category-card,
    .hemritu-category-level-2 .hemritu-category-card,
    .hemritu-category-level-3 .hemritu-category-card{
        width:100% !important;
        max-width:none !important;
        flex:none !important;
        margin:0 !important;
    }
}

/* ==================================================
   EQUAL HEIGHT CATEGORY CARDS
================================================== */

.hemritu-category-card{
    height:100% !important;
    display:flex !important;
    flex-direction:column !important;
}

/* Name area same height */
.hemritu-category-card-name{
    min-height:58px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    box-sizing:border-box !important;
}

/* ==================================================
   HEMRITU CATEGORY PRODUCT CARD
================================================== */

/* Product Card */
body.woocommerce.archive ul.products li.product{
    display:flex !important;
    flex-direction:column !important;
    height:100% !important;
}

/* Product Image Area */
body.woocommerce.archive ul.products li.product a img{
    width:100% !important;
    aspect-ratio:1 / 1 !important;
    object-fit:contain !important;
    margin:0 !important;
}

/* Product Title - Maximum 2 Lines */
body.woocommerce.archive ul.products li.product .woocommerce-loop-product__title{
    display:-webkit-box !important;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden !important;

    line-height:1.35 !important;
    height:2.7em !important;
    margin:8px 0 !important;
}

/* Hide Astra Sale badge on category + shop pages */
body.tax-product_cat .ast-on-card-button.ast-onsale-card,
body.woocommerce-shop .ast-on-card-button.ast-onsale-card{
    display:none !important;
}

/* Discount badge — old Sale badge position */
body.tax-product_cat ul.products li.product,
body.woocommerce-shop ul.products li.product{
    position:relative !important;
}

body.tax-product_cat .hemritu-loop-discount,
body.woocommerce-shop .hemritu-loop-discount{
    position:absolute !important;
    top:10px !important;
    left:10px !important;
    right:auto !important;

    width:54px !important;
    height:54px !important;
    min-width:54px !important;
    min-height:54px !important;
    padding:0 !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    border-radius:50% !important;

    /* Same gold style as product page */
    background:#e6a000 !important;
    color:#ffffff !important;

    font-size:10px !important;
    font-weight:700 !important;
    line-height:1 !important;
    white-space:nowrap !important;

    z-index:10 !important;
    box-sizing:border-box !important;
}

/* Product image and category name gap */
body.tax-product_cat ul.products li.product .ast-woo-product-category{
    display:block !important;
    margin-top:10px !important;
}

/* Hide Astra default category name */
body.tax-product_cat ul.products li.product
.ast-woo-product-category{
    display:none !important;
}

/* Deepest category name */
body.tax-product_cat .hemritu-loop-category{
    margin-top:10px;
    margin-bottom:6px;

    font-size:12px;
    line-height:1.3;
    color:#8a8a8a;
}

/* ==================================================
   PRODUCT GROUP BADGE — TOP RIGHT
================================================== */

body.tax-product_cat ul.products li.product{
    position:relative !important;
}

body.tax-product_cat .hemritu-product-group-badge{
    position:absolute;
    top:10px;
    right:10px;
    z-index:12;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:6px 10px;
    border-radius:4px;

    background:#111827;
    color:#ffffff;

    font-size:10px;
    font-weight:700;
    line-height:1;
    text-transform:uppercase;
    white-space:nowrap;
}

/* Hide Astra on-image Add to Cart icon on category product cards */
body.tax-product_cat ul.products li.product
.ast-on-card-button:not(.ast-onsale-card){
    display:none !important;
}


/* ==================================================
   PRODUCT GROUP BADGE
================================================== */

body.woocommerce.archive ul.products li.product{
    position:relative !important;
}

body.woocommerce.archive .hemritu-product-group-badge{
    position:absolute;
    z-index:30;

    margin:0 !important;
    padding:5px 7px !important;

    background:#111827;
    color:#fff;

    font-size:9px !important;
    font-weight:700;
    line-height:1 !important;

    border-radius:3px 0 0 0 !important;
    white-space:nowrap;
}

@media (max-width:767px){

    body.woocommerce.archive .hemritu-product-group-badge{
        padding:4px 5px !important;
        font-size:7px !important;
    }
}

/* Mobile - Smaller Discount Badge */
@media (max-width: 767px){

    body.tax-product_cat .hemritu-loop-discount,
    body.woocommerce-shop .hemritu-loop-discount{
        width:30px !important;
        height:30px !important;
        min-width:30px !important;
        min-height:30px !important;
        padding:0 !important;

        font-size:6px !important;
        line-height:1 !important;

        display:flex !important;
        align-items:center !important;
        justify-content:center !important;

        border-radius:50% !important;
    }
}


/* ==================================================
   FILTER SIDEBAR + PRODUCT AREA
================================================== */

.hemritu-shop-area{
    display:grid;
    grid-template-columns:240px minmax(0, 1fr);
    gap:30px;
    width:100%;
    align-items:start;
}

.hemritu-filter-sidebar{
    border:1px solid #e5e7eb;
    background:#fff;
    padding:18px;
}

.hemritu-filter-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;

    padding-bottom:14px;
    margin-bottom:15px;
    border-bottom:1px solid #e5e7eb;

    font-size:18px;
    font-weight:700;
}

.hemritu-clear-filters{
    padding:0;
    border:0;
    background:none;
    color:#777;
    font-size:12px;
    cursor:pointer;
}

.hemritu-products-area{
    min-width:0;
}


/* Products now use available right-side width */
@media (min-width:992px){

    .hemritu-products-area ul.products{
        grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
    }
}


/* MOBILE */
/* Mobile filter button hidden on desktop */
.hemritu-mobile-filter-button,
.hemritu-filter-overlay{
    display:none;
}


/* ==================================================
   MOBILE FILTER DRAWER
================================================== */

@media (max-width:767px){

    .hemritu-shop-area{
        display:block;
    }

    /* Filter Button */
    .hemritu-mobile-filter-button{
        display:flex;
        align-items:center;
        justify-content:center;
        gap:7px;

        width:100%;
        margin:0 0 18px;
        padding:12px 15px;

        border:1px solid #111827;
        background:#fff;
        color:#111827;

        font-size:14px;
        font-weight:700;
        cursor:pointer;
    }

    /* Sidebar Drawer */
    .hemritu-filter-sidebar{
        display:block !important;

        position:fixed;
        top:0;
        left:0;

        width:85%;
        max-width:320px;
        height:100vh;

        z-index:99999;
        overflow-y:auto;

        background:#fff;

        transform:translateX(-105%);
        transition:transform 0.3s ease;
    }

    .hemritu-filter-sidebar.hemritu-filter-open{
        transform:translateX(0);
    }

    /* Dark Overlay */
    .hemritu-filter-overlay{
        display:block;

        position:fixed;
        inset:0;

        background:rgba(0,0,0,0.45);
        z-index:99998;

        opacity:0;
        visibility:hidden;

        transition:
            opacity 0.3s ease,
            visibility 0.3s ease;
    }

    .hemritu-filter-overlay.hemritu-overlay-open{
        opacity:1;
        visibility:visible;
    }
}
/* ==================================================
   ATTRIBUTE FILTERS
================================================== */

.hemritu-filter-group{
    padding:15px 0;
    border-bottom:1px solid #e5e7eb;
}

.hemritu-filter-group:last-child{
    border-bottom:0;
}

.hemritu-filter-title{
    margin-bottom:10px;
    font-size:14px;
    font-weight:700;
    color:#111827;
}

.hemritu-filter-options{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.hemritu-filter-option{
    display:flex;
    align-items:center;
    gap:8px;
    cursor:pointer;

    font-size:13px;
    color:#4b5563;
}

.hemritu-filter-option input{
    width:15px;
    height:15px;
    margin:0;
    cursor:pointer;
}
/* ==================================================
   AJAX FILTER LOADING
================================================== */

.hemritu-products-area{
    position:relative;
    transition:opacity 0.2s ease;
}

.hemritu-products-area.hemritu-products-loading{
    opacity:0.35;
    pointer-events:none;
}

.hemritu-no-products{
    width:100%;
    padding:40px 20px;
    text-align:center;
    border:1px solid #e5e7eb;
    background:#fff;
    font-size:15px;
}


/* ==================================================
   MOBILE FILTER + SORTING — SAME SIZE & CLICKABLE
================================================== */

@media (max-width:767px){

    /* Result Count */
    body.tax-product_cat .woocommerce-result-count{
        width:100% !important;
        float:none !important;
        clear:both !important;
        margin:0 0 10px !important;
        font-size:12px !important;
    }

    /* FILTER BUTTON */
    .hemritu-mobile-filter-button{
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        gap:6px !important;

        width:48% !important;
        height:38px !important;
        margin:0 !important;
        padding:0 10px !important;

        float:left !important;

        border:1px solid #111827 !important;
        border-radius:4px !important;

        background:#fff !important;
        color:#111827 !important;

        font-size:11px !important;
        font-weight:600 !important;
        line-height:38px !important;

        cursor:pointer !important;
        pointer-events:auto !important;
        position:relative !important;
        z-index:10 !important;
    }


    /* DEFAULT SORTING */
    body.tax-product_cat .woocommerce-ordering{
        width:48% !important;
        height:38px !important;
        margin:0 !important;

        float:right !important;

        position:relative !important;
        z-index:10 !important;
        pointer-events:auto !important;
    }

    body.tax-product_cat .woocommerce-ordering select{
        display:block !important;

        width:100% !important;
        height:38px !important;

        margin:0 !important;
        padding:0 28px 0 10px !important;

        border:1px solid #111827 !important;
        border-radius:4px !important;

        background-color:#fff !important;
        color:#111827 !important;

        font-size:11px !important;
        font-weight:600 !important;
        line-height:38px !important;

        cursor:pointer !important;
        pointer-events:auto !important;
    }


    /* Hidden overlay must not block clicks */
    .hemritu-filter-overlay{
        pointer-events:none !important;
    }

    .hemritu-filter-overlay.hemritu-overlay-open{
        pointer-events:auto !important;
    }


    /* Products below controls */
    body.tax-product_cat ul.products{
        clear:both !important;
        padding-top:15px !important;
    }
}

/* ==================================================
   HEMRITU PRODUCT CARD — COMPACT 3D DESIGN
================================================== */

/* Prevent cards from stretching vertically */
body.tax-product_cat ul.products{
    align-items:start !important;
}

body.tax-product_cat ul.products li.product{
    height:auto !important;
    min-height:0 !important;
    align-self:start !important;

    box-sizing:border-box !important;
    padding:7px 7px 10px !important;

    background:#fff !important;
    border:1px solid #e1e5e9 !important;
    border-radius:3px !important;

    box-shadow:
        0 2px 4px rgba(0,0,0,0.06),
        0 5px 12px rgba(0,0,0,0.07) !important;

    transition:
        transform .2s ease,
        box-shadow .2s ease !important;
}


/* Desktop hover */
@media (min-width:768px){

    body.tax-product_cat ul.products li.product:hover{
        transform:translateY(-3px) !important;

        box-shadow:
            0 5px 10px rgba(0,0,0,0.08),
            0 10px 20px rgba(0,0,0,0.10) !important;
    }
}


/* Image spacing */
body.tax-product_cat ul.products li.product
.astra-shop-thumbnail-wrap{
    margin-bottom:6px !important;
}


/* Summary */
body.tax-product_cat ul.products li.product
.astra-shop-summary-wrap{
    padding:0 !important;
}


/* ==================================================
   HIDE ASTRA'S EXTRA CATEGORY
   Keep only our custom deepest/last category
================================================== */

body.tax-product_cat ul.products li.product
.ast-woo-product-category{
    display:none !important;
}


/* Remove unnecessary large gaps */
body.tax-product_cat ul.products li.product
.astra-shop-summary-wrap > *{
    margin-top:0;
}


/* Product title */
body.tax-product_cat ul.products li.product
.woocommerce-loop-product__title{
    margin-top:7px !important;
    margin-bottom:8px !important;
}


/* Price */
body.tax-product_cat ul.products li.product
.price{
    margin-top:0 !important;
    margin-bottom:8px !important;
}


/* Button */
body.tax-product_cat ul.products li.product
.button{
    margin-top:4px !important;
}


/* Keep Product Group badge inside image */



/* ==================================================
   MOBILE
================================================== */

@media (max-width:767px){

    body.tax-product_cat ul.products li.product{
        padding:6px 6px 9px !important;
    }

    body.tax-product_cat ul.products li.product
    .astra-shop-thumbnail-wrap{
        margin-bottom:5px !important;
    }

    body.tax-product_cat ul.products li.product
    .woocommerce-loop-product__title{
        margin-top:6px !important;
        margin-bottom:7px !important;
    }

    body.tax-product_cat ul.products li.product
    .price{
        margin-bottom:7px !important;
    }
}

/* ==================================================
   FINAL PRODUCT CARD ALIGNMENT
================================================== */

/* Equal height cards in each row */
body.tax-product_cat ul.products{
    align-items:stretch !important;
}

body.tax-product_cat ul.products li.product{
    display:flex !important;
    flex-direction:column !important;
    height:100% !important;
}


/* Product content fills remaining card space */
body.tax-product_cat ul.products li.product
.astra-shop-summary-wrap{
    display:flex !important;
    flex-direction:column !important;
    flex:1 1 auto !important;
}


/* Title fixed to maximum 2 lines */
body.tax-product_cat ul.products li.product
.woocommerce-loop-product__title{
    display:-webkit-box !important;
    -webkit-box-orient:vertical !important;
    -webkit-line-clamp:2 !important;
    overflow:hidden !important;

    min-height:2.6em !important;
    max-height:2.6em !important;
}


/* Price area equal height */
body.tax-product_cat ul.products li.product .price{
    min-height:2.4em !important;
}


/* Button always at bottom */
body.tax-product_cat ul.products li.product .button{
    margin-top:auto !important;
}


/* Product Group Badge - align inside image bottom-right */
body.tax-product_cat .hemritu-product-group-badge{
    transform:translateY(-8px) !important;
    margin:0 !important;
    border-radius:3px 0 0 0 !important;
}

/* ==================================================
   MOBILE
================================================== */

@media (max-width:767px){

    body.tax-product_cat ul.products li.product
    .woocommerce-loop-product__title{
        min-height:2.6em !important;
        max-height:2.6em !important;
    }

    body.tax-product_cat ul.products li.product .price{
        min-height:2.8em !important;
    }
}

/* ==================================================
   CATEGORY CLOSING MESSAGE
================================================== */

.hemritu-category-closing{
    clear:both;
    width:100%;
    margin:50px 0 20px;
    padding:35px 20px;
    text-align:center;

    background:#f8f8f8;
    border:1px solid #e5e5e5;
}

.hemritu-category-closing h3{
    margin:0 0 10px;
    font-size:24px;
}

.hemritu-category-closing p{
    margin:0 auto 20px;
    max-width:650px;
    font-size:14px;
    line-height:1.6;
}

.hemritu-category-closing .hemritu-contact-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:12px 28px;

    background:#0b0b0b;
    color:#fff !important;

    border-radius:25px;
    text-decoration:none;
    font-size:12px;
    font-weight:700;
    letter-spacing:.5px;
}

@media (max-width:767px){

    .hemritu-category-closing{
        margin-top:30px;
        padding:25px 15px;
    }

    .hemritu-category-closing h3{
        font-size:19px;
    }

    .hemritu-category-closing p{
        font-size:13px;
    }
}



































