/* Reset di base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Font e colori principali */
html, body {
  height: 100%;
  --top-wrapper-height: 130px; /* altezza header+nav di default */
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: #2c2f2c;
  line-height: 1.6;
  display: flex;
  flex-direction: column;

  /* Sfondo pagina */
  background: url("../images/Sala1.jpeg") no-repeat center top;
  background-size: cover;
  background-attachment: fixed; /* effetto parallax */
}

/* Wrapper per header+nav per calcolare altezza */
#top-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to right, #2e4d32, #4f6f4d);
  z-index: 1000;
}

/* Header fisso */
header {
  padding: 25px;
  text-align: center;
  color: #F8F8F8;
  background: #2F4F4F;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}



header h1 {
  font-size: 2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1, h2 {
  color: #F8F8F8;
}

/* Barra di navigazione */
nav {
  width: 100%;
  background: #4f6f4d;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  padding: 10px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: max-height 0.3s ease;
  overflow: hidden;
  max-height: 50px; /* altezza navbar desktop */
}

nav a {
  color: #F8F8F8;
  text-decoration: none;
  font-weight: bold;
  padding: 12px 18px;
  transition: background 0.3s ease;
  white-space: nowrap;
}

nav a:hover {
  background: #2e4d32;
}

/* Pulsante menu hamburger (hidden desktop) */
.menu-toggle {
  display: none;
  position: fixed;
  top: 25px;
  right: 20px;
  z-index: 1100;
  width: 30px;
  height: 25px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}

.menu-toggle span {
  display: block;
  height: 3px;
  background: white;
  border-radius: 2px;
}

/* Main con padding-top per header+nav */
main {
  flex: 1;
  padding: calc(var(--top-wrapper-height) + 20px) 20px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Rimuove padding extra SOLO nella pagina showroom */
body.showroom main {
  padding: 0;
}


.azienda-main {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  background: #F4F1EC;
  border-radius: 8px;
}


/* Sezione marchi */
.marchi {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.marchi a {
  margin: 15px;
  text-align: center;
  transition: transform 0.3s ease;
}

.marchi a:hover {
  transform: scale(1.05);
}

.marchi img {
  width: 200px;
  height: auto;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #F4F1EC;
;
}

/* Footer fisso */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #2F4F4F;
  color: #fff;
  text-align: center;
  padding: 20px;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  z-index: 1000;
}


footer p img {
  vertical-align: middle;
  margin: 0 5px;
}

/* Mobile styles */
@media (max-width: 600px) {
  nav {
    flex-direction: column;
    max-height: 0;
    padding: 0;
  }

  nav.open {
    max-height: 500px; /* abbastanza per mostrare tutti i link */
    padding: 10px 0;
  }

  nav a {
    padding: 10px 0;
    width: 100%;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  nav a:first-child {
    border-top: none;
  }

  .menu-toggle {
    display: flex;
  }
}

/* Griglia prodotti */
.grid-prodotti {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;

  /* Rimuovo il rettangolo bianco */
  background: none;
  border-radius: 0;
}


.card-prodotto {
  background: #F4F1EC;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-prodotto:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-prodotto img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 15px;
}

.card-prodotto h3 {
  font-size: 1.2rem;
  color: #4f6f4d;
  margin-bottom: 10px;
}

.card-prodotto p {
  font-size: 0.95rem;
  color: #2c2f2c;
}

.card-prodotto {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%; /* tutte le card stessa altezza */
}

.card-prodotto h3,
.card-prodotto p {
  flex-grow: 0;
}

/* Wrapper con altezza fissa */
.img-wrapper {
  width: 100%;
  height: 200px; 
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 15px;
  background: transparent; /* o semplicemente rimosso */
}

.img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* immagine intera senza tagli */
  object-position: center;
  background: transparent; /* nessuno sfondo */
}


/* --- Stile generale per sezioni admin --- */
section {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

section.full-bg {
  background: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: none;
}


/* --- Tabelle (Elenco Brand/Prodotti) --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #fff;
}

table th, table td {
  padding: 12px 15px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

table th {
  background: #2e4d32;
  color: #fff;
  text-transform: uppercase;
  font-size: 0.9rem;
}

table tr:hover {
  background: #f4f7f4;
}

/* --- Form (Aggiungi/Modifica Brand/Prodotto) --- */
form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

form label {
  font-weight: bold;
  margin: 10px 0 5px;
  text-align: center;
}

form input,
form select,
form textarea {
  width: 100%;
  max-width: 500px;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
  font-size: 1rem;
}

form textarea {
  resize: vertical;
  min-height: 100px;
}

form button {
  background: #2e4d32;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

form button:hover {
  background: #4f6f4d;
}

/* --- Messaggi di conferma/errore --- */
section p {
  text-align: center;
  font-weight: bold;
  margin-bottom: 20px;
  color: #2e4d32;
}

/* Stile uniforme per tutti i campi form */
.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  max-width: 500px;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  text-align: center;
  background: #fff;
  appearance: none;       /* rimuove lo stile nativo del browser */
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Uniformare il select */
.admin-form select {
  background: #fff url("data:image/svg+xml;utf8,<svg fill='%232e4d32' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right 10px center;
  background-size: 16px;
  padding-right: 30px; /* spazio per la freccia */
  cursor: pointer;
}

/* Hover e focus coerenti */
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: #2e4d32;
  outline: none;
  box-shadow: 0 0 5px rgba(46,77,50,0.3);
}

.form-contatto {
  max-width: 600px;
  margin: 40px auto;
  background: #F4F1EC;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.titolo-contatto {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #2F4F4F;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.titolo-contatto .icona {
  font-size: 1.8rem;
}

.contatto-form label {
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
  color: #2F4F4F;
}

.contatto-form input,
.contatto-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 1rem;
  background: #fff;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.captcha-numero {
  font-size: 1.6rem;
  font-weight: bold;
  background: #fff;
  padding: 8px 15px;
  border-radius: 6px;
  border: 1px solid #bbb;
}

.btn-invia {
  width: 100%;
  padding: 12px;
  background: #4f6f4d;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-invia:hover {
  background: #2F4F4F;
}

/* Contenitore principale showroom */
.showroom-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;

  /* Altezza esatta tra topbar e footbar */
  margin-top: var(--top-wrapper-height);
  height: calc(100vh - var(--top-wrapper-height) - 80px);

  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible; /* evita scroll */
}

/* Riquadro bianco stile prodotti */
.showroom-frame {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);

  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Immagine adattata perfettamente */
.showroom-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* Frecce laterali */
.showroom-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  font-weight: bold;
  color: black;
  cursor: pointer;
  padding: 10px;
  user-select: none;
  transition: 0.3s;
  z-index: 10;
}

.showroom-arrow:hover {
  color: #aaffaa;
}

.showroom-arrow.left {
  left: -50px;
}

.showroom-arrow.right {
  right: -50px;
}

/* Mobile */
@media (max-width: 600px) {
  .showroom-arrow {
    font-size: 2.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.35);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .showroom-arrow.left {
    left: 10px;
  }

  .showroom-arrow.right {
    right: 10px;
  }
}

/* Rimuove TUTTE le limitazioni del main nella pagina showroom */
body.showroom main {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* Rimuove qualsiasi margine/padding della sezione showroom */
body.showroom section.full-bg {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

