/* =============================================================
   BLOCKS — WC Block mini-cart and block overrides
   Source: Customizer CSS L1-3, L2389-2665
   ============================================================= */

/* Mini-cart badge colour passthrough */
.wc-block-mini-cart__badge {
    color: inherit !important;
}

/* ==================== WC BLOCKS PRODUCT GRID ==================== */

/* Grid container */
.wc-block-product-template {
    display: grid !important;
}

/* Product card */
.wc-block-product {
    background: var(--global-palette9) !important;
    border: 1.5px solid var(--global-palette6) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    animation: fadeInUp 0.4s ease-out !important;
}

.wc-block-product:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 32px rgba(109, 40, 217, 0.12) !important;
    border-color: var(--global-palette1) !important;
}

/* Product image */
.wc-block-product .wc-block-components-product-image {
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    background: var(--global-palette7) !important;
}

.wc-block-product .wc-block-components-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.wc-block-product:hover .wc-block-components-product-image img {
    transform: scale(1.05) !important;
}

/* Product title */
.wc-block-product .wp-block-post-title {
    font-size: 1.0625rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 1.5rem 1.5rem 1rem 1.5rem !important;
    padding: 0 !important;
    color: var(--global-palette3) !important;
    text-align: left !important;
    min-height: 3rem !important;
}

.wc-block-product .wp-block-post-title a {
    color: var(--global-palette3) !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

.wc-block-product .wp-block-post-title a:hover {
    color: var(--global-palette1) !important;
}

/* Product price */
.wc-block-product .wp-block-woocommerce-product-price {
    margin: 0 1.5rem 1.25rem 1.5rem !important;
    padding: 0 !important;
    text-align: left !important;
}

.wc-block-components-product-price {
    display: block !important;
}

.wc-block-components-product-price .woocommerce-Price-amount {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--global-palette3) !important;
}

/* Variable "from" price text */
.kt-after-price-variation,
.kt-before-price-variation {
    font-size: 0.875rem !important;
    color: var(--global-palette5) !important;
    font-weight: 400 !important;
}

/* Button container */
.wc-block-product .wp-block-woocommerce-product-button {
    margin: 0 1.5rem 1.5rem 1.5rem !important;
    padding: 0 !important;
}

/* Add to cart button — simple product */
.wc-block-components-product-button__button {
    width: 100% !important;
    padding: 0.875rem 1.5rem !important;
    background: var(--global-palette3) !important;
    color: var(--global-palette9) !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    text-align: center !important;
    text-decoration: none !important;
    display: inline-block !important;
}

.wc-block-components-product-button__button:hover {
    background: var(--global-palette1) !important;
    transform: translateY(-2px) !important;
    color: var(--global-palette9) !important;
}

/* Variable product button */
.product_type_variable.wc-block-components-product-button__button {
    background: var(--global-palette1) !important;
}

.product_type_variable.wc-block-components-product-button__button:hover {
    background: var(--global-palette4) !important;
}

/* Out of stock */
.wc-block-product.outofstock {
    opacity: 0.7 !important;
}

.wc-block-product.outofstock .wc-block-components-product-button__button {
    background: var(--global-palette5) !important;
    cursor: not-allowed !important;
}

.wc-block-product.outofstock .wc-block-components-product-button__button:hover {
    transform: none !important;
    background: var(--global-palette5) !important;
}

/* Stagger entrance animations */
.wc-block-product:nth-child(1) { animation-delay: 0.05s !important; }
.wc-block-product:nth-child(2) { animation-delay: 0.1s !important; }
.wc-block-product:nth-child(3) { animation-delay: 0.15s !important; }
.wc-block-product:nth-child(4) { animation-delay: 0.2s !important; }
.wc-block-product:nth-child(5) { animation-delay: 0.25s !important; }
.wc-block-product:nth-child(6) { animation-delay: 0.3s !important; }
.wc-block-product:nth-child(7) { animation-delay: 0.35s !important; }
.wc-block-product:nth-child(8) { animation-delay: 0.4s !important; }

/* Suppress dead category link */
.wc-block-product .product_cat-link {
    display: none !important;
}

/* Suppress default content padding */
.wc-block-product .entry-content-wrap,
.wc-block-product .entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Products section background */
section[id="products"] {
    background: var(--global-palette9) !important;
}

/* ==================== RESPONSIVE PRODUCT GRID ==================== */

@media (max-width: 1200px) {
    .wc-block-product-template.columns-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 992px) {
    .wc-block-product-template.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .wc-block-product-template.columns-4 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .wc-block-product .wp-block-post-title {
        font-size: 1rem !important;
        min-height: auto !important;
    }

    .wc-block-components-product-price .woocommerce-Price-amount {
        font-size: 1.25rem !important;
    }
}
