/* /gestionale/assets/css/main.css (NUOVA VERSIONE) */

/* --- VARIABILI GLOBALI (popolate da PHP) --- */
:root {
    --colore-primario: #4CAF50;
    --colore-secondario: #005f73;
    --colore-testo: #333333;
    --colore-sfondo: #FFFFFF;
    --colore-footer: #005f73;
    --font-principale: 'Montserrat', sans-serif;
}

/* --- RESET E IMPOSTAZIONI DI BASE --- */
body {
    font-family: var(--font-principale);
    margin: 0;
    background-color: var(--colore-sfondo);
    color: var(--colore-testo);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 80px; /* Spazio per l'header fisso */
}

main {
    flex-grow: 1;
}

/* --- HEADER --- */

/* Utility class per centrare il contenuto */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* --- Struttura Generale --- */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

body {
    /* Dobbiamo aggiornare questo valore per fare spazio al nuovo header più alto */
    padding-top: 115px; 
}


/* --- Top Bar (Social) --- */
.header-top-bar {
    background-color: #f8f9fa; /* Un grigio molto chiaro */
    padding: 0.3rem 0;
    border-bottom: 1px solid #e9ecef;
}

.header-top-bar .social-icons {
    display: flex;
    justify-content: flex-end; /* Allinea le icone a destra */
    align-items: center;
}

.header-top-bar .social-icons a {
    color: #6c757d; /* Colore grigio per le icone */
    font-size: 0.9rem;
    margin-left: 1rem;
}
.header-top-bar .social-icons a:hover {
    color: var(--colore-secondario);
}


/* --- Header Principale (Logo, Menu, Carrello) --- */
.header-main .container {
    display: flex;
    justify-content: space-between; /* Crea le 3 colonne */
    align-items: center;
    height: 80px;
}

.header-main-left {
    flex: 1 0 0; /* Occupa lo spazio disponibile a sinistra */
}

.header-main-center {
    text-align: center;
}

.header-main-right {
    flex: 1 0 0; /* Occupa lo spazio disponibile a destra */
    display: flex;
    justify-content: flex-end; /* Allinea il carrello a destra */
}

.logo {
    text-decoration: none;
    color: var(--colore-secondario);
    font-size: 1.8rem;
    font-weight: 700;
}

.main-nav a {
    text-decoration: none;
    color: var(--colore-secondario);
    margin: 0 1rem;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--colore-primario);
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

.cart-icon {
    position: relative;
    font-size: 1.5rem;
    color: var(--colore-secondario);
}

.cart-icon .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--colore-primario);
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
}

/* --- BOTTONI --- */
.btn-primary {
    background-color: var(--colore-primario);
    color: white;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.btn-primary:hover {
    background-color: #3e8e41; /* Un verde leggermente più scuro */
    transform: translateY(-2px);
}
.btn-secondary {
    background-color: var(--colore-secondario);
    color: white;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.btn-secondary:hover {
    background-color: #004c5a;
    transform: translateY(-2px);
}

/* --- STRUTTURA SEZIONI --- */
.content-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--colore-secondario);
    margin-bottom: 0.5rem;
}

.section-divider {
    width: 80px;
    height: 3px;
    background-color: var(--colore-primario);
    margin: 0 auto 2.5rem auto;
}
.section-paragraph {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

/* --- BLOCCO: HERO --- */
.hero-section {
    height: 60vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    color: white;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
.hero-content {
    position: relative;
    z-index: 2;
}
.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}
.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    max-width: 700px;
}

/* --- BLOCCO: ICON FEATURES --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: center;
}
.feature-item .feature-icon {
    font-size: 3rem;
    color: var(--colore-primario);
    margin-bottom: 1rem;
}
.feature-item h3 {
    font-size: 1.3rem;
    color: var(--colore-secondario);
    margin-bottom: 0.5rem;
}
.feature-item p {
    color: #666;
    line-height: 1.6;
}

/* --- BLOCCO: FEATURED PRODUCTS --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}
/* Stile product-card.css unito qui per semplicità */
.product-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    text-decoration: none;
    color: var(--colore-testo);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.product-card a {
    text-decoration: none;
    color: inherit;
}
.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
}

.product-card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Questa è la correzione: l'immagine viene contenuta */
    border-radius: 10px 10px 0 0;
}

.product-card-content {
    padding: 1.5rem;
    text-align: center;
}
.product-card-content h3 {
    margin: 0.5rem 0;
    font-size: 1.2rem;
}
.product-card-content .product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--colore-primario);
}
.product-card-content .product-category {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
}


/* --- BLOCCO: CONTACT MAP --- */
.contact-map-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.contact-info p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}
.contact-info i {
    color: var(--colore-primario);
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}
.contact-info h3, .contact-info h4 {
    color: var(--colore-secondario);
}
.map-container iframe {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    border: 0;
}


/* --- FOOTER --- */
.footer {
    background-color: var(--colore-footer);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}
.footer p {
    margin: 0.5rem 0;
}
.footer .social-icons a {
    color: white;
    font-size: 1.5rem;
    margin: 0 0.8rem;
}
.footer .social-icons a:hover {
    color: var(--colore-primario);
}

/* REGOLA CSS PRODOTTO SINGOLO ----------------------------------------*/
/* --- PAGINA DETTAGLIO PRODOTTO --- */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

@media (min-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.product-images .main-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.gallery-thumbnails img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #ddd;
}

.product-info-detail .product-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-info-detail .product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--colore-primario);
    margin-bottom: 1.5rem;
}

.product-description {
    line-height: 1.7;
    margin-bottom: 2rem;
}

.add-to-cart-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* FINE REGOLE CSS PRODOTTO SINGOLO ----------------------------------*/ 


/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        position: relative; /* Togliamo il fisso su mobile per semplicità */
        padding-top: 0;
    }
    body {
        padding-top: 0;
    }
    .main-nav {
        margin: 1rem 0;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .main-nav a {
        margin: 0.5rem;
    }
    .header-right {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .contact-map-grid {
        grid-template-columns: 1fr;
    }
}

/* --- PAGINA PROMOZIONI --- */
.promotions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.promo-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.promo-card-image img {
    width: 100%;
    aspect-ratio: 16 / 9; /* Formato widescreen per le immagini promo */
    object-fit: cover;
}

.promo-card-content {
    padding: 1.5rem;
    flex-grow: 1; /* Fa in modo che il contenuto occupi lo spazio disponibile */
}

.promo-card-content h3 {
    margin-top: 0;
    color: var(--colore-secondario);
}

.promo-card-actions {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* Spazio tra i pulsanti */
    justify-content: flex-start;
}

.promo-card-actions .btn-primary,
.promo-card-actions .btn-secondary {
    width: 100%;
    text-align: center;
}
.promo-card-image {
    position: relative; /* Necessario per posizionare l'etichetta */
}

.promo-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--colore-primario);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 10;
}

/* --- PAGINA DETTAGLIO PROMOZIONE (SOLUZIONE FLEXBOX DEFINITIVA) --- */

.promo-detail-container {
    max-width: 700px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    /* Aggiungiamo display: flex per controllare la struttura interna */
    display: flex;
    flex-direction: column;
}

.promo-detail-header-image img {
    width: 100%;
    height: auto;
    display: block;
}

.promo-detail-body {
    padding: 2rem;
    /* Diciamo a questo blocco di essere flessibile e di contenere i suoi figli */
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Permette al corpo di crescere per riempire lo spazio */
}

.promo-full-description {
    line-height: 1.7;
    font-size: 1.1rem;
    flex-grow: 1; /* Occupa tutto lo spazio disponibile, spingendo il pulsante in basso */
}

.promo-detail-body hr {
    width: 100%;
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid #eee;
}

.promo-detail-actions {
    /* Questo contenitore ora è un elemento flessibile e non può "scappare" */
    width: 100%;
	 text-align: center; /* <-- AGGIUNGI QUESTA RIGA PER CENTRARE */
}

/* Stile per il link della card nella pagina della lista (invariato) */
.promo-card-link {
    text-decoration: none;
    color: inherit;
}