/**
 * Modern E-Commerce Catalog & Shop Design System
 * Theme: Clean, Premium, High-Converting (Astra & WooCommerce Blocks Compatible)
 */

/* ==========================================================================
   1. SHOP LAYOUT & TOOLBAR
   ========================================================================== */

/* Page background polish */
.woocommerce-shop #content,
.woocommerce-archive #content {
    background-color: #fafbfc;
}

/* Results count text */
.woocommerce-result-count {
    font-size: 13.5px !important;
    color: #64748b !important;
    font-weight: 500 !important;
    margin-bottom: 18px !important;
}

/* Ordering / Sorting Dropdown */
.woocommerce-ordering {
    margin-bottom: 18px !important;
}

.woocommerce-ordering select.orderby {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 9px 38px 9px 14px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
}

.woocommerce-ordering select.orderby:hover,
.woocommerce-ordering select.orderby:focus {
    border-color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08) !important;
    outline: none !important;
}

/* ==========================================================================
   2. PRODUCT GRID & CARDS
   ========================================================================== */

/* Grid spacing */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 22px !important;
    margin: 0 0 40px 0 !important;
    padding: 0 !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

/* Individual Product Card */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    background: #ffffff !important;
    border: 1px solid #edf0f5 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.35s ease !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    position: relative !important;
    padding: 0 0 16px 0 !important;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
    transform: translateY(-6px) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.09), 
                0 4px 12px -2px rgba(15, 23, 42, 0.03) !important;
}

/* ==========================================================================
   3. PRODUCT THUMBNAIL & IMAGE
   ========================================================================== */

.astra-shop-thumbnail-wrap {
    position: relative !important;
    overflow: hidden !important;
    background: #f8fafc !important;
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
    width: 100% !important;
    margin-bottom: 0 !important;
}

.astra-shop-thumbnail-wrap a.woocommerce-LoopProduct-link {
    display: block !important;
    overflow: hidden !important;
    width: 100% !important;
}

.astra-shop-thumbnail-wrap img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    margin: 0 !important;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.woocommerce ul.products li.product:hover .astra-shop-thumbnail-wrap img {
    transform: scale(1.06) !important;
}

/* ==========================================================================
   4. SALE BADGE
   ========================================================================== */

.ast-on-card-button.ast-onsale-card,
.ast-on-card-button[data-notification="default"],
.woocommerce ul.products li.product .ast-onsale-card,
.woocommerce span.onsale,
.woocommerce-page span.onsale,
span.onsale {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 4px 12px !important;
    min-height: unset !important;
    min-width: unset !important;
    height: auto !important;
    width: auto !important;
    line-height: 1.3 !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #ef4444 0%, #e11d48 100%) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
    z-index: 10 !important;
    border: none !important;
}

/* ==========================================================================
   5. PRODUCT SUMMARY (TITLE, RATING, PRICE)
   ========================================================================== */

.astra-shop-summary-wrap {
    padding: 14px 16px 0 16px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    text-align: left !important;
}

/* Product Title */
.woocommerce-loop-product__title,
.astra-shop-summary-wrap .ast-loop-product__link h2 {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    line-height: 1.4 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    height: 41px !important; /* Locks uniform card heights */
    transition: color 0.2s ease !important;
}

.woocommerce ul.products li.product:hover .woocommerce-loop-product__title {
    color: #2563eb !important;
}

/* Hide 0-Rating Empty Stars cleanly (Both container and star rating) */
.review-rating:has(span[style*="width:0%"]),
.review-rating:has(span[style*="width: 0%"]),
.woocommerce ul.products li.product .review-rating:has(span[style*="width:0%"]),
.woocommerce ul.products li.product .review-rating:has(span[style*="width: 0%"]),
.star-rating:has(span[style*="width:0%"]),
.star-rating:has(span[style*="width: 0%"]),
.star-rating[aria-label*="Rated 0"],
.star-rating[aria-label*="0 out of 5"],
.star-rating[aria-label*="0.00 out of 5"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Active Star Ratings */
.star-rating {
    font-size: 12px !important;
    color: #f59e0b !important;
    margin: 2px 0 8px 0 !important;
}

/* Price Section */
.woocommerce ul.products li.product .price,
.astra-shop-summary-wrap .price {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 4px 0 12px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.woocommerce ul.products li.product .price del,
.astra-shop-summary-wrap .price del {
    color: #94a3b8 !important;
    font-size: 13.5px !important;
    font-weight: 400 !important;
    text-decoration: line-through !important;
    opacity: 0.85 !important;
}

.woocommerce ul.products li.product .price ins,
.astra-shop-summary-wrap .price ins {
    color: #059669 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

/* ==========================================================================
   6. ADD TO CART / SELECT OPTIONS BUTTON
   ========================================================================== */

.woocommerce ul.products li.product .button,
.astra-shop-summary-wrap .button {
    margin-top: auto !important;
    width: calc(100% - 32px) !important;
    margin-left: 16px !important;
    margin-right: 16px !important;
    background: #0f172a !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    text-align: center !important;
    border: none !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}

.woocommerce ul.products li.product .button:hover,
.astra-shop-summary-wrap .button:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25) !important;
}

/* ==========================================================================
   7. SIDEBAR FILTERS (WooCommerce Blocks & Classic)
   ========================================================================== */

#secondary.widget-area {
    margin-bottom: 30px !important;
}

.ast-filter-wrap,
#secondary .widget,
#secondary .wc-block-product-filters {
    background: #ffffff !important;
    border: 1px solid #edf0f5 !important;
    border-radius: 14px !important;
    padding: 24px !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03) !important;
}

/* Filter Headings */
.wc-block-product-filters .wp-block-heading,
#secondary .widget-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    color: #0f172a !important;
    margin-bottom: 14px !important;
    padding-bottom: 8px !important;
    border-bottom: 1.5px solid #f1f5f9 !important;
}

/* Custom Checkbox List Styling */
.wc-block-product-filter-checkbox-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.wc-block-product-filter-checkbox-list__item {
    margin: 0 !important;
    padding: 0 !important;
}

.wc-block-product-filter-checkbox-list__label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 6px 8px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
}

.wc-block-product-filter-checkbox-list__label:hover {
    background-color: #f1f5f9 !important;
}

.wc-block-product-filters input[type="checkbox"],
.wc-block-product-filter-checkbox-list__input {
    accent-color: #0f172a !important;
    width: 17px !important;
    height: 17px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.wc-block-product-filter-checkbox-list__text {
    font-size: 13.5px !important;
    color: #334155 !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

/* Price Slider Inputs */
.wc-block-price-filter__controls input,
.wc-block-product-filter-price-slider input {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    text-align: center !important;
    transition: border-color 0.2s !important;
}

.wc-block-price-filter__controls input:focus,
.wc-block-product-filter-price-slider input:focus {
    border-color: #0f172a !important;
    background: #ffffff !important;
    outline: none !important;
}

/* Range Slider Accent */
.wc-block-price-filter__range,
.wc-block-product-filter-price-slider .wc-block-components-price-slider__range-input {
    accent-color: #0f172a !important;
}

/* ==========================================================================
   8. RESPONSIVE POLISH
   ========================================================================== */

@media (max-width: 768px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .woocommerce ul.products li.product {
        border-radius: 12px !important;
    }

    .astra-shop-summary-wrap {
        padding: 10px 10px 0 10px !important;
    }

    .woocommerce-loop-product__title,
    .astra-shop-summary-wrap .ast-loop-product__link h2 {
        font-size: 13px !important;
        height: 36px !important;
    }

    .woocommerce ul.products li.product .price {
        font-size: 14px !important;
    }

    .woocommerce ul.products li.product .button {
        width: calc(100% - 20px) !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
        font-size: 12px !important;
        padding: 7px 10px !important;
    }
}
