/* ==========================================================
   Cartongessista Lodi — Design identity #7 "Gesso & Terracotta"
   Palette: gesso #FAF7F2 · grafite #26262B · terracotta #C4552C · sabbia #EAE3D6
   Font: Fraunces (display) + Archivo (body)
   ========================================================== */

:root {
  --gesso: #FAF7F2;
  --grafite: #26262B;
  --grafite-deep: #1C1C20;
  --terracotta: #C4552C;
  --terracotta-dark: #A8451F;
  --sabbia: #EAE3D6;
  --sabbia-deep: #DED3BF;
  --ink: #2E2C28;
  --muted: #6E6759;
  --line: #DCD2C2;
  --white: #FFFFFF;
  --radius: 10px;
  --shadow-card: 0 6px 22px rgba(38, 38, 43, 0.10);
  --shadow-deep: 0 14px 40px rgba(28, 28, 32, 0.35);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Archivo", "Segoe UI", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  font-family: var(--font-body);
  background: var(--gesso);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.02rem;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--grafite); line-height: 1.18; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); margin: 34px 0 14px; }
h3 { font-size: 1.15rem; margin-bottom: 6px; }
p { margin-bottom: 14px; }
ul, ol { margin: 0 0 16px 22px; }
li { margin-bottom: 6px; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 22px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--grafite-deep); color: var(--sabbia); font-size: 0.86rem; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 7px; padding-bottom: 7px; }
.topbar a { color: #F0B79B; font-weight: 700; white-space: nowrap; }
.topbar a:hover { color: var(--gesso); }

/* ---------- Header (sticky, grafite, bordo terracotta) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--grafite);
  border-bottom: 3px solid var(--terracotta);
  transition: box-shadow 0.25s;
}
.site-header.scrolled { box-shadow: var(--shadow-deep); }
.header-in { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gesso); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: 0.01em; }
.brand-name strong { color: #F0B79B; font-weight: 700; }

.main-nav { margin-left: auto; }
.main-nav > ul { display: flex; list-style: none; gap: 4px; margin: 0; }
.main-nav li { position: relative; }
.main-nav a, .drop-toggle {
  display: block; padding: 9px 12px; color: var(--gesso); font-size: 0.95rem; font-weight: 600;
  background: none; border: 0; cursor: pointer; font-family: var(--font-body); border-radius: 6px;
}
.main-nav a:hover, .drop-toggle:hover { background: rgba(196, 85, 44, 0.22); color: #F0B79B; text-decoration: none; }
.drop-toggle svg { vertical-align: -1px; margin-left: 3px; }
.dropdown {
  display: none; position: absolute; top: 100%; left: 0; min-width: 290px;
  background: var(--grafite-deep); border-radius: 0 0 var(--radius) var(--radius);
  list-style: none; margin: 0; padding: 8px 0; box-shadow: var(--shadow-deep);
  max-height: 70vh; overflow: auto; border-top: 2px solid var(--terracotta);
}
.has-drop:hover .dropdown, .has-drop:focus-within .dropdown { display: block; }
.dropdown a { padding: 8px 16px; font-weight: 500; font-size: 0.92rem; border-radius: 0; }

.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer;
}
.hamburger span { width: 24px; height: 2.5px; background: #F0B79B; border-radius: 2px; transition: 0.25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius); font-weight: 700; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; transition: 0.2s; text-align: center;
}
.btn-terra { background: var(--terracotta); color: var(--white); }
.btn-terra:hover { background: var(--terracotta-dark); text-decoration: none; }
.btn-outline { border-color: var(--gesso); color: var(--gesso); background: transparent; }
.btn-outline:hover { background: rgba(250, 247, 242, 0.12); text-decoration: none; }
.btn-block { width: 100%; }
.header-phone { padding: 9px 16px; font-size: 0.95rem; }

/* ---------- Hero home ---------- */
.hero {
  background:
    linear-gradient(105deg, rgba(28, 28, 32, 0.94) 0%, rgba(38, 38, 43, 0.82) 55%, rgba(38, 38, 43, 0.55) 100%),
    url("../img/hero-cartongesso.jpg") center/cover no-repeat, var(--grafite);
  color: var(--gesso); padding: 64px 0 72px;
}
.hero-in {
  display: grid; grid-template-columns: 1.15fr 1fr;
  grid-template-areas: "head form" "body form"; gap: 20px 44px; align-items: start;
}
.hero-head { grid-area: head; }
.hero-form { grid-area: form; min-width: 0; }
.hero-body { grid-area: body; }
.hero h1 { color: var(--gesso); margin-bottom: 10px; }
.hero-sub { font-size: 0.95rem; font-weight: 600; color: #F0B79B; margin-bottom: 10px; }
.hero-lead { font-size: 1.13rem; color: var(--sabbia); max-width: 56ch; }
.hero-points { list-style: none; margin: 20px 0 0; }
.hero-points li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; color: var(--gesso); }
.hero-points svg { flex: none; margin-top: 4px; }

/* ---------- Page hero (con form sopra la piega) ---------- */
.page-hero {
  background:
    linear-gradient(105deg, rgba(28, 28, 32, 0.96) 0%, rgba(38, 38, 43, 0.88) 60%, rgba(38, 38, 43, 0.72) 100%),
    var(--grafite);
  color: var(--gesso); padding: 38px 0 46px;
}
.page-hero-in {
  display: grid; grid-template-columns: 1.25fr 1fr;
  grid-template-areas: "head form" "body form"; gap: 16px 40px; align-items: start;
}
.page-hero .hero-head { grid-area: head; }
.page-hero .hero-form { grid-area: form; min-width: 0; }
.page-hero .hero-body { grid-area: body; }
.page-hero h1 { color: var(--gesso); margin: 8px 0 10px; }
.page-hero .hero-sub { font-size: 0.92rem; font-weight: 600; color: #F0B79B; margin-bottom: 8px; }
.page-lead { color: var(--sabbia); font-size: 1.08rem; max-width: 60ch; }
.breadcrumb { font-size: 0.85rem; margin-bottom: 6px; }
.breadcrumb ol { list-style: none; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li { margin: 0; color: var(--sabbia-deep); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--terracotta); }
.breadcrumb a { color: #F0B79B; }
.kicker {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #F0B79B; margin-bottom: 4px;
}
.page-hero-img { border-radius: var(--radius); margin-top: 18px; box-shadow: var(--shadow-deep); }

/* ---------- Form card ---------- */
.hero-card, .form-card {
  background: var(--white); color: var(--ink); border-radius: var(--radius);
  padding: 26px 26px 20px; box-shadow: var(--shadow-deep);
  border-top: 3px solid var(--terracotta);
}
.hero-card h2, .form-card h2 { margin-top: 0; font-size: 1.3rem; }
.form-note { font-size: 0.92rem; color: var(--muted); margin-bottom: 14px; }
.lead-form label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--grafite); margin: 10px 0 4px; }
.lead-form input, .lead-form select, .lead-form textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: 0.98rem; background: var(--gesso); color: var(--ink);
}
.lead-form input:focus, .lead-form select:focus, .lead-form textarea:focus {
  outline: 2px solid var(--terracotta); outline-offset: 1px; border-color: var(--terracotta);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lead-form .btn { margin-top: 16px; }
.form-privacy { font-size: 0.78rem; color: var(--muted); margin: 10px 0 0; }

/* ---------- Blocco urgenza Bonus 50% ---------- */
.urgency-2026 {
  background: var(--sabbia); border-left: 4px solid var(--terracotta); border-radius: 8px;
  padding: 16px 18px; margin: 20px 0; color: var(--ink);
}
.page-hero .urgency-2026 { background: rgba(234, 227, 214, 0.96); }
.badge-incentivo {
  display: inline-flex; align-items: center; gap: 7px; background: var(--terracotta); color: var(--white);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px; margin-bottom: 8px;
}
.badge-incentivo svg { stroke: var(--white); }
.urgency-2026 p { margin: 0; font-size: 0.95rem; }

/* ---------- Trustbar ---------- */
.trustbar { background: var(--grafite); border-top: 3px solid var(--terracotta); padding: 22px 0; }
.trustbar-in { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.trust-item { display: flex; align-items: center; gap: 10px; color: var(--gesso); font-weight: 600; font-size: 0.92rem; }
.trust-item svg { flex: none; }

/* ---------- Sezioni ---------- */
.section { padding: 60px 0; }
.section-alt { background: var(--sabbia); }
.section-title { margin-top: 4px; }
.section-lead { max-width: 68ch; color: var(--muted); font-size: 1.06rem; }
.prose { max-width: 76ch; }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow-card); }
.content-img { border-radius: var(--radius); margin: 18px 0; box-shadow: var(--shadow-card); }

/* ---------- Card servizi ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-card); border-top: 3px solid var(--terracotta);
  display: flex; flex-direction: column;
}
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body p { font-size: 0.94rem; color: var(--muted); flex: 1; }
.card-body h3 a { color: var(--grafite); }
.card-body h3 a:hover { color: var(--terracotta); text-decoration: none; }
.card-link { font-weight: 700; font-size: 0.92rem; margin-top: 8px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.chip {
  display: inline-block; background: var(--white); border: 1.5px solid var(--line);
  border-radius: 30px; padding: 8px 16px; font-size: 0.9rem; font-weight: 600; color: var(--grafite);
}
.chip:hover { border-color: var(--terracotta); color: var(--terracotta); text-decoration: none; }
.chip-service { background: var(--sabbia); }
.more-services { margin-top: 16px; font-weight: 600; }

/* ---------- Tabelle prezzi ---------- */
.table-wrap { overflow-x: auto; margin: 18px 0 8px; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.price-table {
  width: 100%; border-collapse: collapse; background: var(--white);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card);
  font-size: 0.96rem;
}
table.price-table caption {
  caption-side: top; text-align: left; font-weight: 700; color: var(--grafite);
  padding: 0 2px 10px; font-size: 0.98rem;
}
table.price-table thead th {
  background: var(--grafite); color: var(--gesso); text-align: left;
  padding: 12px 16px; font-size: 0.9rem;
}
table.price-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.price-table tbody tr:nth-child(even) { background: var(--gesso); }
table.price-table tbody tr:hover { background: var(--sabbia); }
table.price-table .price { font-weight: 700; color: var(--terracotta); white-space: nowrap; }
.table-note { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.price-list li { margin-bottom: 8px; }
.steps-list li { margin-bottom: 10px; }

/* ---------- Processo ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 18px; }
.step {
  background: var(--white); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-card); border-top: 3px solid var(--terracotta);
}
.step-num {
  width: 38px; height: 38px; border-radius: 50%; background: var(--terracotta); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 10px;
}
.step p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---------- Testimonianza ---------- */
.testimonial {
  background: var(--white); border-left: 4px solid var(--terracotta); border-radius: 8px;
  padding: 20px 22px; margin: 26px 0; box-shadow: var(--shadow-card);
}
.testimonial p { font-style: italic; font-family: var(--font-display); font-size: 1.05rem; color: var(--grafite); }
.testimonial cite { display: block; font-style: normal; font-weight: 700; font-size: 0.88rem; color: var(--muted); margin-top: 8px; }

/* ---------- FAQ ---------- */
.faq-list { margin-top: 14px; }
.faq-item {
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-card);
}
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 15px 18px; background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-weight: 700; font-size: 0.98rem; color: var(--grafite);
}
.faq-q svg { flex: none; transition: transform 0.25s; }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-a-inner { padding: 0 18px 16px; font-size: 0.95rem; color: var(--muted); }
.faq-a-inner p { margin: 0; }

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(120deg, var(--grafite-deep), var(--grafite));
  color: var(--gesso); padding: 54px 0; border-top: 3px solid var(--terracotta);
}
.cta-in { display: flex; justify-content: space-between; align-items: center; gap: 36px; }
.cta h2 { color: var(--gesso); margin-top: 0; }
.cta p { color: var(--sabbia); max-width: 52ch; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; flex: none; }
.cta-phone-big {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700; color: #F0B79B; margin-top: 8px;
}
.cta-phone-big:hover { color: var(--gesso); text-decoration: none; }
.cta-checks { list-style: none; margin: 14px 0; }
.cta-checks li { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: var(--gesso); font-size: 0.95rem; }
.cta-form { flex: 1; max-width: 480px; width: 100%; }

/* ---------- Satellite/CTA box interni ---------- */
.sat-cta-box {
  background: var(--sabbia); border-radius: var(--radius); padding: 26px;
  margin: 30px 0; border-top: 3px solid var(--terracotta);
}
.sat-cta-box h2 { margin-top: 0; }
.sat-backlink { margin-top: 24px; font-size: 0.95rem; }

/* ---------- Why cards ---------- */
.why-card {
  background: var(--white); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-card); border-top: 3px solid var(--terracotta);
}
.why-icon { margin-bottom: 10px; }
.why-card p { font-size: 0.92rem; color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--grafite-deep); color: var(--sabbia); padding: 50px 0 0; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 36px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--gesso); margin-bottom: 12px; }
.site-footer h3 { color: #F0B79B; font-size: 1rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; }
.site-footer li { margin-bottom: 6px; font-size: 0.92rem; }
.site-footer a { color: var(--sabbia); }
.site-footer a:hover { color: #F0B79B; }
.footer-contact { margin-top: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(234, 227, 214, 0.15); padding: 16px 22px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 0.84rem; color: var(--muted); max-width: 1140px; margin: 0 auto;
}
.footer-minimal { background: var(--grafite-deep); color: var(--sabbia); padding: 34px 0; text-align: center; }
.footer-minimal a { color: #F0B79B; }

/* ---------- Utility ---------- */
.thanks-box { background: var(--white); border-radius: var(--radius); padding: 24px; margin: 22px 0; box-shadow: var(--shadow-card); border-top: 3px solid var(--terracotta); color: var(--ink); }
.thanks-box h2 { margin-top: 0; }
.thanks-list { list-style: none; margin: 0; }
.thanks-list li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.thanks-list svg { flex: none; margin-top: 3px; }
.contact-phone { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--terracotta); }
.benefit-box { background: var(--sabbia); border-radius: var(--radius); padding: 20px; margin-top: 22px; }
.benefit-box ul { list-style: none; margin: 10px 0 0; }
.benefit-box li { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 8px; font-size: 0.93rem; }
.areas { font-weight: 600; color: var(--grafite); }

/* ==========================================================
   RESPONSIVE — fix mobile (SPEC §8)
   ========================================================== */
@media (max-width: 1020px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trustbar-in { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  /* Mobile: form subito dopo titolo+subhead+badge (ordine: head -> form -> body) */
  .hero-in, .page-hero-in { display: flex; flex-direction: column; gap: 16px; }
  .hero-head { order: 1; }
  .hero-form { order: 2; }
  .hero-body { order: 3; }
  /* Compattezza hero su mobile: il form deve stare sopra la piega */
  .page-hero { padding: 24px 0 34px; }
  .hero { padding: 34px 0 44px; }
  .page-hero h1, .hero h1 { font-size: clamp(1.5rem, 6.3vw, 2rem); margin-bottom: 6px; }
  .breadcrumb { font-size: 0.78rem; margin-bottom: 2px; }
  .hero-sub { margin-bottom: 4px !important; }
  .badge-incentivo { margin-bottom: 4px; }
  .split { grid-template-columns: 1fr; }
  .cta-in { flex-direction: column; align-items: flex-start; }
  .cta-form { max-width: 100%; width: 100%; }
  .cta-actions { flex-direction: row; flex-wrap: wrap; }

  .header-in { height: 60px; }
  /* Menu mobile: absolute dentro header sticky — MAI position:fixed */
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--grafite-deep);
    border-bottom: 3px solid var(--terracotta); box-shadow: var(--shadow-deep);
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
    margin-left: 0;
  }
  .main-nav.open { max-height: calc(100vh - 60px); overflow: auto; }
  .main-nav > ul { flex-direction: column; padding: 12px 20px 20px; }
  .main-nav a, .drop-toggle { width: 100%; padding: 12px 10px; font-size: 1rem; }
  .dropdown {
    position: static; box-shadow: none; border: 0; border-left: 3px solid var(--terracotta);
    border-radius: 0; margin-left: 12px; max-height: none; background: rgba(250, 247, 242, 0.07);
  }
  .dropdown a { color: var(--sabbia); }
  .dropdown a:hover { background: rgba(196, 85, 44, 0.22); color: #F0B79B; }
  .has-drop.open .dropdown { display: block; }
  .hamburger { display: flex; }
  .header-phone .phone-label { display: none; }
  .header-phone { padding: 9px 11px; }
}

@media (max-width: 560px) {
  .grid-3 { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .trustbar-in { grid-template-columns: 1fr; gap: 10px; }
  .section { padding: 46px 0; }
  .cta-phone-big { font-size: 1.2rem; }
  .topbar-in { justify-content: center; text-align: center; flex-wrap: wrap; gap: 6px; }
}

/* Fix responsive tabelle prezzi (mobile) — specificità con table. */
@media (max-width: 640px) {
  table.price-table { width: 100%; min-width: 0; table-layout: fixed; }
  table.price-table thead th,
  table.price-table tbody td { padding: 10px 8px; font-size: 0.88rem; overflow-wrap: break-word; word-break: break-word; }
  table.price-table .price { white-space: normal; }
  table.price-table caption { font-size: 0.9rem; }
}
