/*
 * Mythri by Viji — Shop Polish
 * Load AFTER shop.css
 */

.mythri-shop-products { 
    position: relative !important; 
}

.elementor-widget-woocommerce-archive-products .woocommerce-loop-product__title {
    min-height:50px !important;
    margin-bottom:8px !important;
    font-size:22px !important;
    line-height:1.08 !important;
    font-weight:600 !important;
    text-transform:none !important;
}

.elementor-widget-woocommerce-archive-products ul.products li.product .price {
    min-height:22px !important;
    margin-bottom:11px !important;
}

.elementor-widget-woocommerce-archive-products ul.products li.product {
    min-width:0 !important;
}

.elementor-widget-woocommerce-archive-products ul.products li.product .button {
    min-height:38px !important;
    padding:10px 18px !important;
    margin-right:8px !important;
}

.elementor-widget-woocommerce-archive-products ul.products li.product img {
    margin-bottom:22px !important;
}


@media (min-width:1025px) {
    .elementor-widget-woocommerce-archive-products ul.products {
        gap:46px 22px !important;
    }
}

@media (max-width:1024px) {
    .elementor-widget-woocommerce-archive-products .woocommerce-loop-product__title {
        font-size:21px !important;
    }
}

@media (max-width:767px) {
    .elementor-widget-woocommerce-archive-products .woocommerce-loop-product__title {
        min-height:44px !important;
        font-size:18px !important;
    }
    .elementor-widget-woocommerce-archive-products ul.products li.product .button {
        padding:9px 12px !important;
        margin-right:5px !important;
        font-size:12px !important;
    }
}

/* =========================================================
   MYTHRI SHOP TOOLBAR
   ========================================================= */

.mythri-shop-products .ast-shop-toolbar-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 48px !important;
    margin-bottom: 22px !important;
    padding: 0 0 12px !important;
    border-bottom: 1px solid #DED2CD !important;
}

/* Result count */
.mythri-shop-products .woocommerce-result-count {
    min-height: auto !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #4B4246 !important;
}

/* Grid / List controls */
.mythri-shop-products .ast-products-view {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

/* View icons */
.mythri-shop-products .ast-view-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3px !important;
    color: #4B4246 !important;
    transition: color 0.2s ease !important;
}

/* Active view */
.mythri-shop-products .ast-view-trigger.active {
    color: #6B173E !important;
}

/* Hover */
.mythri-shop-products .ast-view-trigger:hover {
    color: #6B173E !important;
}


/* =========================================================
   ASTRA SALE BADGE — FORCE OVERRIDE
   ========================================================= */

body.woocommerce-shop .ast-on-card-button.ast-onsale-card,
body.tax-product_cat .ast-on-card-button.ast-onsale-card,
body.tax-product_tag .ast-on-card-button.ast-onsale-card {
    background: #6B173E !important;
    background-color: #6B173E !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    box-shadow: 0 3px 8px rgba(45, 27, 36, 0.15) !important;
}


/* =========================================================
   =========================================================
   MOBILE FIX PASS — SEPTEMBER 2026
   Card internals for shop / category / tag archives.
   Written against the Astra card markup that is actually
   rendered (.astra-shop-thumbnail-wrap / .astra-shop-summary-wrap),
   not the Elementor classes used higher up in this file.
   ========================================================= */

body.post-type-archive-product ul.products li.product .astra-shop-thumbnail-wrap,
body.tax-product_cat ul.products li.product .astra-shop-thumbnail-wrap,
body.tax-product_tag ul.products li.product .astra-shop-thumbnail-wrap {
    position: relative !important;
    width: 100% !important;
    margin: 0 0 14px !important;
}

body.post-type-archive-product ul.products li.product img,
body.tax-product_cat ul.products li.product img,
body.tax-product_tag ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    margin: 0 !important;
    background: #F5F8F7 !important;
}

/* Summary fills the rest of the card so the button can be
   pinned to the bottom — this is what stops the ragged,
   misaligned "Add to cart" rows on phones */
body.post-type-archive-product ul.products li.product .astra-shop-summary-wrap,
body.tax-product_cat ul.products li.product .astra-shop-summary-wrap,
body.tax-product_tag ul.products li.product .astra-shop-summary-wrap {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}

/* Title — always exactly two lines tall */
body.post-type-archive-product ul.products li.product .ast-loop-product__link,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat ul.products li.product .ast-loop-product__link,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
body.tax-product_tag ul.products li.product .ast-loop-product__link,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    min-height: calc(2 * 1.3em) !important;
    text-transform: none !important;
}

body.post-type-archive-product ul.products li.product .price,
body.tax-product_cat ul.products li.product .price,
body.tax-product_tag ul.products li.product .price {
    display: block !important;
    min-height: 22px !important;
    margin: 0 0 12px !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
}

body.post-type-archive-product ul.products li.product .price del,
body.tax-product_cat ul.products li.product .price del,
body.tax-product_tag ul.products li.product .price del {
    margin-right: 5px !important;
    opacity: .55 !important;
}

body.post-type-archive-product ul.products li.product .price ins,
body.tax-product_cat ul.products li.product .price ins,
body.tax-product_tag ul.products li.product .price ins {
    font-weight: 700 !important;
    text-decoration: none !important;
}

/* Add to cart — pinned to the bottom of every card */
body.post-type-archive-product ul.products li.product .button,
body.tax-product_cat ul.products li.product .button,
body.tax-product_tag ul.products li.product .button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 44px !important;
    margin: auto 0 0 !important;
    padding: 10px 14px !important;
    border-radius: 4px !important;
    background: #6B1F49 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

body.post-type-archive-product ul.products li.product .button:hover,
body.tax-product_cat ul.products li.product .button:hover,
body.tax-product_tag ul.products li.product .button:hover {
    background: #2D1B24 !important;
}

body.post-type-archive-product ul.products li.product .added_to_cart,
body.tax-product_cat ul.products li.product .added_to_cart,
body.tax-product_tag ul.products li.product .added_to_cart {
    display: block !important;
    margin-top: 8px !important;
    font-size: 12px !important;
    text-align: center !important;
}

/* Wishlist heart sits in its own aligned row */
body.post-type-archive-product ul.products li.product .tinv-wraper,
body.tax-product_cat ul.products li.product .tinv-wraper,
body.tax-product_tag ul.products li.product .tinv-wraper {
    width: 100% !important;
    margin: 8px 0 0 !important;
    text-align: center !important;
}

/* Sale badge */
body.post-type-archive-product ul.products li.product .onsale,
body.tax-product_cat ul.products li.product .onsale,
body.tax-product_tag ul.products li.product .onsale {
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    border-radius: 20px !important;
    background: #6B173E !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}


/* ---------------------------------------------------------
   PHONE SIZES
   --------------------------------------------------------- */

@media (max-width: 767px) {
    body.post-type-archive-product ul.products li.product .ast-loop-product__link,
    body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
    body.tax-product_cat ul.products li.product .ast-loop-product__link,
    body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
    body.tax-product_tag ul.products li.product .ast-loop-product__link,
    body.tax-product_tag ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
        line-height: 1.28 !important;
        margin-bottom: 5px !important;
    }

    body.post-type-archive-product ul.products li.product .price,
    body.tax-product_cat ul.products li.product .price,
    body.tax-product_tag ul.products li.product .price {
        margin-bottom: 10px !important;
        font-size: 13.5px !important;
    }

    body.post-type-archive-product ul.products li.product .button,
    body.tax-product_cat ul.products li.product .button,
    body.tax-product_tag ul.products li.product .button {
        padding: 10px 8px !important;
        font-size: 13px !important;
    }

    body.post-type-archive-product ul.products li.product .astra-shop-thumbnail-wrap,
    body.tax-product_cat ul.products li.product .astra-shop-thumbnail-wrap,
    body.tax-product_tag ul.products li.product .astra-shop-thumbnail-wrap {
        margin-bottom: 10px !important;
    }

    /* Result count + sorting stack cleanly */
    .woocommerce .woocommerce-result-count {
        display: block !important;
        float: none !important;
        margin: 0 0 10px !important;
        line-height: 1.5 !important;
        font-size: 13px !important;
    }

    .woocommerce .woocommerce-ordering {
        display: block !important;
        float: none !important;
        width: 100% !important;
    }

    .woocommerce .woocommerce-ordering select {
        width: 100% !important;
        min-width: 0 !important;
        height: 46px !important;
        font-size: 16px !important;
    }
}

@media (max-width: 360px) {
    body.post-type-archive-product ul.products li.product .ast-loop-product__link,
    body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
    body.tax-product_cat ul.products li.product .ast-loop-product__link,
    body.tax-product_cat ul.products li.product .woocommerce-loop-product__title {
        -webkit-line-clamp: 3;
        min-height: 0 !important;
        font-size: 15px !important;
    }
}


/* ---------------------------------------------------------
   SALE BADGE — Elementor hides WooCommerce's own .onsale
   badge inside its product grid, so shop/category cards had
   no badge while the related-products grid on the product
   page did. This puts it back, styled to match.
   --------------------------------------------------------- */

body.post-type-archive-product .elementor-products-grid ul.products.elementor-grid li.product .onsale,
body.tax-product_cat .elementor-products-grid ul.products.elementor-grid li.product .onsale,
body.tax-product_tag .elementor-products-grid ul.products.elementor-grid li.product .onsale {
    display: block !important;
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    z-index: 2 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    border-radius: 20px !important;
    background: #6B173E !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}


