
:root {
    --primary-color: #3452A3;
    --text-color: #767676;
    --bg-color: #ffffff;
    --light-bg: #f4f4f4;
    --border-color: #eaeaea;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 100px; /* Spazio per l'header fisso */
}

/* --- Loader --- */
#loader { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease; }
.spinner { border: 6px solid #f3f3f3; border-top: 6px solid var(--primary-color); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Header / Nav --- */
.headerFix { position: fixed; top: 0; left: 0; width: 100%; background: #fff; z-index: 1000; border-bottom: 2px solid var(--border-color); }
.header-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 10px 20px; }
.logo img { max-height: 60px; width: auto; }
.nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.button, .buttonActive { text-decoration: none; padding: 10px 15px; border-radius: 5px; color: var(--text-color); transition: all 0.3s; font-weight: 500; }
.button:hover { background-color: var(--light-bg); color: var(--primary-color); }
.buttonActive { color: var(--primary-color); font-weight: bold; background-color: var(--light-bg); }

/* --- Container Principale --- */
main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 40px 20px; width: 100%; }
.titolo { color: #000; font-size: 2.5rem; margin-bottom: 30px; text-align: center; }
.intro { margin-bottom: 30px; text-align: justify; font-size: 1.1rem; }

/* --- Chi siamo --- */
.chisiamo-content::after { content: ""; display: table; clear: both; }
.chisiamo-content img { float: right; width: 35%; max-width: 350px; border-radius: 50%; border: 4px solid var(--primary-color); margin: 0 0 20px 30px; }
.orari-table { width: 100%; max-width: 500px; margin: 40px auto; text-align: center; border-collapse: collapse; }
.orari-table td { padding: 15px; font-size: 1.1rem; border-bottom: 1px solid var(--border-color); }
.orari-table tr:nth-child(odd) td { font-style: italic; font-size: 1.3rem; border-bottom: none; padding-bottom: 0;}

/* --- Partner Brands --- */
.brands-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; align-items: center; justify-items: center; margin-top: 40px; padding: 20px; background: #fff; border-radius: 10px; border: 1px solid var(--border-color); }
.brands-grid img { max-width: 100%; height: auto; transition: opacity 0.3s; }
.brands-grid a:hover img { opacity: 0.6; }

/* --- Servizi --- */
.servizio-card { display: flex; align-items: center; gap: 40px; border-bottom: 2px solid var(--border-color); padding-bottom: 40px; margin-bottom: 40px; }
.servizio-card:last-child { border-bottom: none; }
.servizio-card img { width: 140px; height: 140px; object-fit: contain; flex-shrink: 0; }
.servizio-text h3 { color: #000; font-size: 1.8rem; margin-bottom: 15px; }

/* --- Contatti (Cards Team) --- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; margin-bottom: 60px; }
.card { background: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color); border-radius: 8px; padding: 30px 20px; text-align: center; transition: transform 0.3s; }
.card:hover { transform: translateY(-5px); }
.card img.avatar { width: 100px; height: 100px; margin-bottom: 15px; }
.card h2 { font-size: 1.4rem; color: #000; }
.titleCard { color: grey; font-size: 1.1rem; margin-bottom: 15px; }
.card-contact { margin-bottom: 10px; display:flex; align-items: center; justify-content: center; gap:10px; }
.card-mail { word-break: break-all; margin-bottom: 20px; font-size: 0.9rem; }
.buttonCard { display: block; padding: 12px 20px; background: var(--primary-color); color: #fff; text-decoration: none; border-radius: 5px; transition: opacity 0.3s; }
.buttonCard:hover { opacity: 0.8; }

/* --- Contatti (Recapiti Aziendali) --- */
.recapiti-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; text-align: center; margin-bottom: 40px; }
.recapiti-item { padding: 25px 15px; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; }
.recapiti-item img { margin-bottom: 15px; width: 40px; height: 40px; }
.recapiti-item a { color: var(--primary-color); text-decoration: none; word-break: break-all; }

/* --- Contatti (Mappa & Form) --- */
.map-container { position: relative; padding-bottom: 45%; height: 0; overflow: hidden; border-radius: 8px; margin-bottom: 50px; border: 1px solid var(--border-color); }
.map-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.contact-form { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; background: var(--light-bg); padding: 40px; border-radius: 8px; }
.form-group { display: flex; flex-direction: column; text-align: left; }
.form-group label { margin-bottom: 8px; font-weight: 500; color: #000; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-family: inherit; font-size: 1rem; }
.form-group textarea { height: 150px; resize: vertical; }
input[type="submit"] { background: var(--primary-color); color: #fff; border: none; padding: 15px; cursor: pointer; border-radius: 5px; font-size: 1.1rem; font-weight: bold; transition: background 0.3s; margin-top: 10px; }
input[type="submit"]:hover { background: #263c77; }

/* --- Home Slideshow --- */
.slideshow-container { max-width: 1000px; position: relative; margin: 0 auto 30px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.mySlides { display: none; position: relative; }
.mySlides img { width: 100%; height: auto; display: block; }
.center-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 5vw; font-weight: bold; text-shadow: 3px 3px rgba(52,82,163,0.8); text-align: center; width: 100%; }
.dot-container { text-align: center; margin-bottom: 40px; }
.dot { height: 14px; width: 14px; margin: 0 6px; background-color: #ddd; border-radius: 50%; display: inline-block; cursor: pointer; transition: background-color 0.3s ease; }
.active { background-color: var(--primary-color); }
.fade { animation: fadeEffect 1.5s; }
@keyframes fadeEffect { from {opacity: .4} to {opacity: 1} }

/* --- Footer --- */
footer { background: #404040; color: #fff; text-align: center; padding: 30px 20px; margin-top: auto; }
footer a { color: #fff; text-decoration: underline; }

/* =========================================================
   MEDIA QUERIES - MOBILE FIRST ADAPTATIONS
========================================================= */
@media screen and (max-width: 768px) {
    body { padding-top: 160px; } /* Header stackato occupa più spazio */
    
    .header-container { flex-direction: column; gap: 15px; }
    .nav-links { justify-content: center; gap: 5px; }
    .button, .buttonActive { padding: 8px 12px; font-size: 0.95rem; }
    
    .chisiamo-content img { float: none; display: block; margin: 0 auto 30px auto; width: 60%; max-width: 250px; }
    
    .servizio-card { flex-direction: column; text-align: center; gap: 20px; }
    
    .center-text { font-size: 8vw; }
    .map-container { padding-bottom: 75%; }
    .contact-form { padding: 20px; }
}
