/* --- Stile base desktop --- */
body { margin:0; font-family: Arial, sans-serif; }

/* Menu */
header { background:#333; color:#fff; padding:10px; }
header .menu ul { display:flex; list-style:none; margin:0; padding:0; }
header .menu ul li { margin-right:20px; }
header .menu ul li a { color:#fff; text-decoration:none; font-weight:bold; }
header .menu ul li a:hover { color:#ffc107; }

/* Container e colonne */
.container { display:flex; flex-wrap: wrap; padding:10px; }
.left-column { flex: 2 1 600px; padding:10px; box-sizing: border-box; }
.right-column { flex: 1 1 300px; padding:10px; border-left:1px solid #ccc; position: relative; box-sizing: border-box; }

/* Colonne dentro container-messaggio (solo quando with-columns) */
.container-messaggio.with-columns .left-column { 
    flex: 2 1 600px; 
    padding: 10px; 
    box-sizing: border-box;
    min-width: 0; /* Permette al flex di ridursi correttamente */
}
.container-messaggio.with-columns .right-column { 
    flex: 1 1 300px; 
    padding: 10px; 
    border-left: 1px solid #ccc; 
    position: relative; 
    box-sizing: border-box;
    min-width: 0; /* Permette al flex di ridursi correttamente */
}

/* Stili per tabelle dentro container-messaggio */
.container-messaggio table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    box-sizing: border-box;
    table-layout: auto;
}
.container-messaggio table th,
.container-messaggio table td {
    padding: 12px;
    border: 1px solid #ddd;
    box-sizing: border-box;
    word-wrap: break-word;
}
.container-messaggio table thead tr {
    background: #f0f0f0;
}
.container-messaggio table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

/* Tabelle responsive su mobile */
@media(max-width:800px){
    .container-messaggio table {
        font-size: 14px;
    }
    .container-messaggio table th,
    .container-messaggio table td {
        padding: 8px;
    }
}

/* Mappa */
#map { border: 1px solid #ccc; height: 400px; width:100%; margin-bottom:10px; }

/* Tasto Elabora Preventivo */
#btnAggiornaPreventivo {
    display: block;
    margin: 20px auto 0 auto;
    text-align: center;
}

/* Hero header */
.hero-header {
  position: relative;
  width: 100%;
  height: 300px;
  background: url('../img/banner-trasporti.jpg') center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.hero-header .overlay {
  position: absolute;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.4);
}
.hero-header h1 {
  position: relative;
  z-index: 1;
  font-size: 2.5em;
  text-align: center;
  margin: 0;
}

/* Form */
.form-container { 
    width:100% !important; 
    max-width:100%; 
    box-sizing:border-box; 
    margin-bottom:20px; 
}
.form-row { display:flex; margin-bottom:10px; }
.form-label { width:160px; font-weight:bold; }
.form-input {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* forza a sinistra */
}


.form-input input, .form-input select { width:100%; max-width:100%; box-sizing:border-box; }
.form-input input[type="checkbox"] {
    width: auto !important;         /* non occupa tutta la larghezza */
    margin: 0;           /* nessun margine extra */
    display: inline-block;
}
button { margin-top:10px; }

/* Preventivi */
.totale-preventivo {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    position: sticky;
    top: 10px;
    background: #fff;
    padding: 10px;
    z-index: 1000;
    border: 2px solid #333;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.lista-preventivo { border:1px solid #ccc; padding:5px; margin-bottom:10px; }
.lista-preventivo button { font-size:12px; }

/* Responsabile */
.responsabile {
  display: flex;
  align-items: center;
  margin-top: 30px;
  border-top: 1px solid #ccc;
  padding-top: 20px;
}
.responsabile img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-right: 20px;
}
.responsabile p {
  margin: 0;
  font-size: 1.1em;
}

/* --- Mobile friendly avanzato --- */
@media(max-width:800px){
  /* Container verticale e padding */
  .container {
    flex-direction: column !important;
    padding: 10px;
  }

  /* Colonne full-width */
  .left-column, .right-column {
    flex: 1 1 100% !important;
    width: 100% !important;
    padding: 10px;
  }

  /* Mappa più alta */
  #map { 
    height: 450px; 
    margin-bottom: 15px;
  }

  /* Label e input più leggibili */
  .form-row { flex-direction: column; margin-bottom: 12px; }
  .form-label { width: 100%; font-size: 16px; margin-bottom: 4px; }
  .form-input input, .form-input select { 
    font-size: 16px; 
    padding: 8px; 
    width: 100%;
    box-sizing: border-box;
  }

  /* Pulsante più grande */
  button { 
    width: 100%; 
    font-size: 18px; 
    padding: 12px; 
    margin-top: 10px;
  }

  /* Preventivo e lista più leggibili */
  .totale-preventivo { 
    font-size: 20px; 
    padding: 12px; 
    top: 10px; 
  }
  .lista-preventivo { 
    font-size: 16px; 
    padding: 8px; 
    margin-bottom: 10px;
  }

  /* Margini tra le colonne */
  .right-column { margin-top: 15px; border-left: none; border-top: 1px solid #ccc; }

  /* Responsabile mobile */
  .responsabile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .responsabile img {
    margin-right: 0;
    margin-bottom: 10px;
  }
}

/* --- Extra per display molto stretti (<400px) --- */
@media(max-width:400px){
  #map { height: 500px; }
  .totale-preventivo { font-size: 22px; padding: 14px; }
  .form-input input, .form-input select { font-size: 18px; padding: 10px; }
  button { font-size: 20px; padding: 14px; }
  .hero-header h1 { font-size: 2em; }
}



/* Mobile */
@media(max-width:800px){
  .nav-links { 
    display: none; 
    flex-direction: column; 
    width: 100%; 
    background: #333; 
    position: relative; /* cambiato da absolute a relative */
    top: 0; 
    left: 0; 
    padding: 10px 0;
  }
  .nav-links li { 
    margin: 10px 0; 
    text-align: center; 
  }
  .nav-links.active { display: flex; }

  .hamburger { display: block; margin-left: auto; }

  .nav-bar {
    flex-wrap: wrap;
  }
}
/* Footer */
.footer {
  background: #333;
  color: #fff;
  padding: 30px 15px;
  margin-top: 40px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.footer-section {
  flex: 1 1 250px;
}

.footer-section h3 {
  margin-top: 0;
  color: #ffc107;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li a {
  color: #fff;
  text-decoration: none;
}

.footer-section ul li a:hover {
  color: #ffc107;
}

.footer-bottom {
  text-align: center;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #555;
  font-size: 0.9em;
}
/* Blocco messaggio con bordo arrotondato */
.container-messaggio {
    max-width: 1200px;
    margin: 30px auto;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
    font-size: 18px;
    line-height: 1.8;
    color: #000;
    box-sizing: border-box;
}

/* Layout a 2 colonne solo quando esplicitamente richiesto */
.container-messaggio.with-columns {
    display: flex;
    flex-wrap: wrap;
}

/* Titolo del blocco */
.container-messaggio h2 {
    text-align: center;
    color: #000080;
    margin-bottom: 20px;
}

/* Paragrafi interni */
.container-messaggio p {
    margin: 12px 0;
}

/* Responsabile */
.responsabile {
    display: flex;
    align-items: center;
    margin-top: 25px;
    border-top: 1px solid #ccc;
    padding-top: 15px;
}

.responsabile img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 20px;
}

.responsabile p {
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
}

/* Mobile friendly */
@media(max-width:800px){
    .container-messaggio {
        padding: 20px;
        font-size: 20px;
    }

    .responsabile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .responsabile img {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
/* Stili form dentro container-messaggio (complementari a quelli sopra) */
.container-messaggio form label {
    font-weight:bold;
    display:block;
    margin-bottom:5px;
}
.container-messaggio form input, .container-messaggio form textarea {
    width:100%;
    padding:10px;
    margin-bottom:15px;
    font-size:18px;
    border:1px solid #999;
    border-radius:5px;
}
.container-messaggio form button {
    width:100%;
    padding:15px;
    font-size:20px;
    background:#007bff;
    color:#fff;
    border:none;
    border-radius:5px;
    cursor:pointer;
}
.container-messaggio form button:hover {
    background:#0056b3;
}
.mappa {
    max-width:700px;
    margin:20px auto;
    border-radius:10px;
    overflow:hidden;
    height:400px;
}
.info-azienda {
    max-width:700px;
    margin:20px auto;
    background:#f0f8ff;
    padding:15px;
    border-radius:10px;
    border:1px solid #ccc;
}

