/* WooCommerce Category/Archive Page Override Styles */
/* This file forces styling on product category pages */

/* Main container layout */
body.archive.woocommerce-page .container,
body.tax-product_cat .container,
body.post-type-archive-product .container {
    max-width: 1200px !important;
}

body.archive.woocommerce-page .woocommerce-shop-container,
body.tax-product_cat .woocommerce-shop-container,
body.post-type-archive-product .woocommerce-shop-container {
    display: flex !important;
    gap: 40px !important;
    margin-top: 40px !important;
}

/* Sidebar */
body.archive.woocommerce-page .shop-sidebar,
body.tax-product_cat .shop-sidebar,
body.post-type-archive-product .shop-sidebar {
    width: 280px !important;
    flex-shrink: 0 !important;
}

/* Products container */
body.archive.woocommerce-page .shop-products,
body.tax-product_cat .shop-products,
body.post-type-archive-product .shop-products {
    flex: 1 !important;
}

/* Widget styles */
.shop-sidebar .widget {
    margin-bottom: 30px !important;
    padding-bottom: 30px !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.shop-sidebar .widget:last-child {
    border-bottom: none !important;
}

.shop-sidebar .widget-title {
    font-size: 18px !important;
    color: #1a4a5c !important;
    margin-bottom: 20px !important;
    font-weight: 600 !important;
}

/* Category list */
.shop-sidebar .product-categories {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.shop-sidebar .product-categories li {
    margin-bottom: 12px !important;
}

.shop-sidebar .product-categories li a {
    color: #666 !important;
    text-decoration: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    transition: color 0.3s !important;
}

.shop-sidebar .product-categories li a:hover {
    color: #4a90e2 !important;
}

.shop-sidebar .product-categories li.active a {
    color: #4a90e2 !important;
    font-weight: 600 !important;
}

.shop-sidebar .product-categories .count {
    color: #999 !important;
    font-size: 14px !important;
}

/* Price filter - Fix overflow */
body.woocommerce-page .widget_price_filter .price_slider_wrapper {
    width: 100% !important;
    max-width: 240px !important;
    margin: 20px 0 !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
}

body.woocommerce-page .widget_price_filter .ui-slider {
    position: relative !important;
    width: 100% !important;
    height: 8px !important;
    background: #e0e0e0 !important;
    border-radius: 4px !important;
    border: none !important;
}

body.woocommerce-page .widget_price_filter .ui-slider-range {
    background: #4a90e2 !important;
    border-radius: 4px !important;
}

body.woocommerce-page .widget_price_filter .ui-slider-handle {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #4a90e2 !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    cursor: pointer !important;
    top: -4px !important;
    margin-left: -8px !important;
}

body.woocommerce-page .widget_price_filter .price_slider_amount {
    margin-top: 20px !important;
}

body.woocommerce-page .widget_price_filter .price_slider_amount .button {
    background: #4a90e2 !important;
    color: white !important;
    border: none !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.3s !important;
}

/* Product grid */
body.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    clear: both !important;
}

/* Reset default li styles */
body.woocommerce-page ul.products li.product {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    float: none !important;
    list-style: none !important;
}

/* Target custom product-card class */
body.woocommerce-page ul.products .product-card {
    background: white !important;
    border-radius: 15px !important;
    padding: 20px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
    transition: all 0.3s !important;
    margin: 0 !important;
    width: auto !important;
    text-align: center !important;
}

body.woocommerce-page ul.products .product-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15) !important;
}

/* Product image container */
body.woocommerce-page .product-card .product-image-container {
    position: relative !important;
    margin-bottom: 15px !important;
}

body.woocommerce-page .product-card .product-image-container img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Sale badge */
body.woocommerce-page .product-card .badge-sale {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: #e74c3c !important;
    color: white !important;
    padding: 5px 15px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    z-index: 1 !important;
}

/* Product category */
body.woocommerce-page .product-card .product-category {
    font-size: 13px !important;
    color: #999 !important;
    margin-bottom: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Product title - Remove underline */
body.woocommerce-page .product-card h4 {
    font-size: 16px !important;
    color: #333 !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    margin: 0 0 12px 0 !important;
}

body.woocommerce-page .product-card h4 a {
    text-decoration: none !important;
    color: inherit !important;
}

body.woocommerce-page .product-card h4 a:hover {
    color: #4a90e2 !important;
}

/* Product price - Reduce size */
body.woocommerce-page .product-card .price {
    font-size: 18px !important;
    color: #1a4a5c !important;
    font-weight: 600 !important;
    margin-bottom: 15px !important;
}

body.woocommerce-page .product-card .price .woocommerce-Price-amount {
    font-size: 18px !important;
}

body.woocommerce-page .product-card .price del .woocommerce-Price-amount {
    font-size: 14px !important;
    opacity: 0.6 !important;
}

body.woocommerce-page .product-card .price ins {
    text-decoration: none !important;
}

body.woocommerce-page .product-card .price .iva-text,
body.woocommerce-page .product-card .price .woocommerce-price-suffix {
    display: block !important;
    font-size: 12px !important;
    color: #999 !important;
    font-weight: normal !important;
    margin-top: 5px !important;
}

/* Hide duplicate IVA text */
body.woocommerce-page .product-card .price .iva-text:last-child {
    display: none !important;
}

/* Scopri button */
body.woocommerce-page .product-card .btn-cart {
    background: #4a90e2 !important;
    color: white !important;
    border: none !important;
    padding: 10px 30px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    transition: all 0.3s !important;
    text-decoration: none !important;
    display: inline-block !important;
}

body.woocommerce-page .product-card .btn-cart:hover {
    background: #357abd !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3) !important;
    color: white !important;
}

/* Sorting dropdown */
body.woocommerce-page .woocommerce-ordering {
    margin-bottom: 30px !important;
}

body.woocommerce-page .woocommerce-ordering select {
    padding: 10px 40px 10px 15px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    background: white !important;
    font-size: 14px !important;
    color: #666 !important;
}

/* Results count */
body.woocommerce-page .woocommerce-result-count {
    color: #666 !important;
    font-size: 14px !important;
    margin-bottom: 20px !important;
}

/* Mobile responsive */
@media (max-width: 991px) {
    body.woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    body.archive.woocommerce-page .woocommerce-shop-container,
    body.tax-product_cat .woocommerce-shop-container,
    body.post-type-archive-product .woocommerce-shop-container {
        flex-direction: column !important;
    }
    
    body.archive.woocommerce-page .shop-sidebar,
    body.tax-product_cat .shop-sidebar,
    body.post-type-archive-product .shop-sidebar {
        width: 100% !important;
        margin-bottom: 30px !important;
        border: 1px solid #e0e0e0 !important;
        padding: 20px !important;
        border-radius: 10px !important;
        background: #f9f9f9 !important;
    }
    
    body.woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    body.woocommerce-page ul.products li.product {
        padding: 15px !important;
    }
}

@media (max-width: 480px) {
    body.woocommerce-page ul.products {
        grid-template-columns: 1fr !important;
    }
    
    body.woocommerce-page ul.products li.product h2,
    body.woocommerce-page ul.products li.product h3,
    body.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
        font-size: 18px !important;
    }
    
    body.woocommerce-page ul.products li.product .price {
        font-size: 20px !important;
    }
}

/* Remove any default WooCommerce notices styling */
body.woocommerce-page .woocommerce-notices-wrapper {
    margin-bottom: 30px !important;
}

/* Pagination */
body.woocommerce-page nav.woocommerce-pagination {
    margin-top: 40px !important;
    text-align: center !important;
}

body.woocommerce-page nav.woocommerce-pagination ul {
    display: inline-flex !important;
    gap: 10px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.woocommerce-page nav.woocommerce-pagination ul li a,
body.woocommerce-page nav.woocommerce-pagination ul li span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: white !important;
    color: #666 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    transition: all 0.3s !important;
    border: 1px solid #e0e0e0 !important;
}

body.woocommerce-page nav.woocommerce-pagination ul li a:hover {
    background: #4a90e2 !important;
    color: white !important;
    border-color: #4a90e2 !important;
}

body.woocommerce-page nav.woocommerce-pagination ul li .current {
    background: #4a90e2 !important;
    color: white !important;
    border-color: #4a90e2 !important;
}