/**
 * WooCommerce Product Collection Blocks - FINAL FIX
 * Handles nested card structure properly
 * SciuuuS Kids
 */

/* ==========================================================================
   Category/Archive Hero Section - Match Product Collection Style
   ========================================================================== */

/* Archive/Shop page hero section - remove excess padding */
.post-type-archive-product .hero-section,
.woocommerce-shop .hero-section,
.tax-product_cat .hero-section,
.tax-product_tag .hero-section {
    margin-bottom: 0 !important;
    background: var(--brand-white, #fff) !important;
}

/* Override Blocksy theme container padding and min-height for shop pages */
.post-type-archive-product .hero-section[data-type="type-2"] > [class*="ct-container"],
.woocommerce-shop .hero-section[data-type="type-2"] > [class*="ct-container"],
.tax-product_cat .hero-section[data-type="type-2"] > [class*="ct-container"],
.tax-product_tag .hero-section[data-type="type-2"] > [class*="ct-container"] {
    padding: 20px 0 !important;
    min-height: auto !important;
}

.hero-section h1.page-title {
    font-family: var(--font-display, 'Gochi Hand') !important;
    color: var(--brand-black, #000) !important;
    font-size: var(--font-size-h1, 42px) !important;
    text-align: center !important;
    margin-bottom: 0 !important;
}

/* ==========================================================================
   WooCommerce Result Count & Ordering - Aligned with Product Grid
   ========================================================================== */

/* Wrapper for result count and ordering */
.woocommerce-shop .woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce-shop .woocommerce-result-count,
.woocommerce-shop .woocommerce-ordering,
.post-type-archive-product .woocommerce-result-count,
.post-type-archive-product .woocommerce-ordering,
.tax-product_cat .woocommerce-result-count,
.tax-product_cat .woocommerce-ordering {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

/* Container that holds both result count and ordering */
.woocommerce-shop .ct-container > .woocommerce-result-count,
.woocommerce-shop .ct-container > .woocommerce-ordering,
.post-type-archive-product .ct-container > .woocommerce-result-count,
.post-type-archive-product .ct-container > .woocommerce-ordering {
    display: inline-block !important;
}

/* Result count styling - left aligned */
.woocommerce-result-count {
    font-family: var(--font-primary, 'Quicksand') !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--brand-gray-medium, #666) !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    float: left !important;
    margin: 0 0 20px 0 !important;
    padding-top: 8px !important;
}

/* Ordering dropdown - right aligned */
.woocommerce-ordering {
    float: right !important;
    margin: 0 0 20px 0 !important;
}

.woocommerce-ordering select {
    font-family: var(--font-primary, 'Quicksand') !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--brand-gray-dark, #333) !important;
    background: var(--brand-white, #fff) !important;
    border: 1px solid var(--brand-gray-light, #ddd) !important;
    border-radius: 4px !important;
    padding: 8px 35px 8px 12px !important;
    cursor: pointer !important;
    transition: border-color 0.2s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    min-width: 200px !important;
}

.woocommerce-ordering select:hover,
.woocommerce-ordering select:focus {
    border-color: var(--brand-orange, #FC7D06) !important;
    outline: none !important;
}

/* Clear floats after result count and ordering */
.woocommerce-shop .woocommerce-ordering::after,
.post-type-archive-product .woocommerce-ordering::after,
.tax-product_cat .woocommerce-ordering::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

/* ==========================================================================
   Fix Container Widths - Override Inline Styles
   ========================================================================== */

/* Widen the product collection container */
.wp-block-woocommerce-product-collection {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

/* Override inline width styles */
.wp-block-woocommerce-product-collection[style*="width"] {
    width: 100% !important;
    max-width: 1400px !important;
}

.wc-block-product-template[style*="width"] {
    width: 100% !important;
    max-width: 1200px !important;
}

/* ==========================================================================
   Product Collection Grid
   ========================================================================== */

.wc-block-product-template,
ul.wc-block-product-template {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 30px auto !important;
    max-width: 1200px !important;
    width: 100% !important;
}

/* ==========================================================================
   Product Card - OUTER CONTAINER ONLY
   ========================================================================== */

.wc-block-product-template li.wc-block-product,
li.wc-block-product {
    background: var(--brand-white, #fff) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    height: 100% !important; /* Fill grid cell to ensure consistent row heights */
}

.wc-block-product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Remove any nested backgrounds/borders */
.wc-block-product > * {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Product Image
   ========================================================================== */

.wc-block-components-product-image {
    position: relative !important;
    width: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.wc-block-components-product-image a {
    display: block !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wc-block-components-product-image img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4/3 !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.8s ease !important;
    margin: 0 !important;
    padding: 0 !important;
}

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

/* ==========================================================================
   Product Title
   ========================================================================== */

.wc-block-product h2.wp-block-post-title {
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 20px 20px 10px !important;
    padding: 0 !important;
    color: var(--brand-black, #000) !important;
    line-height: 1.4 !important;
    text-align: center !important;
    background: transparent !important;
}

.wc-block-product h2.wp-block-post-title a {
    color: var(--brand-black, #000) !important;
    text-decoration: none !important;
}

.wc-block-product h2.wp-block-post-title a:hover {
    color: var(--brand-orange, #FC7D06) !important;
}

/* ==========================================================================
   Product Price
   ========================================================================== */

.wc-block-product .wp-block-woocommerce-product-price {
    margin: 0 20px 15px !important;
    padding: 0 !important;
    background: transparent !important;
}

.wc-block-product .wc-block-components-product-price {
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--brand-black, #000) !important;
    text-align: center !important;
}

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

/* Hide price range screen reader text */
.wc-block-product .wc-block-components-product-price .screen-reader-text {
    position: absolute !important;
    left: -10000px !important;
}

/* ==========================================================================
   Add to Cart Button
   ========================================================================== */

.wc-block-product .wc-block-components-product-button {
    margin: 0 20px 20px !important;
    padding: 0 !important;
    background: transparent !important;
}

.wc-block-product .wp-block-button__link,
.wc-block-product .wc-block-components-product-button__button {
    display: block !important;
    width: 100% !important;
    background-color: var(--brand-orange, #FC7D06) !important;
    color: var(--brand-white, #fff) !important;
    padding: 14px 20px !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-family: var(--font-primary, Quicksand) !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    transition: background-color 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.wc-block-product .wp-block-button__link:hover,
.wc-block-product .wc-block-components-product-button__button:hover {
    background-color: #e06d05 !important;
}

/* ==========================================================================
   Fix Any Inline Styles
   ========================================================================== */

/* Override any margin/padding from blocks */
.wc-block-product [style*="margin"] {
    margin: 0 !important;
}

.wc-block-product h2[style*="margin-top"] {
    margin-top: 20px !important;
}

.wc-block-product h2[style*="margin-bottom"] {
    margin-bottom: 10px !important;
}

.wc-block-product h2[style*="line-height"] {
    line-height: 1.4 !important;
}

/* ==========================================================================
   Ensure Consistent Heights
   ========================================================================== */

.wc-block-product {
    min-height: 450px !important;
    align-items: stretch !important;
}

/* Push button to bottom if needed */
.wc-block-product .wc-block-components-product-button {
    margin-top: auto !important;
}

/* ==========================================================================
   Tablet Responsive (2 columns)
   ========================================================================== */

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

    .hero-section h1.page-title {
        font-size: 36px !important;
    }

    /* Archive hero section tablet */
    .post-type-archive-product .hero-section[data-type="type-2"] > [class*="ct-container"],
    .woocommerce-shop .hero-section[data-type="type-2"] > [class*="ct-container"],
    .tax-product_cat .hero-section[data-type="type-2"] > [class*="ct-container"] {
        padding: 15px 0 !important;
    }

    /* Result count and ordering tablet */
    .woocommerce-result-count {
        font-size: 13px !important;
    }

    .woocommerce-ordering select {
        min-width: 180px !important;
        font-size: 13px !important;
    }
}

/* ==========================================================================
   Mobile Responsive (1 column)
   ========================================================================== */

@media (max-width: 640px) {
    .wc-block-product-template,
    ul.wc-block-product-template {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin: 20px auto !important;
    }

    .hero-section h1.page-title {
        font-size: 30px !important;
    }

    /* Archive hero section mobile */
    .post-type-archive-product .hero-section[data-type="type-2"] > [class*="ct-container"],
    .woocommerce-shop .hero-section[data-type="type-2"] > [class*="ct-container"],
    .tax-product_cat .hero-section[data-type="type-2"] > [class*="ct-container"] {
        padding: 10px 0 !important;
    }

    /* Result count and ordering mobile - horizontal row */
    .woocommerce-result-count,
    .woocommerce-ordering {
        float: none !important;
        display: inline-block !important;
        vertical-align: middle !important;
        max-width: none !important;
        padding: 0 !important;
    }

    /* Result count - abbreviated display on mobile */
    .woocommerce-result-count {
        font-size: 11px !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        text-align: left !important;
        width: auto !important;
        white-space: nowrap !important;
    }

    /* Ordering dropdown - compact on mobile */
    .woocommerce-ordering {
        margin: 0 !important;
        text-align: right !important;
    }

    .woocommerce-ordering select {
        width: auto !important;
        min-width: 140px !important;
        max-width: 180px !important;
        padding: 6px 28px 6px 10px !important;
        font-size: 12px !important;
    }

    /* Blocksy sort icon positioning */
    .woo-listing-top .woocommerce-ordering .ct-sort-icon {
        position: inherit !important;
        margin-left: 5px !important;
    }

    /* Wrapper container for result count + ordering on mobile */
    .post-type-archive-product .ct-container > .woocommerce-result-count,
    .post-type-archive-product .ct-container > .woocommerce-ordering,
    .woocommerce-shop .ct-container > .woocommerce-result-count,
    .woocommerce-shop .ct-container > .woocommerce-ordering {
        display: inline-block !important;
    }

    /* Shop controls wrapper - flex layout */
    .woocommerce-shop .woocommerce-notices-wrapper ~ .woocommerce-result-count,
    .woocommerce-shop .woocommerce-notices-wrapper ~ .woocommerce-ordering,
    .post-type-archive-product .woocommerce-notices-wrapper ~ .woocommerce-result-count,
    .post-type-archive-product .woocommerce-notices-wrapper ~ .woocommerce-ordering {
        max-width: none !important;
        padding: 0 12px !important;
    }

    /* Hide Blocksy pagination arrows on mobile if present */
    .ct-pagination-arrows,
    .shop-entries-title .ct-arrows {
        display: none !important;
    }

    .wc-block-product h2.wp-block-post-title {
        font-size: 16px !important;
        margin: 15px 15px 8px !important;
    }

    .wc-block-product .wc-block-components-product-price {
        font-size: 24px !important;
        margin: 0 15px 12px !important;
    }

    .wc-block-product .wc-block-components-product-button {
        margin: 0 15px 15px !important;
    }
}

/* ==========================================================================
   Classic WooCommerce Product Loop (ul.products > li.product)
   Used on main Shop page and category archives
   ========================================================================== */

/* Product grid */
.woocommerce ul.products,
.post-type-archive-product ul.products,
.woocommerce-shop ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
    list-style: none !important;
    padding: 0 20px !important;
    margin: 30px auto !important;
    max-width: 1200px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Product card */
.woocommerce ul.products li.product,
.post-type-archive-product ul.products li.product {
    background: var(--brand-white, #fff) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Product image */
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product .attachment-woocommerce_thumbnail {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4/3 !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transition: transform 0.8s ease !important;
}

.woocommerce ul.products li.product:hover a img {
    transform: scale(1.05) !important;
}

/* Product title */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--brand-black, #000) !important;
    margin: 20px 20px 10px !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

/* Product price */
.woocommerce ul.products li.product .price {
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--brand-black, #000) !important;
    text-align: center !important;
    margin: 0 20px 15px !important;
    padding: 0 !important;
}

.woocommerce ul.products li.product .price del {
    font-size: 18px !important;
    color: var(--brand-gray-medium, #666) !important;
    margin-right: 8px !important;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none !important;
}

/* Add to Cart Button - Classic WooCommerce */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product .product_type_variable,
.woocommerce ul.products li.product .product_type_simple,
.woocommerce ul.products li.product a.button {
    display: block !important;
    width: calc(100% - 40px) !important;
    margin: auto 20px 20px !important;
    padding: 14px 20px !important;
    background-color: var(--brand-orange, #FC7D06) !important;
    color: var(--brand-white, #fff) !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-family: var(--font-primary, Quicksand) !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: background-color 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .add_to_cart_button:hover,
.woocommerce ul.products li.product a.button:hover {
    background-color: #e06d05 !important;
    color: var(--brand-white, #fff) !important;
}

/* ==========================================================================
   WooCommerce Pagination
   ========================================================================== */

.woocommerce-pagination,
.woocommerce nav.woocommerce-pagination {
    max-width: 1200px !important;
    margin: 40px auto !important;
    padding: 0 20px !important;
    text-align: center !important;
}

.woocommerce-pagination ul,
.woocommerce-pagination .page-numbers {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-wrap: wrap !important;
}

.woocommerce-pagination ul li {
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 12px !important;
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--brand-gray-dark, #333) !important;
    background: var(--brand-white, #fff) !important;
    border: 1px solid var(--brand-gray-light, #ddd) !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.woocommerce-pagination ul li a:hover {
    background: var(--brand-orange, #FC7D06) !important;
    color: var(--brand-white, #fff) !important;
    border-color: var(--brand-orange, #FC7D06) !important;
}

.woocommerce-pagination ul li span.current {
    background: var(--brand-orange, #FC7D06) !important;
    color: var(--brand-white, #fff) !important;
    border-color: var(--brand-orange, #FC7D06) !important;
}

/* Prev/Next arrows */
.woocommerce-pagination ul li .prev,
.woocommerce-pagination ul li .next {
    font-size: 18px !important;
}

/* ==========================================================================
   Classic WooCommerce Tablet Responsive (2 columns)
   ========================================================================== */

@media (max-width: 1024px) {
    .woocommerce ul.products,
    .post-type-archive-product ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}

/* ==========================================================================
   Classic WooCommerce Mobile Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .woocommerce ul.products,
    .post-type-archive-product ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 12px !important;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .woocommerce ul.products li.product h2 {
        font-size: 14px !important;
        margin: 12px 12px 6px !important;
    }

    .woocommerce ul.products li.product .price {
        font-size: 20px !important;
        margin: 0 12px 10px !important;
    }

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

    .woocommerce ul.products li.product .button,
    .woocommerce ul.products li.product .add_to_cart_button,
    .woocommerce ul.products li.product a.button {
        width: calc(100% - 24px) !important;
        margin: auto 12px 12px !important;
        padding: 10px 12px !important;
        font-size: 12px !important;
    }

    /* Pagination mobile */
    .woocommerce-pagination {
        margin: 30px auto !important;
        padding: 0 12px !important;
    }

    .woocommerce-pagination ul li a,
    .woocommerce-pagination ul li span {
        min-width: 36px !important;
        height: 36px !important;
        padding: 0 8px !important;
        font-size: 13px !important;
    }
}

/* ==========================================================================
   Remove All Nested Styling
   ========================================================================== */

/* Ensure ONLY the outer li has the card styling */
.wc-block-product * {
    box-shadow: none !important;
}

.wc-block-product {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.wc-block-product:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
}


.wp-block-woocommerce-product-collection[style*="width"] {
    width: 100% !important;
}

/* ==========================================================================
   Product Labels / Sale Badges - White Background with Border
   ========================================================================== */

/* Override default sale badges - all contexts */
.onsale,
.wc-block-product .onsale,
.ct-woo-card-extra .onsale,
.products .onsale,
.product .onsale,
.wc-block-components-product-image .onsale,
span.onsale,
.woocommerce span.onsale {
    background: var(--brand-white, #fff) !important;
    background-color: var(--brand-white, #fff) !important;
    color: var(--brand-black, #000) !important;
    border: 1px solid var(--brand-gray-dark, #333) !important;
    border-radius: 4px !important;
    padding: 6px 12px !important;
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2 !important;
    min-width: auto !important;
    min-height: auto !important;
    box-shadow: none !important;
}

/* Position badges in top-right corner */
.wc-block-components-product-image .onsale,
.ct-media-container .onsale,
.product figure .onsale {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    z-index: 10 !important;
}

/* Blocksy theme specific badge styling */
[class*="ct-woo-card-extra"] [class*="sale"],
.ct-woo-card-extra span,
.products .ct-woo-card-extra span {
    background: var(--brand-white, #fff) !important;
    background-color: var(--brand-white, #fff) !important;
    color: var(--brand-black, #000) !important;
    border: 1px solid var(--brand-gray-dark, #333) !important;
    border-radius: 4px !important;
    padding: 6px 12px !important;
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* ==========================================================================
   Shop Page - Blocksy Theme Override
   High specificity selectors to override Blocksy theme defaults
   ========================================================================== */

/* Reset Blocksy's column CSS variables and force grid */
body.woocommerce-shop .site-main ul.products,
body.woocommerce-shop .content-area ul.products,
body.woocommerce-shop [class*="products"],
body.post-type-archive-product .site-main ul.products,
body.post-type-archive-product .content-area ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
    list-style: none !important;
    padding: 0 20px !important;
    margin: 30px auto !important;
    max-width: 1200px !important;
    width: 100% !important;
    --columns: 3 !important;
    --grid-columns: 3 !important;
}

/* Override Blocksy's flex/column behavior */
body.woocommerce-shop ul.products[data-columns],
body.post-type-archive-product ul.products[data-columns] {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    flex-wrap: unset !important;
}

/* Product card - Override Blocksy's card styling */
body.woocommerce-shop ul.products li.product,
body.woocommerce-shop ul.products .product,
body.woocommerce-shop .products li.product,
body.post-type-archive-product ul.products li.product,
body.post-type-archive-product ul.products .product {
    background: var(--brand-white, #fff) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    flex: none !important;
    --card-background: var(--brand-white, #fff) !important;
}

body.woocommerce-shop ul.products li.product:hover,
body.post-type-archive-product ul.products li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Hide Blocksy-specific elements we don't want */
body.woocommerce-shop ul.products li.product .product-category,
body.woocommerce-shop ul.products li.product .entry-meta,
body.woocommerce-shop ul.products li.product .ct-woo-card-actions,
body.post-type-archive-product ul.products li.product .product-category,
body.post-type-archive-product ul.products li.product .entry-meta,
body.post-type-archive-product ul.products li.product .ct-woo-card-actions {
    display: none !important;
}

/* Product image - Blocksy uses figure.ct-media-container */
body.woocommerce-shop ul.products li.product figure,
body.woocommerce-shop ul.products li.product .ct-media-container,
body.post-type-archive-product ul.products li.product figure,
body.post-type-archive-product ul.products li.product .ct-media-container {
    position: relative !important;
    width: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 8px 8px 0 0 !important;
}

body.woocommerce-shop ul.products li.product figure img,
body.woocommerce-shop ul.products li.product .ct-media-container img,
body.woocommerce-shop ul.products li.product img.wp-post-image,
body.woocommerce-shop ul.products li.product img.attachment-woocommerce_thumbnail,
body.post-type-archive-product ul.products li.product figure img,
body.post-type-archive-product ul.products li.product .ct-media-container img,
body.post-type-archive-product ul.products li.product img.wp-post-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4/3 !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.8s ease !important;
    border-radius: 0 !important;
}

body.woocommerce-shop ul.products li.product:hover figure img,
body.woocommerce-shop ul.products li.product:hover .ct-media-container img,
body.post-type-archive-product ul.products li.product:hover figure img,
body.post-type-archive-product ul.products li.product:hover .ct-media-container img {
    transform: scale(1.05) !important;
}

/* Product title - Blocksy wraps in h2.woocommerce-loop-product__title */
body.woocommerce-shop ul.products li.product h2.woocommerce-loop-product__title,
body.woocommerce-shop ul.products li.product .woocommerce-loop-product__title,
body.post-type-archive-product ul.products li.product h2.woocommerce-loop-product__title,
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 20px 20px 10px !important;
    padding: 0 !important;
    color: var(--brand-black, #000) !important;
    line-height: 1.4 !important;
    text-align: center !important;
    background: transparent !important;
    order: 2 !important;
}

body.woocommerce-shop ul.products li.product a:hover .woocommerce-loop-product__title,
body.post-type-archive-product ul.products li.product a:hover .woocommerce-loop-product__title {
    color: var(--brand-orange, #FC7D06) !important;
}

/* Product price */
body.woocommerce-shop ul.products li.product .price,
body.woocommerce-shop ul.products li.product span.price,
body.post-type-archive-product ul.products li.product .price,
body.post-type-archive-product ul.products li.product span.price {
    font-family: var(--font-primary, Quicksand) !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--brand-black, #000) !important;
    text-align: center !important;
    margin: 0 20px 15px !important;
    padding: 0 !important;
    display: block !important;
    order: 3 !important;
}

body.woocommerce-shop ul.products li.product .price del,
body.post-type-archive-product ul.products li.product .price del {
    font-size: 18px !important;
    opacity: 0.6 !important;
}

body.woocommerce-shop ul.products li.product .price ins,
body.post-type-archive-product ul.products li.product .price ins {
    text-decoration: none !important;
}

/* Add to cart button - Blocksy puts in .ct-woo-card-actions, we show our own */
body.woocommerce-shop ul.products li.product a.button,
body.woocommerce-shop ul.products li.product a.add_to_cart_button,
body.woocommerce-shop ul.products li.product .button,
body.post-type-archive-product ul.products li.product a.button,
body.post-type-archive-product ul.products li.product a.add_to_cart_button,
body.post-type-archive-product ul.products li.product .button {
    display: block !important;
    width: calc(100% - 40px) !important;
    margin: auto 20px 20px !important;
    background-color: var(--brand-orange, #FC7D06) !important;
    color: var(--brand-white, #fff) !important;
    padding: 14px 20px !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-family: var(--font-primary, Quicksand) !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    transition: background-color 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    order: 4 !important;
}

body.woocommerce-shop ul.products li.product a.button:hover,
body.woocommerce-shop ul.products li.product a.add_to_cart_button:hover,
body.post-type-archive-product ul.products li.product a.button:hover,
body.post-type-archive-product ul.products li.product a.add_to_cart_button:hover {
    background-color: #e06d05 !important;
    color: var(--brand-white, #fff) !important;
}

/* Variable product button */
body.woocommerce-shop ul.products li.product a.product_type_variable,
body.post-type-archive-product ul.products li.product a.product_type_variable {
    display: block !important;
    width: calc(100% - 40px) !important;
    margin: auto 20px 20px !important;
    background-color: var(--brand-orange, #FC7D06) !important;
    color: var(--brand-white, #fff) !important;
    padding: 14px 20px !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-family: var(--font-primary, Quicksand) !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    border: none !important;
    order: 4 !important;
}

/* Shop page responsive - Tablet (2 columns) */
@media (max-width: 1024px) {
    body.woocommerce-shop .site-main ul.products,
    body.woocommerce-shop ul.products,
    body.woocommerce-shop ul.products[data-columns],
    body.post-type-archive-product .site-main ul.products,
    body.post-type-archive-product ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        --columns: 2 !important;
        --grid-columns: 2 !important;
    }
}

/* Shop page responsive - Mobile (1 column) */
@media (max-width: 640px) {
    body.woocommerce-shop .site-main ul.products,
    body.woocommerce-shop ul.products,
    body.woocommerce-shop ul.products[data-columns],
    body.post-type-archive-product .site-main ul.products,
    body.post-type-archive-product ul.products {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin: 20px auto !important;
        --columns: 1 !important;
        --grid-columns: 1 !important;
    }

    body.woocommerce-shop ul.products li.product h2.woocommerce-loop-product__title,
    body.woocommerce-shop ul.products li.product .woocommerce-loop-product__title,
    body.post-type-archive-product ul.products li.product h2.woocommerce-loop-product__title,
    body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title {
        font-size: 16px !important;
        margin: 15px 15px 8px !important;
    }

    body.woocommerce-shop ul.products li.product .price,
    body.post-type-archive-product ul.products li.product .price {
        font-size: 24px !important;
        margin: 0 15px 12px !important;
    }

    body.woocommerce-shop ul.products li.product a.button,
    body.woocommerce-shop ul.products li.product a.add_to_cart_button,
    body.post-type-archive-product ul.products li.product a.button,
    body.post-type-archive-product ul.products li.product a.add_to_cart_button {
        width: calc(100% - 30px) !important;
        margin: auto 15px 15px !important;
    }
}