/*
 Theme Name:   Hello Elementor Child
 Template:     hello-elementor
 Author:       Dario Scognamiglio
 Version:      1.1.3
*/

/* --- 1. RESET E LARGHEZZA (1280px) --- */
body.woocommerce-page .site-main,
body.woocommerce-page .modern-product-layout {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    padding: 20px !important;
}

/* --- 2. PAGINA PRODOTTO SINGOLO --- */
.product-main-container { display: flex !important; flex-wrap: wrap !important; gap: 50px !important; margin-bottom: 60px !important; align-items: flex-start !important; }
.product-gallery-custom { flex: 0 0 60% !important; max-width: 60% !important; display: flex !important; flex-direction: column !important; gap: 20px !important; }
.product-summary-modern { flex: 1 !important; min-width: 300px !important; }

.main-image-viewport img { width: 100% !important; border-radius: 12px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important; transition: opacity 0.3s !important; }
.thumbnails-grid-custom { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 15px !important; width: 100% !important; }
.custom-thumb { width: 100% !important; border-radius: 8px !important; opacity: 0.6 !important; transition: 0.3s !important; border: 2px solid transparent !important; }
.custom-thumb.active, .custom-thumb:hover { opacity: 1 !important; border-color: #111 !important; }

/* Materiali e Formati (Single) */
.product-selection-section { border-bottom: 1px solid #eee !important; padding: 20px 0 !important; }
.product-selection-section h4 { font-size: 0.75rem !important; font-weight: 300 !important; letter-spacing: 1.2px !important; color: #999 !important; text-transform: uppercase !important; margin-bottom: 20px !important; border:none !important; }

.materials-swatches { display: flex !important; gap: 25px !important; flex-wrap: wrap !important; }
.swatch-item { text-align: center !important; width: 60px !important; }

/* Etichette Materiali Uniformate */
.swatch-label { 
    font-size: 0.6rem !important; 
    font-weight: 400 !important; 
    text-transform: uppercase !important; 
    color: #888 !important; 
    letter-spacing: 0.5px !important; 
    display: block !important; 
    margin-top: 8px !important;
    line-height: 1.2 !important;
}

.swatch-circle { width: 38px !important; height: 38px !important; border-radius: 50% !important; display: block !important; border: 1px solid #e5e5e5 !important; margin: 0 auto !important; background-color: #eee; }

/* Colori Swatches */
.swatch-circle.city { background-color: #9e9e9e !important; }
.swatch-circle.scuba { background-color: #263238 !important; }
.swatch-circle.tweed { background-color: #d2b48c !important; }
.swatch-circle.wood { background-color: #8d6e63 !important; }
.swatch-circle.zebrano { background-color: #5d4037 !important; }

.format-tag { display: inline-block !important; padding: 6px 15px !important; border: 1px solid #e0e0e0 !important; border-radius: 3px !important; font-size: 0.75rem !important; color: #444 !important; }

/* --- 3. CATALOGO (SHOP) --- */
.woocommerce-products-header__title.page-title { font-size: 2.5rem !important; font-weight: 300 !important; margin-bottom: 40px !important; text-align: left !important; }
.woocommerce-result-count, .woocommerce-ordering { display: none !important; }

/* Barra Filtri Orizzontale */
.custom-filter-bar { display: flex !important; align-items: center !important; gap: 40px !important; margin-bottom: 50px !important; padding: 20px 0 !important; border-bottom: 1px solid #f0f0f0 !important; flex-wrap: wrap !important; width: 100% !important; clear: both !important; }
.filter-group { display: flex !important; align-items: center !important; gap: 12px !important; }
.filter-label { font-size: 0.75rem !important; text-transform: uppercase !important; color: #999 !important; font-weight: 500 !important; }
.custom-filter-bar select { border: none !important; background: transparent !important; font-size: 0.9rem !important; font-weight: 600 !important; outline: none !important; cursor: pointer !important; -webkit-appearance: none !important; }

/* FIX GRIGLIA: Rimozione buco prima posizione */
.woocommerce ul.products { 
    display: grid !important; 
    grid-template-columns: repeat(4, 1fr) !important; 
    gap: 30px !important; 
    padding: 0 !important; 
    margin: 0 !important; 
    width: 100% !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after { 
    content: none !important; /* Elimina gli elementi fantasma di WooCommerce */
    display: none !important;
}

.woocommerce ul.products li.product { 
    background: #fff !important; 
    padding: 20px !important; 
    border-radius: 15px !important; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important; 
    border: 1px solid #f0f0f0 !important;
    display: flex !important; 
    flex-direction: column !important; 
    transition: all 0.3s ease !important;
    margin: 0 !important;
    width: 100% !important;
    grid-column-start: auto !important; /* Forza l'auto-posizionamento */
}

/* Immagini e Pulsanti Card */
ul.products li.product .woocommerce-loop-product__link { position: relative !important; display: block !important; overflow: hidden !important; border-radius: 10px !important; margin-bottom: 15px !important; }
ul.products li.product img.secondary-hover-image { position: absolute !important; top: 0 !important; left: 0 !important; opacity: 0 !important; transition: 0.4s !important; }
ul.products li.product:hover img.secondary-hover-image { opacity: 1 !important; }
ul.products li.product:hover img:not(.secondary-hover-image) { opacity: 0 !important; }

ul.products li.product .button { 
    padding: 10px 20px !important; font-size: 0.75rem !important; text-transform: uppercase !important;
    background: transparent !important; color: #111 !important; border: 1px solid #111 !important;
    width: fit-content !important; border-radius: 4px !important; margin-top: auto !important;
}

/* 4. DESCRIZIONE COMPLETA */
.details-content { max-width: 1280px !important; line-height: 1.8; color: #444; }
.details-content h3 { font-size: 2.2rem !important; font-weight: 300 !important; margin: 40px 0 30px !important; }

/* Aggiunta freccetta custom ai filtri */
.custom-filter-bar select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding-right: 25px !important; /* Spazio per la freccetta */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right center !important;
    background-size: 12px !important;
}

/* Effetto hover sulla freccetta */
.custom-filter-bar select:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
}

/* --- RIMOZIONE PADDING IMMAGINE CARD CATALOGO --- */

/* 1. Azzeriamo il padding della card per far toccare l'immagine ai bordi */
.woocommerce ul.products li.product {
    padding: 0 !important;
    overflow: hidden !important; /* Fondamentale per mantenere i bordi arrotondati dell'immagine */
}

/* 2. L'immagine occupa tutto lo spazio superiore */
ul.products li.product .woocommerce-loop-product__link {
    margin-bottom: 0 !important;
    border-radius: 0 !important; /* I bordi sono ora gestiti dal contenitore padre */
}

ul.products li.product img {
    border-radius: 0 !important; /* Rimuoviamo il raggio interno dell'immagine */
    margin-bottom: 0 !important;
}

/* 3. Riapplichiamo il padding solo ai testi e al pulsante */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product .price,
ul.products li.product .button {
    margin-left: 20px !important;
    margin-right: 20px !important;
}

/* Spaziatura specifica per il titolo e l'ultimo elemento */
ul.products li.product .woocommerce-loop-product__title {
    margin-top: 20px !important;
}

ul.products li.product .button {
    margin-bottom: 20px !important;
}

/* --- RIFINITURA SPAZIATURE CARD E FORMATI --- */

/* Titolo più vicino all'immagine */
ul.products li.product .woocommerce-loop-product__title {
    margin-top: 12px !important; 
    margin-bottom: 5px !important;
    font-size: 1.05rem !important;
}

/* Stile per la lista formati nella card */
.card-formats-list {
    font-size: 0.7rem !important;
    color: #aaa !important;
    font-weight: 300 !important;
    margin: 0 20px 30px 20px !important; /* Aumentato il margine bottom per staccare dal pulsante */
    letter-spacing: 0.3px;
}

/* Prezzo (se visibile) distanziato */
ul.products li.product .price {
    margin-bottom: 15px !important;
    font-size: 0.85rem !important;
}

/* Pulsante distanziato dal testo sopra */
ul.products li.product .button {
    margin-top: auto !important; /* Spinge il pulsante sempre in fondo */
    margin-bottom: 20px !important;
}

/* --- OVERRIDE COLORE TITOLO CARD --- */

/* Forza il colore nero sul titolo e sul link contenuto */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
    color: #000000 !important;
}

/* Opzionale: un leggero feedback al passaggio del mouse se vuoi che cambi */
.woocommerce ul.products li.product:hover .woocommerce-loop-product__title {
    color: #000000 !important; /* Mantiene il nero anche in hover */
}
