/* === INGENMEC — STILE PRINCIPALE === */

:root {
  --ink: #0f1e30;
  --muted: #4d6080;
  --line: #ccddf0;
  --paper: #eaf2fc;
  --soft: #dbeaf8;
  --accent: #0054b0;
  --accent2: #0082e0;
  --deep: #060f1d;
  --steel: #aeb7c2;
  --radius: 6px;
  /* Celeste */
  --sky: #e0f0ff;
  --sky-mid: #b8d8f8;
  /* Arancione */
  --orange: #d95500;
  --orange2: #ff8830;
  --orange-soft: #fff0e0;
  --orange-mid: #fbd5a8;
  /* Ombre */
  --shadow-sm: 0 2px 12px rgba(0,30,80,.09);
  --shadow-md: 0 8px 32px rgba(0,30,80,.13);
  --shadow-lg: 0 20px 60px rgba(0,30,80,.18);
}

* { box-sizing: border-box }
html { scroll-behavior: smooth; overflow-x: clip }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
  line-height: 1.55;
}
/* Sfondo globale con texture colore */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(0,130,224,.09) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(217,85,0,.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1 }
img { max-width: 100%; display: block }
a { text-decoration: none; color: inherit }

/* === LAYOUT === */
.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto }

/* === NAVBAR === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, #0a4a9e 0%, #0c6acc 100%);
  border-bottom: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 2px 24px rgba(0,40,120,.30);
}
.menu a { color: rgba(255,255,255,.7) !important; transition: color .15s }
.menu a:hover, .menu a.active { color: var(--orange2) !important }
.topbar::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--orange));
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
}
.nav {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  min-width: 200px;
  background: white;
  padding: 8px 18px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.logo img { height: 44px; width: auto; max-width: 220px; object-fit: contain }
.menu {
  display: flex;
  gap: 32px;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.menu a { color: var(--muted); transition: color .15s }
.menu a:hover, .menu a.active { color: var(--accent) }
.cta {
  border: 1.5px solid var(--orange);
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--orange) !important;
  background: rgba(232,101,10,.05);
  transition: background .15s;
}
.cta:hover { background: rgba(232,101,10,.12) }

/* === HAMBURGER === */
.ham {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ham span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: .2s;
}
.ham.open span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
.ham.open span:nth-child(2) { opacity: 0 }
.ham.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }

/* === HERO HOME === */
.hero {
  min-height: 640px;
  display: grid;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(8,20,48,.92) 0%, rgba(0,60,140,.80) 48%, rgba(200,70,0,.55) 100%),
    url('assets/macchine/01-manipolatore-manuale-automatico-in-servizio-a-segatronchi/Immagine1.jpg') center / cover no-repeat;
  border-bottom: 1px solid rgba(0,130,224,.3);
}
.hero .kicker { color: var(--orange2) }
.hero h1 { color: #ffffff }
.hero p { color: rgba(255,255,255,.8) }
.kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .26em;
  font-weight: 900;
  color: var(--orange);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(46px, 7.5vw, 96px);
  line-height: .94;
  letter-spacing: -.07em;
  max-width: 960px;
  margin: 0;
}
.hero p {
  font-size: 19px;
  max-width: 680px;
  color: #444;
  margin: 28px 0 36px;
}
.actions { display: flex; gap: 14px; flex-wrap: wrap }

/* === BOTTONI === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: white;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .03em;
  box-shadow: 0 8px 32px rgba(0,84,176,.28);
  transition: transform .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 16px 42px rgba(0,84,176,.35) }
.btn.light {
  background: rgba(255,255,255,.12);
  color: white;
  border: 1.5px solid rgba(255,255,255,.35);
  box-shadow: var(--shadow-sm);
}
.btn.light:hover { background: rgba(255,255,255,.22); box-shadow: var(--shadow-md); transform: translateY(-2px) }

/* === SEZIONE SERVIZI === */
.label {
  font-size: 11px;
  color: var(--orange);
  font-weight: 900;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(30px, 4.5vw, 58px);
  line-height: 1.0;
  letter-spacing: -.055em;
  margin: 12px 0 0;
}
.text-xl { font-size: 19px; color: #3b3b3b; line-height: 1.65 }

.split {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: 80px;
  align-items: start;
  padding: 100px 0;
}
/* Sezione servizi su sfondo colorato */
section:has(.split) {
  background: linear-gradient(135deg, var(--sky) 0%, #c8dff8 100%);
}
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 32px;
}
.service { background: var(--sky); padding: 36px }
.num {
  color: var(--orange);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 48px;
}
.service h3 { font-size: 24px; letter-spacing: -.03em; margin: 0 0 10px }
.service p { color: var(--muted); margin: 0; font-size: 15px }

/* === BAND (striscia scura) === */
.band {
  background: linear-gradient(130deg, #1a0a00 0%, #3d1e00 45%, #0b3d78 100%);
  color: white;
  padding: 90px 0;
  position: relative;
  overflow: hidden;
}
.band::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--accent));
}
.band .section-title { color: #0a2a5e }
.band .muted { color: #e8720a }
.band .label { color: var(--orange2) }
.band .btn.light {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}
.band .btn.light:hover { background: #c45200; border-color: #c45200 }

/* === MACHINE GRID (home) === */
.portfolio { padding: 96px 0; background: linear-gradient(160deg, var(--sky) 0%, var(--orange-soft) 100%) }

.machine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}

/* === CARD === */
.card {
  background: #ffffff;
  border: 1px solid var(--sky-mid);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent2);
}
.card-img {
  overflow: hidden;
  height: 260px;
  position: relative;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.card:hover .card-img img { transform: scale(1.06) }
.card-body {
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.tag {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 900;
  background: rgba(224,94,8,.09);
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  width: fit-content;
  border: 1px solid rgba(224,94,8,.18);
}
.card h3 {
  font-size: 21px;
  line-height: 1.12;
  letter-spacing: -.04em;
  margin: 0;
}
.card p { color: var(--muted); margin: 0; font-size: 14.5px; line-height: 1.65 }
.more {
  margin-top: auto;
  color: var(--orange);
  font-weight: 900;
  font-size: 13px;
  padding-top: 14px;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* === LOGO SHOWCASE === */
.logo-showcase {
  padding: 80px 0;
  background: linear-gradient(135deg, #040c1a 0%, #071e42 50%, #0a3878 100%);
  text-align: center;
}
.logo-showcase-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.logo-showcase-inner img {
  max-width: min(680px, 85vw);
  width: 100%;
  filter: brightness(0) invert(1);
  opacity: .95;
  display: block;
  margin: 0 auto;
}
.logo-showcase-inner p {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin: 0;
}

/* === CONTATTI === */
.contact { padding: 96px 0 }
.contact-box {
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 40px;
}
.contact-box > div { padding: 42px }
.contact-box > div + div { border-left: 1px solid var(--line) }
.contact-box h3 { font-size: 20px; margin: 0 0 12px; letter-spacing: -.03em }
.contact-box p { color: var(--muted); margin: 0; line-height: 1.8 }

/* === YOUTUBE LINK === */
.yt-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ff4444;
  font-weight: 700;
  font-size: 14px;
  transition: opacity .15s;
}
.yt-link:hover { opacity: .75 }
.yt-link svg { flex-shrink: 0 }

/* === FOOTER === */
footer {
  padding: 44px 0;
  border-top: 1px solid rgba(0,130,224,.25);
  color: rgba(255,255,255,.65);
  font-size: 14px;
  background: linear-gradient(135deg, #040c1a 0%, #071e42 60%, #0c3060 100%);
}
footer a { color: rgba(255,255,255,.7) }
footer a:hover { color: white }
.footer-logo { height: 42px; width: auto; margin-bottom: 10px; opacity: .9; filter: brightness(10) }
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}
.footer-grid > div { line-height: 1.7 }

/* === SCHEDA MACCHINA (detail page) === */
.machine-hero {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--soft) 60%, #e8f0fb 100%);
  position: relative;
  overflow: hidden;
}
.machine-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--orange));
}
.breadcrumb {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 20px;
}
.machine-hero h1 {
  font-size: clamp(38px, 6vw, 76px);
  line-height: .96;
  letter-spacing: -.065em;
  margin: 0;
}
.machine-hero p {
  max-width: 820px;
  font-size: 19px;
  color: #444;
  margin: 16px 0 0;
}
.detail {
  padding: 60px 0 96px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
}
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.gallery img {
  width: 100%;
  height: 310px;
  object-fit: cover;
  border-radius: 10px;
  background: #eee;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.gallery img:hover { box-shadow: var(--shadow-md) }
.gallery img:first-child {
  grid-column: 1 / -1;
  height: 520px;
}
.side {
  position: sticky;
  top: 108px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 34px;
  background: white;
  box-shadow: var(--shadow-sm);
}
.side h2 { font-size: 26px; margin: 12px 0; letter-spacing: -.04em }
.side h3 { font-size: 16px; margin: 20px 0 6px }
.side ul { padding-left: 18px; color: #444; margin: 0 }
.side li { margin: 7px 0; font-size: 15px }
.side p { color: var(--muted); font-size: 15px; margin: 8px 0 0 }
.nav-next {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
}
.nav-next a {
  border: 1px solid var(--line);
  padding: 14px 18px;
  font-weight: 900;
  font-size: 13px;
  background: white;
  border-radius: var(--radius);
  transition: background .15s;
}
.nav-next a:hover { background: var(--soft) }

/* === PORTFOLIO PAGE === */
.portfolio-hero { padding: 80px 0 40px; border-bottom: 1px solid var(--line); background: var(--soft) }
.portfolio-hero h1 { font-size: clamp(42px, 6vw, 80px); letter-spacing: -.065em; margin: 18px 0 0; line-height: .95 }

/* =============================================
   CATALOGO MACCHINE — NUOVO DESIGN
   ============================================= */

/* Hero catalogo */
.cat-hero {
  padding: 80px 0 60px;
  background: var(--deep);
  color: white;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cat-hero .breadcrumb { color: #5aaaf0; margin-bottom: 28px }
.cat-hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}
.cat-hero-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .26em;
  font-weight: 900;
  color: var(--orange2);
  margin-bottom: 16px;
}
.cat-hero h1 {
  font-size: clamp(48px, 7vw, 96px);
  line-height: .92;
  letter-spacing: -.07em;
  margin: 0;
  color: white;
}
.cat-hero p {
  font-size: 18px;
  color: #9bb8d4;
  max-width: 560px;
  margin: 20px 0 0;
  line-height: 1.65;
}
.cat-hero-stats {
  display: flex;
  gap: 40px;
  flex-shrink: 0;
  padding-bottom: 6px;
}
.stat { display: flex; flex-direction: column; align-items: flex-end }
.stat-num {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1;
  color: var(--orange2);
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: rgba(255,255,255,.6);
  font-weight: 700;
}

/* Indice categorie */
.cat-index {
  background: linear-gradient(90deg, #0a1e3d 0%, #0b3878 100%);
  border-bottom: 2px solid var(--orange);
  position: sticky;
  top: 88px;
  z-index: 90;
}
.cat-index-inner {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-index-inner::-webkit-scrollbar { display: none }
.cat-index-inner a {
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.cat-index-inner a:hover { color: var(--orange2); border-bottom-color: var(--orange2) }

/* Sezioni del catalogo */
.cat-section {
  padding: 88px 0;
  background: linear-gradient(180deg, var(--sky) 0%, #dff0ff 100%);
}
.cat-section-alt {
  background: linear-gradient(180deg, var(--orange-soft) 0%, #fde8c8 100%);
  border-top: 1px solid var(--orange-mid);
  border-bottom: 1px solid var(--orange-mid);
}

.cat-sec-header {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.cat-sec-num {
  font-size: 88px;
  font-weight: 900;
  letter-spacing: -.06em;
  line-height: 1;
  color: var(--orange-mid);
  flex-shrink: 0;
  user-select: none;
  margin-top: -10px;
}
.cat-sec-info h2 {
  font-size: clamp(26px, 3.5vw, 44px);
  letter-spacing: -.05em;
  line-height: 1.05;
  margin: 10px 0 16px;
}
.cat-sec-info p {
  color: var(--muted);
  font-size: 16px;
  max-width: 640px;
  margin: 0;
  line-height: 1.7;
}

/* Grid speciale per sezione con 1 card */
.machine-grid-single {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 0;
}
.card-wide .card-img { height: 300px }

/* CTA in fondo al catalogo */
.cat-cta {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--deep) 0%, #0b3d78 60%, #0066cc 100%);
  color: white;
}
.cat-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}
.cat-cta .label { color: #5aaaf0 }
.cat-cta h2 {
  font-size: clamp(26px, 3.5vw, 44px);
  letter-spacing: -.05em;
  margin: 12px 0 10px;
  color: white;
}
.cat-cta p { color: #9bb8d4; margin: 0; font-size: 16px }

/* === OFFERTA GRID (chi siamo) === */
.offerta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.offerta-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 36px;
  position: relative;
}
.offerta-num {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1;
  color: var(--orange);
  margin-bottom: 20px;
}
.offerta-card h3 {
  font-size: 22px;
  letter-spacing: -.04em;
  margin: 0 0 12px;
}
.offerta-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  margin: 0;
}

/* ============
   MOBILE
   ============ */
.only-mobile { display: none }

@media (max-width: 960px) {
  /* Hamburger visibile */
  .ham { display: flex }
  .only-mobile { display: none !important }

  /* Topbar sticky e contenitore del dropdown */
  .topbar { position: sticky; overflow: visible }

  /* Menu dropdown */
  .menu {
    display: none;
    position: fixed;
    top: 88px;
    left: 0; right: 0;
    background: #0a4a9e;
    border-top: 1px solid rgba(255,255,255,.15);
    border-bottom: 2px solid var(--orange);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
    z-index: 9999;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
  }
  .menu.open { display: flex }
  .menu a {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    font-size: 14px;
    letter-spacing: .04em;
    color: rgba(255,255,255,.85) !important;
  }
  .menu a:last-child { border-bottom: none }
  .menu a:hover { color: var(--orange2) !important; background: rgba(255,255,255,.07) }
  .cta {
    border: none !important;
    border-radius: 0 !important;
    background: rgba(217,85,0,.25) !important;
    color: var(--orange2) !important;
    padding: 14px 24px !important;
  }
  /* Logo mobile: più compatto */
  .logo { padding: 5px 12px; min-width: 0 }
  .logo img { height: 36px; max-width: 160px }
  /* Ham burger: trattini bianchi su navbar blu */
  .ham { border-color: rgba(255,255,255,.3) }
  .ham span { background: white }

  .hero { min-height: 540px }
  .split, .detail, .contact-box { grid-template-columns: 1fr }
  .machine-grid { grid-template-columns: 1fr 1fr }
  .contact-box > div + div { border-left: 0; border-top: 1px solid var(--line) }
  .side { position: static }
  .gallery img:first-child { height: 360px }
  .cat-hero-inner { flex-direction: column; align-items: flex-start }
  .cat-hero-stats { align-self: flex-start }
  .cat-cta-inner { flex-direction: column; text-align: center }
  .cat-index { top: 88px }
  .logo-showcase-inner img { max-width: 90vw }
}

@media (max-width: 640px) {
  .wrap { width: min(100% - 28px, 1180px) }
  .nav { height: 68px }
  .menu { top: 68px; max-height: calc(100vh - 68px) }
  .logo { min-width: 0; padding: 4px 10px }
  .logo img { height: 30px; max-width: 140px }
  .hero h1, .machine-hero h1 { letter-spacing: -.05em; word-break: break-word; overflow-wrap: break-word }
  .service-grid, .machine-grid, .gallery, .offerta-grid { grid-template-columns: 1fr }
  .split, .portfolio, .contact, .cat-section { padding: 56px 0 }
  section, .hero, .band, .portfolio, .logo-showcase, .contact { overflow: hidden; max-width: 100vw }
  .portfolio { display: none }
  .gallery img, .gallery img:first-child { height: 260px }
  .footer-grid, .nav-next { display: block }
  .nav-next a { display: block; margin: 10px 0 }
  .footer-grid > div { margin-bottom: 16px }
  .cat-sec-header { flex-direction: column; gap: 0 }
  .cat-sec-num { font-size: 56px }
  .cat-hero-stats { gap: 24px }
  .stat-num { font-size: 36px }
  .cat-index { display: none }
  .machine-grid-single { grid-template-columns: 1fr }
  .logo-showcase { padding: 48px 0 }
  .logo-showcase-inner img { max-width: 95vw }
}