/*
 * Shehyaara Seamless Product Grid
 * Scoped only to WooCommerce product archive/search pages through body class.
 * It intentionally does NOT style the page header, filters, search bar, nav, etc.
 */

.shehyaara-seamless-grid-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 2px;
    gap: 12px 12px !important;
    align-items: start;
    margin: 0 !important;
}

.shehyaara-seamless-grid-page ul.products::before,
.shehyaara-seamless-grid-page ul.products::after {
    display: none !important;
}

.shehyaara-seamless-grid-page ul.products li.product {
    position: relative;
    width: auto !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(26, 22, 51, .07);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(21, 14, 51, .045);
    transition: transform .18s ease, box-shadow .18s ease;
}

.shehyaara-seamless-grid-page ul.products li.product:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(21, 14, 51, .07);
}

/* Keep only the actual card clickable, without forcing a fixed card height. */
.shehyaara-seamless-grid-page ul.products li.product > a.woocommerce-LoopProduct-link {
    display: block;
}

/* Product image */
.shehyaara-seamless-grid-page ul.products li.product a img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    border-radius: 13px 13px 0 0;
    background: #f7f7f9;
}

/* Compact card content */
.shehyaara-seamless-grid-page ul.products li.product .woocommerce-loop-product__title,
.shehyaara-seamless-grid-page ul.products li.product .shehyaara-grid-title {
    margin: 9px 10px 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.34 !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    color: #202036 !important;
    min-height: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price intentionally quieter than the title/image. */
.shehyaara-seamless-grid-page ul.products li.product .price {
    display: flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px;
    margin: 7px 10px 0 !important;
    color: #31267a !important;
    font-size: 15px !important;
    line-height: 1.15 !important;
    font-weight: 650 !important;
}

.shehyaara-seamless-grid-page ul.products li.product .price ins {
    text-decoration: none !important;
    font-weight: 650 !important;
    background: transparent !important;
    color: inherit !important;
}

.shehyaara-seamless-grid-page ul.products li.product .price del {
    order: 2;
    opacity: .56 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #7b7b89 !important;
}

.shehyaara-seamless-grid-page ul.products li.product .price del .amount {
    color: inherit !important;
}

/* Stock line */
.shehyaara-seamless-grid-page .shehyaara-stock {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 10px 11px;
    color: #7a7b88;
    font-size: 12px;
    line-height: 1;
    font-weight: 500;
}

.shehyaara-seamless-grid-page .shehyaara-stock .dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #10a875;
}

.shehyaara-seamless-grid-page .shehyaara-stock.is-out .dot {
    background: #b8b9c1;
}

/* Sale/new/best-seller badge overlays */
.shehyaara-seamless-grid-page ul.products li.product .onsale.shehyaara-discount-badge,
.shehyaara-seamless-grid-page ul.products li.product .shehyaara-special-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 5px 9px !important;
    z-index: 8;
    border: 0 !important;
    border-radius: 999px !important;
    line-height: 1 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.shehyaara-seamless-grid-page ul.products li.product .onsale.shehyaara-discount-badge {
    background: #ff4263 !important;
}

.shehyaara-seamless-grid-page ul.products li.product .shehyaara-special-badge.is-new {
    background: #ff9e16 !important;
}

.shehyaara-seamless-grid-page ul.products li.product .shehyaara-special-badge.is-best {
    background: #5b2cff !important;
}

/* Wishlist buttons from common plugins remain on the image but are made compact. */
.shehyaara-seamless-grid-page ul.products li.product :is(.yith-wcwl-add-to-wishlist, .tinv-wraper, .woosw-btn, .wishlist-button, .ct-wishlist-button) {
    position: absolute !important;
    top: 9px !important;
    right: 9px !important;
    z-index: 10;
}

/* Hide product-category text/rating/add-to-cart in the listing for a cleaner discovery feed.
   Product page functionality is untouched. */
.shehyaara-seamless-grid-page ul.products li.product :is(.product-category, .product-categories, .posted_in, .star-rating, .woocommerce-product-rating) {
    display: none !important;
}

.shehyaara-seamless-grid-page ul.products li.product > :is(.button, .added_to_cart),
.shehyaara-seamless-grid-page ul.products li.product .add_to_cart_button,
.shehyaara-seamless-grid-page ul.products li.product .product_type_simple,
.shehyaara-seamless-grid-page ul.products li.product .product_type_variable {
    display: none !important;
}

/* Blocksy/Woo can add margins to internal card wrappers. Keep them tight. */
.shehyaara-seamless-grid-page ul.products li.product :is(.ct-woo-card-actions, .ct-product-actions, .product-entry-wrapper) {
    margin-top: 0;
}

/* Tablet: still a discovery grid, but 3 columns. */
@media (min-width: 768px) {
    .shehyaara-seamless-grid-page ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 12px 16px !important;
    }
}

/* Desktop: 4 columns, preserving masonry flow. */
@media (min-width: 1100px) {
    .shehyaara-seamless-grid-page ul.products {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 12px 18px !important;
    }
}

/* Smaller phones */
@media (max-width: 380px) {
    .shehyaara-seamless-grid-page ul.products {
        gap: 12px 8px !important;
    }

    .shehyaara-seamless-grid-page ul.products li.product .woocommerce-loop-product__title,
    .shehyaara-seamless-grid-page ul.products li.product .shehyaara-grid-title {
        font-size: 13px !important;
        margin-left: 8px !important;
        margin-right: 8px !important;
    }

    .shehyaara-seamless-grid-page ul.products li.product .price,
    .shehyaara-seamless-grid-page .shehyaara-stock {
        margin-left: 8px !important;
        margin-right: 8px !important;
    }
}

/* v1.0.1 — Blocksy cleanup requested for the compact archive card. */

/* Blocksy may output a second product toolbar after the card content.
   Keep the toolbar that is over the product image, but remove the duplicate
   lower "Save" / wishlist toolbar. */
.shehyaara-seamless-grid-page ul.products li.product > .ct-woo-card-extra {
    display: none !important;
}

/* Remove category/meta labels such as "NECKLACE" below the card price.
   Blocksy renders product categories through entry-meta / meta-categories. */
.shehyaara-seamless-grid-page ul.products li.product .meta-categories,
.shehyaara-seamless-grid-page ul.products li.product > .entry-meta:has(.meta-categories),
.shehyaara-seamless-grid-page ul.products li.product .ct-product-categories,
.shehyaara-seamless-grid-page ul.products li.product .product-category,
.shehyaara-seamless-grid-page ul.products li.product .product-categories,
.shehyaara-seamless-grid-page ul.products li.product .posted_in {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* v1.0.2 — remove duplicate lower Save / wishlist button more aggressively. */
.shehyaara-seamless-grid-page ul.products li.product > :is(.tinv-wraper, .yith-wcwl-add-to-wishlist, .woosw-btn, .wishlist-button, .ct-wishlist-button, .ct-woo-card-extra) {
    display: none !important;
}
