﻿/* ==================================================
   1. VARIABILI E DESIGN SYSTEM (Modifica qui per tutti)
================================================== */
:root {
    --primary-color: #4caf50;          /* Verde istituzionale */
    --primary-hover: #388e3c;          /* Verde scuro per hover */
    --primary-light: #e8f5e9;          /* Sfondo leggero per badge */
    --text-main: #666666;              /* Modificato a #666666 */
    --text-muted: #666666;             /* Modificato a #666666 */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #e9ecef;
    --radius-sm: 0px;                  /* Bordi squadrati */
    --radius-md: 0px;                  /* Bordi squadrati */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset di base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    background-color: var(--bg-body);
    padding: 20px 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==================================================
   2. BARRA AZIONI (Pulsante PDF Centrato)
================================================== */
.actions-bar {
    display: flex;
    justify-content: center;
    max-width: 960px;
    margin: 0 auto 20px auto;
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.btn-pdf:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
}

.btn-pdf svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==================================================
   3. SCHEDA PRODOTTO (CARD PRINCIPALE)
================================================== */
.product-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Layout Desktop (Schermi >= 768px) */
@media (min-width: 768px) {
    body {
        padding: 40px 20px;
    }

    .product-card {
        flex-direction: row;
        padding: 36px;
        gap: 36px;
    }

    .product-media {
        flex: 0 0 38%;
        position: sticky;
        top: 20px;
    }

    .product-info {
        flex: 1;
    }
}

/* ==================================================
   4. MEDIA / IMMAGINE PRODOTTO E GALLERIA
================================================== */
.product-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background-color: transparent;
    border: none;
    padding: 0;
}

.main-image, .product-media img:not(.thumbnail) {
    width: 100%;
    max-width: 320px;
    height: auto;
    object-fit: contain;
}

.thumbnails-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 320px;
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 2px;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

.thumbnail:hover, .thumbnail.active {
    border-color: var(--primary-color);
}

/* ==================================================
   5. DETTAGLI ED ELEMENTI TESTUALI
================================================== */
.product-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.product-badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.product-title {
    color: var(--text-main);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.product-summary {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    border-radius: 0;
    margin-bottom: 20px;
}

.product-summary p {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.custom-list {
    list-style: none;
    padding-left: 0;
    color: #666666;
}

.custom-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    font-size: 0.925rem;
    line-height: 1.5;
    color: #666666;
}

.custom-list li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.65em; /* Posiziona il centro del pallino a metà della prima riga */
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.product-description {
    color: #666666;                    /* Modificato da #495057 a #666666 */
    margin-bottom: 20px;
    text-align: left;
    font-size: 0.925rem;
}

.product-features {
    margin-bottom: 24px;
    color: #666666;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 20px;
    color: #666666;
}

.logo-ce img {
    height: 40px;
    width: auto;
    display: block;
}

/* ==================================================
   6. STILI DI STAMPA / PDF
================================================== */
@media print {
    body {
        background-color: #ffffff;
        padding: 0;
        font-size: 10pt;
        color: #666666;
    }

    .actions-bar, .thumbnails-grid {
        display: none !important;
    }

    .product-card {
        box-shadow: none;
        border: none;
        padding: 0;
        flex-direction: row !important;
        gap: 20px;
    }

    .product-media {
        width: 30% !important;
    }

    .product-info {
        width: 70% !important;
    }

    .product-title {
        font-size: 14pt;
        color: #666666;
    }
    
    .product-badge {
        border: 1px solid var(--primary-color);
    }
}

/* ==================================================
   CLASSI DI EVIDENZA E HIGHLIGHT REIMPIEGABILI
================================================== */

/* 1. Box in Negativo Rosso d'Impatto (es. Conforme C.d.S.) */
.highlight-negative {
    margin-top: 1rem;
    padding: 0.6rem 0.8rem;
    background-color: #dc2626;
    color: #ffffff;
    border-radius: var(--radius-sm, 0px);
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 2. Box di Avviso / Note (Sfondo Chiaro con Bordo Verde) */
.highlight-box {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--primary-light, #e8f5e9);
    border-left: 4px solid var(--primary-color, #4caf50);
    color: var(--text-main, #666666);
    font-size: 0.875rem;
    font-weight: 600;
}

/* 3. Evidenziatore del solo Testo Inline (Giallo chiaro o Verde chiaro) */
.text-highlight {
    background-color: #fef08a; /* Giallo morbido */
    color: #1f2937;
    padding: 1px 5px;
    font-weight: 600;
}