/**
 * WooBedding Shop Page Styles - Production Ready
 * File: assets/css/woobedding-shop-page.css
 * Version: 2.3 - FIX FINALE: 2 COLONNE + MARGINI RIDOTTI + NO SCROLLBAR
 */

/* =================================
   CSS VARIABLES
   ================================= */
:root {
    --woobedding-primary: #00448A;
    --woobedding-primary-dark: #003366;
    --woobedding-primary-light: #0056b3;
    --woobedding-secondary: #f8f9fa;
    --woobedding-border: #e9ecef;
    --woobedding-text: #212529;
    --woobedding-text-muted: #6c757d;
    --woobedding-success: #28a745;
    --woobedding-danger: #dc3545;
    --woobedding-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --woobedding-shadow-lg: 0 1rem 3rem rgba(0,0,0,0.175);
    --woobedding-radius: 0.5rem;
    --woobedding-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =================================
   CONTAINER PRINCIPALE
   ================================= */
.woobedding-shop-container {
    max-width: 1320px;
    margin: 0 auto 2rem auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
    clear: both;
    display: flow-root;
}

.woobedding-shop-container:after {
    content: "";
    display: table;
    clear: both;
}

/* =================================
   LAYOUT PRINCIPALE
   ================================= */
.woobedding-shop-main {
    display: flex;
    gap: 1.5rem;
    position: relative;
}

.woobedding-shop-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.filter-right .woobedding-shop-sidebar {
    order: 2;
}

.woobedding-filters-wrapper {
    background: white;
    border: 1px solid var(--woobedding-border);
    border-radius: var(--woobedding-radius);
    overflow: hidden;
    box-shadow: var(--woobedding-shadow);
    position: sticky;
    top: 2rem;
}

.woobedding-filter-toggle {
    display: none !important;
}

.woobedding-shop-content {
    flex: 1;
    min-width: 0;
}

/* =================================
   MOBILE FILTERS SYSTEM
   ================================= */
@media (min-width: 769px) {
    .woobedding-mobile-filter-toggle,
    .woobedding-mobile-filters-modal {
        display: none !important;
    }

    .woobedding-filters-wrapper {
        display: block !important;
        position: sticky !important;
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .woobedding-shop-sidebar {
        display: none;
    }

    .woobedding-shop-main {
        flex-direction: column;
        gap: 0;
    }

    .woobedding-mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        padding: 1rem;
        margin-bottom: 1.5rem;
        background: var(--woobedding-primary);
        color: white;
        border: none;
        border-radius: var(--woobedding-radius);
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
    }

    .woobedding-mobile-filter-toggle:active {
        transform: scale(0.98);
    }

    .woobedding-mobile-filter-toggle .dashicons {
        font-size: 1.25rem;
        line-height: 1;
        width: auto;
        height: auto;
    }

    .woobedding-filter-count-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.5rem;
        height: 1.5rem;
        padding: 0 0.5rem;
        background: white;
        color: var(--woobedding-primary);
        border-radius: 1rem;
        font-size: 0.75rem;
        font-weight: 600;
        margin-left: 0.5rem;
    }

    .woobedding-mobile-filters-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999999;
        pointer-events: none;
    }

    .woobedding-mobile-filters-modal.is-active {
        display: block;
        pointer-events: all;
    }

    .woobedding-mobile-filters-backdrop {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        animation: fadeIn 0.3s ease;
        cursor: pointer;
    }

    .woobedding-mobile-filters-panel {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        background: white;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        animation: slideInLeft 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    .woobedding-mobile-filters-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        background: var(--woobedding-primary);
        color: white;
        flex-shrink: 0;
    }

    .woobedding-mobile-filters-header h3 {
        margin: 0;
        font-size: 1.125rem;
        font-weight: 600;
    }

    .woobedding-mobile-filters-close {
        width: 2.5rem;
        height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.2);
        color: white;
        border: none;
        border-radius: 50%;
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .woobedding-mobile-filters-close:active {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
    }

    .woobedding-mobile-filters-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem;
    }

    .woobedding-mobile-filters-content .woobedding-filter-section {
        margin-bottom: 1.5rem;
        border: 1px solid #e5e5e5;
        border-radius: 0.5rem;
        overflow: hidden;
    }

    .woobedding-mobile-filters-content .filter-section-title {
        padding: 0.875rem 1rem;
        background: #f8f9fa;
        font-size: 0.9rem;
        border: none;
    }

    .woobedding-mobile-filters-content .filter-section-content {
        padding: 0.75rem 1rem;
        max-height: none;
        display: block !important;
        transition: none;
    }

    .woobedding-mobile-filters-content .filter-section-content.collapsed {
        display: none !important;
    }

    .woobedding-mobile-filters-content .woobedding-filter-checkbox {
        padding: 0.75rem 0.75rem 0.75rem 2.25rem;
        margin-bottom: 0.5rem;

    }

    .woobedding-mobile-filters-footer {
        padding: 1rem;
        background: white;
        border-top: 1px solid #e5e5e5;
        display: flex;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .woobedding-mobile-filters-footer button {
        flex: 1;
        padding: 0.875rem;
        border-radius: 0.5rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.9rem;
    }

    .woobedding-mobile-apply-filters {
        background: var(--woobedding-primary);
        color: white;
        border: none;
    }

    .woobedding-mobile-apply-filters:active {
        transform: scale(0.98);
    }

    .woobedding-mobile-reset-filters {
        background: white;
        color: var(--woobedding-primary);
        border: 2px solid var(--woobedding-primary);
    }

    body.woobedding-filters-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes slideInLeft {
        from { transform: translateX(-100%); }
        to { transform: translateX(0); }
    }

    .woobedding-mobile-filters-modal.is-closing .woobedding-mobile-filters-backdrop {
        animation: fadeOut 0.3s ease;
    }

    .woobedding-mobile-filters-modal.is-closing .woobedding-mobile-filters-panel {
        animation: slideOutLeft 0.3s ease;
    }

    @keyframes fadeOut {
        from { opacity: 1; }
        to { opacity: 0; }
    }

    @keyframes slideOutLeft {
        from { transform: translateX(0); }
        to { transform: translateX(-100%); }
    }
}

/* =================================
   FILTRI - HEADER & TABS
   ================================= */
.woobedding-filters-header {
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, var(--woobedding-primary) 0%, var(--woobedding-primary-dark) 100%);
    border-radius: var(--woobedding-radius) var(--woobedding-radius) 0 0;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.woobedding-filters-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.woobedding-reset-filters {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.woobedding-reset-filters:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* =================================
   FILTRI - SEZIONI (PADDING MINIMI + NO SCROLLBAR)
   ================================= */
.woobedding-filters {
    padding: 0.375rem;
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    overflow-x: hidden;
    /* NASCONDE SCROLLBAR */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE e Edge */
}

.woobedding-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.woobedding-filter-section {
    margin-bottom: 0.375rem;
    border: 1px solid var(--woobedding-border);
    border-radius: 0.25rem;
    overflow: hidden;
    background: white;
}

.woobedding-filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-title {
    padding: 0.375rem 0.5rem;
    background: var(--woobedding-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--woobedding-text);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    text-align: left;
}

.filter-section-title:hover {
    background: #e9ecef;
}

.filter-section-title:after {
    content: "−";
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1;
    transition: transform 0.3s ease;
}

.filter-section-title.collapsed:after {
    content: "+";
    transform: rotate(0deg);
}

.filter-section-content {
    padding: 0.25rem 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    transition: all 0.3s ease;
    /* NASCONDE SCROLLBAR */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-section-content::-webkit-scrollbar {
    display: none;
}

.filter-section-content.collapsed {
    max-height: 0;
    padding: 0 0.5rem;
    overflow: hidden;
}

/* =================================
   FILTRI - CHECKBOX (PADDING MINIMI)
   ================================= */
.woobedding-filter-checkbox {
    display: flex;
    align-items: center;
    padding: 0.1875rem 0.25rem 0.1875rem 1.5rem;
    margin-bottom: 0.0625rem;
    border-radius: 0.1875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;

    font-size: 0.75rem;
    line-height: 1.2;
}

.woobedding-filter-checkbox:hover {
    background: var(--woobedding-secondary);
}

.woobedding-filter-checkbox input[type="checkbox"],
.woobedding-filter-checkbox input[type="radio"] {
    position: absolute;
    left: 0.25rem;
    opacity: 0;
    cursor: pointer;
    width: 0.75rem;
    height: 0.75rem;
    margin: 0;
}

.woobedding-filter-checkbox .checkmark {
    position: absolute;
    left: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    height: 0.75rem;
    width: 0.75rem;
    background: white;
    border: 1.5px solid var(--woobedding-border);
    border-radius: 0.1875rem;
    transition: all 0.2s ease;
}

.woobedding-filter-checkbox input[type="checkbox"]:checked ~ .checkmark {
    background: var(--woobedding-primary);
    border-color: var(--woobedding-primary);
}

.woobedding-filter-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 0.1875rem;
    top: 0.03125rem;
    width: 0.125rem;
    height: 0.375rem;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.woobedding-filter-checkbox input[type="checkbox"]:checked ~ .checkmark:after {
    display: block;
}

.filter-count {
    margin-left: auto;
    padding-left: 0.25rem;
    font-size: 0.625rem;
    color: var(--woobedding-text-muted);
    font-weight: 500;
}

/* =================================
   PRICE RANGE FILTER CON INDICATORE VISUALE
   ================================= */
.price-range-slider {
    padding: 0.375rem 0;
}

.price-inputs {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.price-input-group {
    flex: 1;
}

.price-input-group label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--woobedding-text-muted);
    margin-bottom: 0.1875rem;
}

.price-input-group input {
    width: 100%;
    padding: 0.25rem 0.375rem;
    border: 1px solid var(--woobedding-border);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.price-input-group input:focus {
    outline: none;
    border-color: var(--woobedding-primary);
    box-shadow: 0 0 0 2px rgba(0, 68, 138, 0.1);
}

/* INDICATORE VISUALE RANGE PREZZI */
.price-range-display {
    position: relative;
    height: 0.375rem;
    background: #e9ecef;
    border-radius: 0.1875rem;
    margin: 0.75rem 0.25rem 0.5rem 0.25rem;
    overflow: hidden;
}

.price-range-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--woobedding-primary-dark) 0%, var(--woobedding-primary) 100%);
    border-radius: 0.1875rem;
    transition: all 0.3s ease;
}

.price-range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    color: var(--woobedding-text-muted);
    font-weight: 500;
}

.price-range-values span {
    background: var(--woobedding-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.1875rem;
}

/* Slider personalizzato (opzionale - se usi input range) */
input[type="range"].price-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 0.375rem;
    background: transparent;
    outline: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    pointer-events: none;
}

input[type="range"].price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0.875rem;
    height: 0.875rem;
    background: var(--woobedding-primary);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    pointer-events: all;
}

input[type="range"].price-range::-moz-range-thumb {
    width: 0.875rem;
    height: 0.875rem;
    background: var(--woobedding-primary);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    pointer-events: all;
}

/* =================================
   TOOLBAR & ORDINAMENTO
   ================================= */
.woobedding-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: var(--woobedding-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--woobedding-shadow);
}

.woobedding-results-count {
    font-size: 0.9rem;
    color: var(--woobedding-text-muted);
    font-weight: 500;
}

.woobedding-results-count strong {
    color: var(--woobedding-text);
    font-weight: 600;
}

.woobedding-orderby-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.woobedding-orderby-wrapper label {
    font-size: 0.9rem;
    color: var(--woobedding-text);
    font-weight: 500;
}

.woobedding-orderby {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--woobedding-border);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    color: var(--woobedding-text);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    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='%23212529' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.woobedding-orderby:hover {
    border-color: var(--woobedding-primary);
}

.woobedding-orderby:focus {
    outline: none;
    border-color: var(--woobedding-primary);
    box-shadow: 0 0 0 3px rgba(0, 68, 138, 0.1);
}

/* =================================
   PRODUCTS GRID - 2 COLONNE FORZATE
   ================================= */

/* CRITICO: Forza display grid e rimuovi flex */
.woobedding-shop-container .woobedding-shop-content .woobedding-products-grid,
.woobedding-shop-content .woobedding-products-grid,
.woobedding-products-grid,
div.woobedding-products-grid {
    display: grid !important;
    display: -ms-grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    -ms-grid-columns: 1fr 1.5rem 1fr !important;
    gap: 1.5rem !important;
    column-gap: 1.5rem !important;
    row-gap: 1.5rem !important;
    margin-top: 1.5rem !important;
    /* RIMUOVI FLEX */
    flex-direction: unset !important;
    flex-wrap: unset !important;
    flex: none !important;
}

/* Sovrascrivi QUALSIASI data-columns */
.woobedding-products-grid[data-columns="2"],
.woobedding-products-grid[data-columns="3"],
.woobedding-products-grid[data-columns="4"],
.woobedding-products-grid[data-columns="5"],
.woobedding-products-grid[data-columns],
div.woobedding-products-grid[data-columns] {
    grid-template-columns: repeat(2, 1fr) !important;
    -ms-grid-columns: 1fr 1.5rem 1fr !important;
}

/* Se ci sono classi extra, sovrascrivi anche quelle */
.woobedding-shop-main .woobedding-products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Quando è in loading, mantieni il grid */
.woobedding-products-grid.woobedding-loading {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Per sicurezza, forza anche i children */
.woobedding-products-grid > * {
    flex: none !important;
    width: auto !important;
    max-width: none !important;
    grid-column: span 1 !important;
}

/* =================================
   PRODUCT CARD
   ================================= */
.woobedding-product-card {
    position: relative;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid transparent;
}

.woobedding-product-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border-color: transparent;
}

/* ========================================
   PRODUCT IMAGE WRAPPER CON GALLERY HOVER
   ======================================== */
.product-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #fafafa;
    aspect-ratio: 0.85;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.product-image-wrapper.has-gallery {
    cursor: pointer;
}

/* Image Slider Container - ASSOLUTO per contenere tutte le immagini */
.image-slider {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* CRITICO: Tutte le immagini del prodotto - COVER FORZATO */
.woobedding-product-card .product-image-wrapper .image-slider img,
.woobedding-product-card .image-slider img,
.image-slider .product-image,
.image-slider img,
.product-image-wrapper img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    opacity: 0 !important;
    transition: opacity 0.5s ease-in-out !important;
    will-change: opacity;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    /* Rimuovi qualsiasi contain o altri valori */
    -o-object-fit: cover !important;
    font-family: 'object-fit: cover;' !important; /* Polyfill IE */
}

/* Immagine attiva (visibile) */
.woobedding-product-card .image-slider img.active,
.woobedding-product-card .image-slider .product-image.active,
.image-slider .product-image.active,
.image-slider img.active {
    opacity: 1 !important;
    z-index: 1 !important;
}

/* Zoom leggero su hover dell'immagine attiva */
.woobedding-product-card:hover .image-slider .product-image.active,
.woobedding-product-card:hover .image-slider img.active {
    transform: scale(1.05) !important;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease-in-out !important;
}

/* ========================================
   GALLERY INDICATORS (pallini sotto le immagini)
   ======================================== */
.gallery-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Mostra indicatori solo su hover E solo se ci sono multiple immagini */
.woobedding-product-card:hover .gallery-indicators {
    opacity: 1;
    pointer-events: all;
}

.gallery-indicators .indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.gallery-indicators .indicator.active {
    background: white;
    transform: scale(1.3);
}

.gallery-indicators .indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.15);
}

/* ========================================
   PRODUCT DETAILS (PADDING MINIMI)
   ======================================== */
.product-details {
    padding: 0.5rem 0.5rem;
    text-align: center;
}

.product-category {
    font-size: 0.625rem;
    color: var(--woobedding-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1875rem;
    font-weight: 500;
}

.product-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0.25rem 0;
    line-height: 1.25;
    color: var(--woobedding-text);

}

.product-tagline {
    font-size: 0.6875rem;
    color: var(--woobedding-text-muted);
    font-style: italic;
    margin: 0.1875rem 0;
}

.product-price {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--woobedding-primary);
    margin: 0.375rem 0 0;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.375rem;
}

.product-price .price {
    color: var(--woobedding-primary);
}

.product-price del {
    font-size: 0.8125rem;
    color: var(--woobedding-text-muted);
    font-weight: 400;
}

.product-price ins {
    text-decoration: none;
}

/* Prezzo "A partire da:" più compatto */
.woobedding-price-prefix {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--woobedding-text-muted);
}

/* ========================================
   PRODUCT BADGES (Sale, Season, etc)
   ======================================== */
.onsale {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--woobedding-danger);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 11;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.season-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 2rem;
    height: 2rem;
    z-index: 11;
    object-fit: contain;
}

/* =================================
   LOADING STATE
   ================================= */
.woobedding-loading {
    position: relative;
    min-height: 20rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woobedding-loading:after {
    content: "";
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--woobedding-border);
    border-top-color: var(--woobedding-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =================================
   PAGINAZIONE
   ================================= */
.woobedding-shop-pagination {
    margin-top: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.woobedding-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.woobedding-pagination-wrapper ul.page-numbers {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.woobedding-pagination-wrapper ul.page-numbers li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

.woobedding-pagination-wrapper .page-numbers {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--woobedding-primary);
    background: white;
    border: 1px solid var(--woobedding-border);
    border-radius: 0.375rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.woobedding-pagination-wrapper a.page-numbers:hover {
    background: var(--woobedding-primary);
    color: white;
    border-color: var(--woobedding-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 68, 138, 0.2);
}

.woobedding-pagination-wrapper .page-numbers.current {
    background: var(--woobedding-primary);
    color: white;
    border-color: var(--woobedding-primary);
    cursor: default;
    font-weight: 600;
}

.woobedding-pagination-wrapper .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
    min-width: auto;
    padding: 0 0.25rem;
}

.woobedding-pagination-wrapper .page-numbers.dots:hover {
    background: transparent;
    color: var(--woobedding-text-muted);
    transform: none;
    box-shadow: none;
}

.woobedding-pagination-wrapper .prev.page-numbers,
.woobedding-pagination-wrapper .next.page-numbers {
    font-weight: normal;
    padding: 0.5rem 1rem;
}

.woobedding-pagination-wrapper .prev.page-numbers:before {
    content: "←";
    margin-right: 0.25rem;
}

.woobedding-pagination-wrapper .next.page-numbers:after {
    content: "→";
    margin-left: 0.25rem;
}

.woobedding-shop-pagination ul,
.woobedding-shop-pagination li {
    list-style: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.woobedding-pagination-wrapper ul.page-numbers:before,
.woobedding-pagination-wrapper ul.page-numbers li:before {
    content: none !important;
    display: none !important;
}

.woocommerce .woobedding-pagination-wrapper ul.page-numbers,
.woocommerce-page .woobedding-pagination-wrapper ul.page-numbers {
    margin: 0 !important;
    padding: 0 !important;
}

/* =================================
   NESSUN PRODOTTO
   ================================= */
.woobedding-no-products {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--woobedding-secondary);
    border-radius: var(--woobedding-radius);
    margin: 2rem 0;
}

.woobedding-no-products p {
    font-size: 1.1rem;
    color: var(--woobedding-text-muted);
    margin-bottom: 1.5rem;
}

.woobedding-reset-filters-inline {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--woobedding-primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.woobedding-reset-filters-inline:hover {
    background: var(--woobedding-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 68, 138, 0.2);
}

/* =================================
   RESPONSIVE TABLET
   ================================= */
@media (max-width: 768px) {
    .woobedding-shop-container {
        padding: 1rem 0.75rem;
        margin-bottom: 25rem !important;
    }

    .woobedding-shop-main {
        flex-direction: column;
        gap: 0;
    }

    .woobedding-shop-content {
        padding-bottom: 3rem;
    }

    /* TABLET: forza 2 colonne */
    .woobedding-products-grid,
    .woobedding-products-grid[data-columns] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        margin-top: 1.5rem;
    }

    .product-image-wrapper {
        aspect-ratio: 0.8;
    }

    .product-details {
        padding: 0.875rem;
    }

    .product-title {
        font-size: 0.9rem;

    }

    .product-price {
        font-size: 1.125rem;
    }

    .woobedding-shop-pagination {
        margin-top: 2rem;
        margin-bottom: 1.5rem;
    }

    .woobedding-pagination-wrapper ul.page-numbers {
        gap: 0.25rem;
    }

    .woobedding-pagination-wrapper .page-numbers {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }

    /* Disabilita gallery hover su tablet per performance */
    .woobedding-product-card:hover .gallery-indicators {
        opacity: 0;
        pointer-events: none;
    }
}

/* =================================
   RESPONSIVE MOBILE
   ================================= */
@media (max-width: 480px) {
    /* MOBILE: 1 colonna */
    .woobedding-products-grid,
    .woobedding-products-grid[data-columns] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .woobedding-mobile-filters-panel {
        width: 90%;
    }

    /* Disabilita completamente la gallery su mobile */
    .image-slider .product-image:not(.active),
    .image-slider img:not(.active) {
        display: none;
    }

    .gallery-indicators {
        display: none !important;
    }
}

/* =================================
   SAFE AREAS (iPhone X+)
   ================================= */
@supports (padding: max(0px)) {
    .woobedding-mobile-filters-header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .woobedding-mobile-filters-footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* INDENTATURA SOTTOCATEGORIE */
.woobedding-filter-checkbox.subcategory,
.woobedding-filter-checkbox[data-parent] {
    padding-left: 2.5rem !important;
    font-size: 0.7rem !important;
}

.woobedding-filter-checkbox.subcategory .checkmark,
.woobedding-filter-checkbox[data-parent] .checkmark {
    left: 1.25rem !important;
}

/* RIMUOVI FRECCE TOGGLE CATEGORIE */
.woobedding-filter-checkbox .category-toggle,
.woobedding-filter-checkbox .toggle-icon,
.filter-section-content .toggle-icon,
.filter-section-content svg,
.woobedding-filter-checkbox svg,
.woobedding-filter-checkbox .dashicons {
    display: none !important;
}

/* RIMUOVI COMPLETAMENTE COLLAPSE CATEGORIE */
.category-toggle {
    display: none !important;
}

.category-item-header {
    display: block !important;
}

.category-children {
    display: block !important;
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Indentatura categorie per livello */
.category-item.level-1 .category-item-header {
    padding-left: 1.5rem;
}


.category-spacer {
    display: none !important;
}

/* Mantieni sempre espanse */
.category-item.expanded .category-children,
.category-item .category-children {
    display: block !important;
}
/* =================================
   MOBILE FILTERS - OTTIMIZZATO
   ================================= */
@media (max-width: 768px) {
    /* Contenuto mobile con padding ridotto */
    .woobedding-mobile-filters-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem !important;
    }

    /* Sezioni filtri con margini ridotti */
    .woobedding-mobile-filters-content .woobedding-filter-section {
        margin-bottom: 0.75rem !important;
        border: 1px solid #e5e5e5;
        border-radius: 0.375rem;
        overflow: hidden;
    }

    /* Titoli sezioni compatti */
    .woobedding-mobile-filters-content .filter-section-title {
        padding: 0.5rem 0.75rem !important;
        background: #f8f9fa;
        font-size: 0.8125rem !important;
        border: none;
        font-weight: 600;
    }

    /* Contenuto filtri compatto */
    .woobedding-mobile-filters-content .filter-section-content {
        padding: 0.375rem 0.5rem !important;
        max-height: none;
        display: block !important;
        transition: none;
    }

    .woobedding-mobile-filters-content .filter-section-content.collapsed {
        display: none !important;
    }

    /* Checkbox compatte su mobile */
    .woobedding-mobile-filters-content .woobedding-filter-checkbox {
        padding: 0.25rem 0.5rem 0.25rem 1.75rem !important;
        margin-bottom: 0.125rem !important;
        font-size: 0.75rem !important;
    }

    /* PRICE RANGE MOBILE - VISIBILE E COMPATTO */
    .woobedding-mobile-filters-content .price-range-slider {
        padding: 0.5rem 0 !important;
    }

    .woobedding-mobile-filters-content .price-inputs {
        display: flex !important;
        gap: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .woobedding-mobile-filters-content .price-input-group {
        flex: 1 !important;
    }

    .woobedding-mobile-filters-content .price-input-group label {
        display: block !important;
        font-size: 0.6875rem !important;
        font-weight: 500;
        color: var(--woobedding-text-muted);
        margin-bottom: 0.25rem !important;
    }

    .woobedding-mobile-filters-content .price-input-group input {
        width: 100% !important;
        padding: 0.375rem 0.5rem !important;
        border: 1px solid var(--woobedding-border) !important;
        border-radius: 0.25rem !important;
        font-size: 0.8125rem !important;
        display: block !important;
    }

    .woobedding-mobile-filters-content .price-range-display {
        display: block !important;
        position: relative !important;
        height: 0.375rem !important;
        background: #e9ecef !important;
        border-radius: 0.1875rem !important;
        margin: 0.75rem 0.25rem 0.5rem 0.25rem !important;
        overflow: hidden !important;
    }

    .woobedding-mobile-filters-content .price-range-bar {
        display: block !important;
        position: absolute !important;
        height: 100% !important;
        background: linear-gradient(90deg, var(--woobedding-primary-dark) 0%, var(--woobedding-primary) 100%) !important;
        border-radius: 0.1875rem !important;
        transition: all 0.3s ease !important;
    }

    .woobedding-mobile-filters-content .price-range-values {
        display: flex !important;
        justify-content: space-between !important;
        margin-top: 0.375rem !important;
        font-size: 0.6875rem !important;
        color: var(--woobedding-text-muted) !important;
        font-weight: 500 !important;
    }

    .woobedding-mobile-filters-content .price-range-values span {
        display: inline-block !important;
        background: var(--woobedding-secondary) !important;
        padding: 0.125rem 0.375rem !important;
        border-radius: 0.1875rem !important;
    }

    /* Categorie mobile compatte */
    .woobedding-mobile-filters-content .category-item-header {
        margin-bottom: 0.125rem !important;
    }

    .woobedding-mobile-filters-content .category-item.level-1 {
        padding-left: 0 !important;
    }

    .woobedding-mobile-filters-content .category-item.level-1 .category-item-header {
        padding-left: 1rem !important;
    }

    /* Footer mobile compatto */
    .woobedding-mobile-filters-footer {
        padding: 0.75rem !important;
        background: white;
        border-top: 1px solid #e5e5e5;
        display: flex;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .woobedding-mobile-filters-footer button {
        flex: 1;
        padding: 0.75rem !important;
        border-radius: 0.375rem !important;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.875rem !important;
    }
}
/* =================================
   FIX <BR> AUTOMATICI WORDPRESS
   ================================= */
.woobedding-filter-checkbox br,
.filter-section-title br,
.filter-section-content br,
.woobedding-filters br {
    display: none !important;
}

/* Reset line-height per evitare spazi */
.woobedding-filter-checkbox {
    line-height: 1.2 !important;
}

.woobedding-filter-checkbox * {
    line-height: inherit !important;
}

/* Assicura che gli span siano inline */
.woobedding-filter-checkbox span {
    display: inline !important;
    vertical-align: middle !important;
}

.woobedding-filter-checkbox .checkmark {
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Rimuovi <p> vuoti */
.woobedding-filters p:empty {
    display: none !important;
}

/* =================================
   FIX <BR> NELLE PRODUCT CARD
   ================================= */
.product-details br,
.product-price br,
.product-title br,
.product-category br,
.product-tagline br,
.woocommerce-Price-amount br {
    display: none !important;
}

/* Rimuovi <p> vuoti nei dettagli prodotto */
.product-details p:empty,
.product-details p:has(br:only-child) {
    display: none !important;
}

/* Fix inline per prezzi */
.product-price span {
    display: inline !important;
}

.woocommerce-Price-amount {
    display: inline !important;
}

/* Reset line-height product details */
.product-details {
    line-height: 1.5 !important;
}

.product-details * {
    line-height: inherit !important;
}

/* Fix spacing product card */
.product-category,
.product-title,
.product-tagline,
.product-price {
    display: block !important;
}