:root {
    --primary-color: #007bff;
    --secondary-color: #f0f8ff;
    --dark-color: #333;
    --light-color: #f8f9fa;
    --white-color: #fff;
    --font-family: 'Poppins', sans-serif;
    --gold-color: #ffc107;
    --gold-dark: #e0a800;
}

/* Scorrimento fluido globale */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.header {
    background: var(--white-color);
    padding: 20px 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 35px;
}

.header .logo img {
    height: 100px;
    display: block;
}

.header h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.header nav a {
    color: var(--dark-color);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
    font-size: 1.2em;
}

.header nav a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.hero {
    position: relative;
    overflow: hidden;
    color: var(--white-color);
    text-align: center;
    padding: 120px 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('hero.jpg') no-repeat center center/cover;
}

.hero h2 {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.footer a {
    color: #fff;
}

/* Compensa l'altezza dell'header sticky quando si usano le ancora dei menu */
#servizi, #chi-siamo, #contatti {
    scroll-margin-top: 160px;
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    color: var(--dark-color);
    margin-bottom: 50px;
    font-weight: 700;
}

.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    text-align: center;
}

.service-item {
    background: var(--white-color);
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
    flex: 1 1 calc(33.333% - 25px); 
    max-width: calc(33.333% - 25px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 220px;
    box-sizing: border-box;
    cursor: pointer;
}

.service-item img {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    transition: transform 0.4s ease;
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #a8e0ff, #c0f0ff);
    color: #333;
}

.service-item:hover img {
    transform: rotate(8deg) scale(1.05);
}

.service-item h3 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin: 5px 0 8px;
    font-weight: 600;
    transition: color 0.3s ease;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-item:hover h3 {
    color: var(--dark-color);
}

.service-item p {
    font-size: 1em;
    text-align: center;
}

.about-us {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 60px;
    background: var(--white-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.about-us-content {
    flex: 1;
    text-align: center;
}

.about-us-content p {
    text-align: justify;
}

/* STRUTTURA TIMELINE SENZA RIGHE GRIGIE E SENZA TITOLO */
.heritage-timeline-container {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px dashed #ddd;
    position: relative;
}

.timeline-line-wrapper {
    position: relative;
    margin: 20px 0 10px 0;
    padding: 10px 0;
}

.timeline-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: relative;
    z-index: 2;
    gap: 15px;
}

.timeline-node {
    text-align: center;
    position: relative;
}

/* Punto centrale */
.timeline-dot {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border: 4px solid var(--white-color);
    border-radius: 50%;
    margin: 0 auto 15px auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.timeline-node:hover .timeline-dot {
    transform: scale(1.3);
    background: var(--dark-color);
}

.timeline-date {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.timeline-node p {
    font-size: 0.85em;
    color: #555;
    line-height: 1.4;
    margin: 0;
    padding: 0 5px;
    text-align: center;
}

.contact-info-container {
    background: var(--white-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    margin-top: 80px;
    text-align: center;
}

.contact-info-container .section-title {
    margin-top: 0;
    margin-bottom: 20px;
}

.contact-info-text {
    line-height: 1.8;
}

.footer {
    background: var(--dark-color);
    color: var(--white-color);
    text-align: center;
    padding: 25px 20px;
    margin-top: 60px;
}

.footer p {
    margin: 0;
    font-size: 0.9em;
}

.footer .legal-text {
    margin-bottom: 8px;
}

@media(max-width:992px) {
    .service-item {
        flex: 1 1 calc(50% - 25px);
        max-width: calc(50% - 25px);
    }
    .timeline-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .timeline-node {
        display: flex;
        align-items: flex-start;
        text-align: left;
    }
    .timeline-dot {
        margin: 5px 20px 0 12px;
        flex-shrink: 0;
    }
    .timeline-node-content {
        flex: 1;
    }
    .timeline-node p {
        text-align: left;
        padding: 0;
    }
}

@media(max-width:768px) {
    .header {
        flex-direction: column;
        padding: 20px;
    }
    .header-right {
        flex-direction: column;
        margin-top: 15px;
        gap: 20px;
    }
    .header nav {
        margin-top: 0;
        text-align: center;
    }
    .hero h2 {
        font-size: 2.2em;
    }
    .hero p {
        font-size: 1em;
    }
    .section-title {
        font-size: 2em;
    }
    .services-grid {
        flex-direction: column;
    }
    .service-item {
        max-width: 100%;
        margin-bottom: 20px;
        flex: 1 1 auto;
    }
    .about-us {
        flex-direction: column;
        text-align: center;
    }
    #servizi, #chi-siamo, #contatti {
        scroll-margin-top: 240px;
    }
    .modal-content {
        padding: 20px !important;
        width: 95% !important;
    }
    .brand-list {
        grid-template-columns: 1fr 1fr !important;
        gap: 5px !important;
    }
    .brand-list li {
        font-size: 0.85em !important;
    }
    .modal-content h2 {
        font-size: 1.4em;
    }
    .modal-content h3 {
        font-size: 1.1em;
        margin-top: 15px;
    }
}
.contact-info-text a {
    white-space: nowrap;
}

.service-item h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    min-height: auto;
}

/* Stili del Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--dark-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 350px;
    text-align: left;
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.cookie-banner p {
    margin: 0 0 15px;
    font-size: 0.9em;
}

.cookie-banner .button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-banner button {
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: var(--white-color);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.cookie-banner button.decline {
    background-color: transparent;
    color: var(--primary-color);
}

.cookie-banner button:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.cookie-banner button.decline:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* STILI POPUP ASSISTENZA */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal-content {
    background: var(--white-color);
    padding: 40px;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--dark-color);
    font-weight: bold;
}

/* GRIGLIA SIMMETRICA INTEGRATA */
.brand-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
    list-style: none;
    padding: 0;
}

.brand-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f2f2f2;
    font-size: 0.95em;
    align-self: start;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.8em;
}

.modal-content h3 {
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    font-size: 1.25em;
    margin-top: 30px;
}

/* RECENSIONI */
.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    flex-wrap: wrap;
    gap: 15px;
}

.reviews-rating {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reviews-stars {
    color: #ffc107;
    font-size: 1.5em;
    letter-spacing: 2px;
}

.reviews-score {
    font-size: 1.1em;
    font-weight: 600;
}

.google-reviews-btn {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s ease;
    white-space: nowrap;
}

.google-reviews-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.review-card {
    background: var(--white-color);
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

.review-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.stars {
    color: #ffc107;
    font-size: 1.3em;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.review-card p {
    font-size: 0.92em;
    line-height: 1.7;
    color: #555;
    flex-grow: 1;
}

.review-author {
    margin-top: 20px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95em;
}



/* RESPONSIVE */
@media(max-width:1200px) {
    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width:768px) {

    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .review-card {
        min-height: auto;
    }

    .google-reviews-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* ================================
   SERVICE BOX - FIX CORRETTO
   ================================ */

/* reset link senza alterare stile titoli */
.service-item {
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* elimina sottolineatura in tutti gli stati */
.service-item:link,
.service-item:visited,
.service-item:hover,
.service-item:active {
    text-decoration: none !important;
}

/* testo descrizione SEMPRE nero */
.service-item p {
    color: var(--dark-color) !important;
}

/* TITOLI come prima (blu tema) */
.service-item h3 {
    color: var(--primary-color) !important;
}

/* hover: mantieni comportamento originale */
.service-item:hover h3 {
    color: var(--dark-color);
}