/* ==========================================================================
   VERSIONE V54.0 - DYNAMIC COLUMNS & GRID FIX
   ========================================================================== */

#v40-scope { width: 100%; margin: 0 auto; padding: 0px; box-sizing: border-box; font-family: Barlow, sans-serif; }
#v40-scope.v40-layout-with-sidebar { display: flex; gap: 30px; }

/* SIDEBAR */
.v40-sidebar { flex: 0 0 260px; background: #fdfdfd; padding: 20px; border: 1px solid #eee; border-radius: 12px; position: sticky; top: 120px; height: fit-content; }
.v40-main-area { flex: 1; }

.v40-filter-item { margin-bottom: 25px; }
.v40-filter-item label { display: block; font-weight: 800; font-size: 11px; text-transform: uppercase; color: #0654AE; margin-bottom: 12px; }
.v40-checklist { max-height: 180px; overflow-y: auto; }
.v40-check-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.v40-check-row input { width: 17px !important; height: 17px !important; margin: 0 !important; cursor: pointer; }
.v40-check-row label { margin: 0 !important; font-size: 14px !important; text-transform: none !important; font-weight: 400 !important; cursor: pointer; }

/* GRIGLIA PRINCIPALE DINAMICA */
.v40-grid-box { 
    display: grid !important; 
    gap: 40px 20px; 
    align-items: stretch; 
    margin-bottom: 3px;
    width: 100%;
}

/* Classi per il controllo colonne tramite shortcode */
.v40-cols-1 { grid-template-columns: 1fr !important; }
.v40-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
.v40-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.v40-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }

/* CARD */
.v40-card { 
    background: #fff; 
    border: 1px solid #e0e0e0; 
    padding: 15px; 
    border-radius: 10px; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    transition: 0.3s;
    box-sizing: border-box;
}
.v40-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.07); }

/* IMMAGINI - FIX TAGLIO IMMAGINE */
.v40-img-box { 
    height: 200px; 
    width: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 15px; 
    overflow: hidden; 
    flex-shrink: 0; 
    padding: 10px; 
    box-sizing: border-box;
}
.v40-img-box img { 
    max-height: 100%; 
    max-width: 100%; 
    object-fit: contain !important; 
    width: auto;
    height: auto;
    display: block;
}

/* CONTENUTO */
.v40-card-content { flex-grow: 1; display: flex; flex-direction: column; }
.v40-title a { color: #333; text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.3; display: block; margin-bottom: 10px; }

/* STELLINE RATING */
.v40-stars-out { position: relative; display: inline-block; font-size: 16px; line-height: 1; color: #e0e0e0; letter-spacing: 2px; }
.v40-stars-out::before { content: "\2605\2605\2605\2605\2605"; }
.v40-stars-in { position: absolute; top: 0; left: 0; white-space: nowrap; overflow: hidden; color: #ffb400; }
.v40-stars-in::before { content: "\2605\2605\2605\2605\2605"; }

/* CUORI Preferiti */
.v40-meta-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.v40-wish-btn { background: none !important; border: none !important; cursor: pointer; padding: 0; line-height: 0; }
.v40-svg-v { fill: transparent; stroke: #0654AE; stroke-width: 2px; width: 22px; height: 22px; }
.v40-svg-p { fill: #0654AE; width: 22px; height: 22px; display: none; }
.v40-wish-box.is-added .v40-svg-p { display: block; }
.v40-wish-box.is-added .v40-svg-v { display: none; }

/* PREZZO E RISPARMIO */
.v40-price-box { font-size: 20px; font-weight: 800; color: #333; margin-top: auto; margin-bottom: 10px; }
.v40-price-box ins { text-decoration: none; color: #d01345; }
.v40-save { color: #0b9e19; font-size: 11px; font-weight: bold; padding: 3px 8px; border-radius: 4px; display: inline-block; margin-bottom: 15px; }

/* BOTTONE CARRELLO */
.v40-cart-btn {
    display: block;
    width: 100%;
    background-color: #0654AE;
    color: #fff !important;
    text-align: center;
    padding: 12px 10px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13px;
    border: 2px solid #0654AE;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 15px;
    box-sizing: border-box;
    text-transform: uppercase;
}
.v40-cart-btn:hover {
    background-color: transparent !important;
    color: #0654AE !important;
}

/* PAGINAZIONE */
.v40-page-num { border: 1px solid #ddd; background: #fff; color: #333; padding: 8px 15px; cursor: pointer; border-radius: 4px; font-weight: bold; transition: 0.2s; }
.v40-page-num:hover { border-color: #0654AE; color: #0654AE; }
.v40-page-num.is-active { background: #0654AE; color: #fff; border-color: #0654AE; }

/* RESET FILTRI */
#v40-f-reset { background-color: #0654AE; color: #fff; border: 2px solid #0654AE; padding: 10px; width: 100%; font-weight: bold; border-radius: 4px; cursor: pointer; transition: all 0.3s ease; margin-top: 20px; }
#v40-f-reset:hover { background-color: transparent; color: #0654AE; }

/* BRAND LINK */
.v40-brand a { color: #0654AE; text-decoration: none; font-size: 13px; font-weight: 600; }
.v40-brand a:hover { text-decoration: underline; }

/* RESPONSIVE */
@media (max-width: 992px) { 
    .v40-cols-3, .v40-cols-4 { grid-template-columns: repeat(2, 1fr) !important; } 
}

@media (max-width: 768px) { 
    #v40-scope.v40-layout-with-sidebar { flex-direction: column; }
    .v40-sidebar { width: 100%; position: static; margin-bottom: 20px; }
    .v40-grid-box { grid-template-columns: 1fr !important; }
}
@media (min-width: 768px) {
	.v40-mobile-filter-toggle{display:none;}
}