/* =============================================
   CARMASCIANO D'APOLITO — CSS Principale
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --verde:    #3a5a2e;
  --verde-sc: #2b4322;
  --oro:      #c8a24b;
  --crema:    #f9f5ee;
  --bianco:   #ffffff;
  --grigio:   #6b6b6b;
  --testo:    #2c2c2c;
  --bordo:    #e0d8c8;
  --font-titolo: 'Playfair Display', Georgia, serif;
  --font-corpo:  'Lato', Arial, sans-serif;
  --max-w: 1100px;
  --raggio: 4px;
  --ombra: 0 4px 20px rgba(0,0,0,.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-corpo);
  color: var(--testo);
  background: var(--crema);
  font-size: 16px;
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--verde); text-decoration: none; }
a:hover { color: var(--oro); }

/* ---- Tipografia ---- */
h1,h2,h3,h4 { font-family: var(--font-titolo); color: var(--verde-sc); line-height: 1.3; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: 1.3rem; margin-bottom: .5rem; }
p  { margin-bottom: 1rem; }

/* ---- Utility ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.sezione { padding: 5rem 0; }
.sezione-chiara { background: var(--bianco); }
.sezione-scura  { background: var(--verde-sc); color: var(--crema); }
.sezione-scura h2, .sezione-scura h3 { color: var(--oro); }
.sezione-scura p { color: #d8cdb9; }
.separatore { width: 60px; height: 3px; background: var(--oro); margin: 1rem auto 2rem; }
.separatore-sx { margin-left: 0; }

/* ---- Pulsanti ---- */
.btn {
  display: inline-block;
  padding: .75rem 2rem;
  border-radius: var(--raggio);
  font-family: var(--font-corpo);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: all .25s ease;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primario { background: var(--oro); color: var(--verde-sc); border-color: var(--oro); }
.btn-primario:hover { background: transparent; color: var(--oro); }
.btn-outline { background: transparent; color: var(--bianco); border-color: var(--bianco); }
.btn-outline:hover { background: var(--bianco); color: var(--verde-sc); }

/* =============================================
   HEADER / NAVBAR
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bianco);
  border-bottom: 1px solid var(--bordo);
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo img { height: 48px; width: auto; }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-menu a {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--testo);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-menu a:hover,
.nav-menu a.attivo { color: var(--verde); border-bottom-color: var(--oro); }

.nav-cta { background: var(--verde); color: var(--bianco) !important; border-radius: var(--raggio); padding: .45rem 1.2rem !important; border-bottom: none !important; }
.nav-cta:hover { background: var(--verde-sc) !important; color: var(--bianco) !important; }

/* Hamburger */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: .4rem; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--testo); margin: 5px 0; transition: all .3s; }
.menu-toggle.aperto span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.menu-toggle.aperto span:nth-child(2) { opacity: 0; }
.menu-toggle.aperto span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--verde-sc);
}

.hero-bg {
  position: absolute; inset: 0;
  background-image: url('../assets/img/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: .45;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding: 4rem 1.5rem;
}

.hero-badge {
  display: inline-block;
  background: var(--oro);
  color: var(--verde-sc);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .3rem .9rem;
  border-radius: 2px;
  margin-bottom: 1.2rem;
}

.hero h1 { color: var(--bianco); margin-bottom: 1.2rem; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.hero p  { color: #ddd5c5; font-size: 1.15rem; margin-bottom: 2rem; max-width: 520px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-logo {
  position: absolute;
  right: 8%;
  bottom: 10%;
  z-index: 2;
  width: clamp(120px, 18vw, 220px);
  opacity: .15;
}

/* =============================================
   GRIGLIA 2 COLONNE (home sezioni)
   ============================================= */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.grid-2 img {
  border-radius: var(--raggio);
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  width: 100%;
  object-fit: cover;
}

/* =============================================
   VALORI (3 colonne)
   ============================================= */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.card-valore {
  background: var(--bianco);
  border-radius: var(--raggio);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--ombra);
  border-top: 4px solid var(--oro);
  transition: transform .25s;
}
.card-valore:hover { transform: translateY(-5px); }
.card-valore .icona { font-size: 2.5rem; margin-bottom: 1rem; }
.card-valore h3 { color: var(--verde); }

/* =============================================
   TIMELINE (azienda)
   ============================================= */
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--bordo);
  transform: translateX(-50%);
}
.timeline-item {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 1rem;
  margin-bottom: 3rem;
  align-items: start;
}
.timeline-anno {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--verde);
  color: var(--bianco);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-titolo);
  font-weight: 700;
  font-size: 1.1rem;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--crema), 0 0 0 6px var(--verde);
  flex-shrink: 0;
}
.timeline-sx { text-align: right; padding-top: .5rem; }
.timeline-dx { padding-top: .5rem; }
.timeline-sx img, .timeline-dx img { border-radius: var(--raggio); margin-top: .8rem; max-width: 100%; }
.timeline-item:nth-child(even) .timeline-sx { order: 3; text-align: left; }
.timeline-item:nth-child(even) .timeline-anno { order: 2; }
.timeline-item:nth-child(even) .timeline-dx { order: 1; text-align: right; }
.timeline-item:nth-child(even) .timeline-dx img { margin-left: auto; }

/* =============================================
   PECORINO (stagionature + hero)
   ============================================= */
.hero-pecorino {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 4rem;
}
.hero-pecorino img { border-radius: var(--raggio); box-shadow: var(--ombra); }

.grid-stagionature { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }

.card-stagionatura {
  background: var(--bianco);
  border-radius: var(--raggio);
  padding: 2rem;
  box-shadow: var(--ombra);
  border-left: 5px solid var(--oro);
  transition: box-shadow .25s;
}
.card-stagionatura:hover { box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.card-stagionatura h3 { color: var(--verde); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.spec-riga { display: flex; gap: .6rem; margin-bottom: .4rem; font-size: .9rem; }
.spec-label { font-weight: 700; color: var(--verde-sc); min-width: 80px; flex-shrink: 0; }
.spec-val { color: var(--grigio); }

/* Box mefite */
.box-mefite {
  background: var(--verde-sc);
  border-radius: var(--raggio);
  padding: 2.5rem;
  color: #d8cdb9;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.box-mefite h3 { color: var(--oro); margin-bottom: .8rem; }

/* Stagionatura lista */
.lista-stagionature { list-style: none; margin: 1rem 0 2rem; }
.lista-stagionature li { padding: .5rem 0; border-bottom: 1px solid var(--bordo); }
.lista-stagionature li:last-child { border-bottom: none; }

/* =============================================
   CONTATTI
   ============================================= */
.grid-contatti { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.info-contatto { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.info-contatto .icona-c { font-size: 1.5rem; color: var(--oro); flex-shrink: 0; padding-top: .1rem; }
.info-contatto h4 { color: var(--verde-sc); margin-bottom: .2rem; }

/* Form */
.form-contatto .campo { margin-bottom: 1.2rem; }
.form-contatto label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .35rem; color: var(--verde-sc); text-transform: uppercase; letter-spacing: .05em; }
.form-contatto input,
.form-contatto textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--bordo);
  border-radius: var(--raggio);
  font-family: var(--font-corpo);
  font-size: 1rem;
  background: var(--crema);
  transition: border-color .2s;
}
.form-contatto input:focus,
.form-contatto textarea:focus { outline: none; border-color: var(--verde); }
.form-contatto textarea { resize: vertical; min-height: 130px; }
.form-contatto .btn { width: 100%; }

.msg-successo { display: none; background: #e8f5e9; border: 1px solid #81c784; color: #2e7d32; padding: 1rem; border-radius: var(--raggio); margin-bottom: 1rem; }

/* =============================================
   FOOTER (desktop)
   ============================================= */
.site-footer {
  background: var(--verde-sc);
  color: #b8c9b0;
  padding: 3rem 0 1.5rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.footer-logo { height: 40px; margin-bottom: 1rem; filter: brightness(10); opacity: .8; }
.site-footer h4 { color: var(--oro); font-family: var(--font-corpo); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer p { font-size: .9rem; line-height: 1.6; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: .5rem; font-size: .9rem; }
.footer-links a { color: #b8c9b0; font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: var(--oro); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem; text-align: center; font-size: .82rem; color: #7a9e72; }
.footer-piva { font-size: .8rem; opacity: .6; }

/* =============================================
   BANNER pagina interna
   ============================================= */
.page-banner {
  background: var(--verde-sc);
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-banner::after {
  content: '';
  position: absolute; inset: 0;
  background: url('../assets/img/storia-azienda.jpg') center/cover;
  opacity: .15;
}
.page-banner .container { position: relative; z-index: 1; }
.page-banner h1 { color: var(--bianco); }
.page-banner .breadcrumb { color: var(--oro); font-size: .85rem; margin-top: .5rem; }
.page-banner .breadcrumb a { color: var(--oro); }

/* =============================================
   BOTTOM BAR MOBILE (come chirurgiavaricocele.it)
   ============================================= */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bianco);
  border-top: 1px solid var(--bordo);
  display: none; /* nascosta su desktop */
  justify-content: space-around;
  align-items: center;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}

.bottom-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: .62rem;
  font-weight: 700;
  color: var(--grigio);
  text-transform: uppercase;
  letter-spacing: .4px;
  text-decoration: none;
  position: relative;
  padding: 4px 6px 2px;
  transition: color .2s;
}
.bottom-bar a svg { transition: color .2s; }

/* Indicatore attivo = linea verde sopra */
.bottom-bar a.bb-active { color: var(--verde); }
.bottom-bar a.bb-active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--verde);
  border-radius: 0 0 3px 3px;
}

/* (shop modal via JS) */

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 2rem; }
  .grid-stagionature { grid-template-columns: 1fr; }
  .hero-pecorino { grid-template-columns: 1fr; gap: 2rem; }
  .hero-pecorino img { max-height: 300px; object-fit: cover; width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > *:first-child { grid-column: 1 / -1; }
  .grid-contatti { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 640px) {
  body { padding-bottom: 70px; } /* spazio per bottom-bar */

  .sezione { padding: 3rem 0; }

  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 2rem; }
  .grid-2 img { max-height: 260px; object-fit: cover; }

  /* Hamburger menu */
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0; right: 0;
    background: var(--bianco);
    border-top: 1px solid var(--bordo);
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
  }
  .nav-menu.aperto { display: flex; }
  .menu-toggle { display: block; }

  /* Hero */
  .hero { min-height: 75vh; }
  .hero-content { padding: 2.5rem 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { text-align: center; }

  /* Page banner */
  .page-banner { padding: 3rem 0; }

  /* Timeline mobile: linea a sinistra, singola colonna */
  .timeline::before { left: 20px; }
  .timeline-item {
    grid-template-columns: 40px 1fr;
    gap: .8rem;
  }
  .timeline-anno { width: 40px; height: 40px; font-size: .8rem; }
  .timeline-sx,
  .timeline-dx {
    grid-column: 2;
    text-align: left !important;
    order: unset !important;
  }
  .timeline-anno { order: unset !important; }
  .timeline-item:nth-child(even) .timeline-sx { order: unset; text-align: left; }
  .timeline-item:nth-child(even) .timeline-anno { order: unset; }
  .timeline-item:nth-child(even) .timeline-dx { order: unset; text-align: left; }
  .timeline-item:nth-child(even) .timeline-dx img { margin-left: 0; }

  /* Card stagionatura - spec su colonna */
  .spec-riga { flex-direction: column; gap: .15rem; }
  .spec-label { min-width: unset; }

  /* Footer desktop compatto su mobile */
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .site-footer { padding-bottom: 2rem; }

  /* BOTTOM BAR visibile */
  .bottom-bar { display: flex; }

  /* Box mefite */
  .box-mefite { padding: 1.5rem; }

  /* Mappa contatti */
  .grid-contatti { gap: 2rem; }
}

/* iPhone SE e molto piccoli */
@media (max-width: 380px) {
  .container { padding: 0 1rem; }
  .hero-content { padding: 2rem .8rem; }
  .card-valore { padding: 1.8rem 1.2rem; }
  .card-stagionatura { padding: 1.5rem; }
  .bottom-bar a span { font-size: .55rem; }
}
