﻿/* =========================================================
   ENERGY SERVICE TECH — mobile.css  v2.0
   Mobile-first. Caricato SOLO su max-width:768px.
   Ispirato a Linear, Vercel, Stripe — design premium mobile.
   ========================================================= */

/* ── BASE ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  overflow-x: hidden;
  padding-bottom: 0 !important;
}

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 7vw, 2.1rem);  line-height: 1.15; }
h2 { font-size: clamp(1.3rem, 5.5vw, 1.65rem); line-height: 1.2; }
h3 { font-size: 1rem; }
h4 { font-size: .875rem; }
p  { font-size: .9375rem; line-height: 1.65; }

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  height: 60px !important;
  padding: 0 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  overflow: visible !important;
  transition: background .3s ease, backdrop-filter .3s ease, box-shadow .3s ease !important;
}

/* Navbar scroll blur — classe .scrolled aggiunta via JS */
.navbar.scrolled {
  background: rgba(9,9,9,0.92) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) !important;
}

/* Nascondi link desktop nella navbar */
.navbar .nav-links { display: none !important; }

/* Logo */
.nav-logo {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  height: 60px;
  flex-shrink: 0;
}
.nav-logo span { display: none !important; }
.nav-logo img  { height: 40px !important; width: auto; }

/* Hamburger — animazione → X */
.nav-toggle {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: 44px !important;
  height: 44px !important;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 !important;
  margin: 0 !important;
  position: relative;
}
.nav-toggle span {
  display: block !important;
  width: 22px;
  height: 2px;
  background: #f0f0f0;
  border-radius: 2px;
  transform-origin: center;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s ease, top .2s ease;
  position: absolute;
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 27px; }

/* X quando aperto */
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 22px;
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 22px;
}

/* ── MOB-MENU — animazione smooth ───────────────────────── */
#mob-menu {
  display: flex !important;  /* sempre nel DOM */
  flex-direction: column;
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: rgba(9,9,9,0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2rem 1.4rem 2.5rem;
  z-index: 998;
  overflow-y: auto;
  /* Stato chiuso */
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity .3s cubic-bezier(.4,0,.2,1), transform .3s cubic-bezier(.4,0,.2,1);
}
/* Stato aperto */
#mob-menu.mob-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Voci menu — con numero + freccia (look premium) */
.mob-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2rem;
  flex: 1;
  counter-reset: mob-counter;
}
.mob-links li {
  border-bottom: 1px solid rgba(255,255,255,.07);
  counter-increment: mob-counter;
}
.mob-links li a {
  display: flex;
  align-items: center;
  padding: 1.05rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  min-height: 56px;
  transition: color .2s, padding-left .2s;
  gap: .85rem;
}
.mob-links li a::before {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cc1f1f;
  flex-shrink: 0;
  margin-top: .15rem;
  box-shadow: 0 0 6px rgba(204,31,31,.6);
}
.mob-links li a::after {
  content: "→";
  margin-left: auto;
  color: rgba(255,255,255,.2);
  font-size: .9rem;
  transition: color .2s, transform .2s;
}
.mob-links li a:active {
  color: #fff;
  padding-left: .25rem;
}
.mob-links li a:active::after {
  color: #cc1f1f;
  transform: translateX(3px);
}

/* Bottoni azione — nascosti */
.mob-actions { display: none !important; }

/* Sticky bar nascosta */
#sticky-bar { display: none !important; }

/* ── LAYOUT BASE ─────────────────────────────────────────── */
section { padding: 48px 1.25rem !important; }
.section-inner { max-width: 100%; padding: 0; }
.cta-band { padding: 52px 1.25rem !important; }
.page-hero {
  padding: calc(60px + 40px) 1.25rem 40px !important;
}
.section-tag { font-size: .7rem; letter-spacing: 1.5px; margin-bottom: .75rem; }
.section-subtitle { font-size: .9rem; margin-bottom: 1.6rem; }
.divider { margin: .7rem 0 1.4rem; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  min-height: 100svh !important;
  min-height: 100vh !important; /* fallback */
  padding: calc(60px + 48px) 1.25rem 3rem !important;
  display: flex !important;
  align-items: center !important;
}
.hero-content { width: 100%; }
.hero-eyebrow {
  font-size: .68rem;
  letter-spacing: 1px;
  padding: .3rem .85rem;
  margin-bottom: 1.1rem;
  white-space: normal;
  line-height: 1.5;
  display: inline-flex;
}
.hero h1 { margin-bottom: .9rem; }
.hero-sub {
  font-size: .95rem !important;
  max-width: 100% !important;
  margin-bottom: 2rem !important;
  color: #a0a0a0;
}
.hero-ctas {
  display: flex !important;
  flex-direction: column !important;
  gap: .75rem !important;
}
.hero-ctas .btn {
  width: 100% !important;
  justify-content: center !important;
  min-height: 52px;
}

/* Hero badge — piccolo, in basso a destra */
.hero-badge {
  display: flex !important;
  position: absolute;
  bottom: 2rem;
  right: 1.25rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: .6rem .9rem;
  text-align: center;
  gap: 0;
}
.hero-badge .badge-num {
  font-size: 1.4rem !important;
  font-weight: 800;
  line-height: 1;
  color: #cc1f1f;
}
.hero-badge .badge-label {
  font-size: .65rem !important;
  color: rgba(255,255,255,.5);
  line-height: 1.4;
}

/* ── STATS ───────────────────────────────────────────────── */
.stats-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0 !important;
}
.stat-item {
  padding: 1.5rem .75rem !important;
  position: relative;
}
/* Separatori interni */
.stat-item:nth-child(1),
.stat-item:nth-child(2) {
  border-bottom: 1px solid var(--border);
}
.stat-item:nth-child(odd) {
  border-right: 1px solid var(--border);
}
.stat-num   { font-size: 2.1rem !important; font-weight: 800 !important; }
.stat-label { font-size: .78rem !important; color: #888; margin-top: .2rem; }

/* ── BOTTONI ─────────────────────────────────────────────── */
.btn { min-height: 48px; transition: transform .15s, opacity .15s; }
.btn:active { transform: scale(.97); opacity: .9; }
.btn-lg { padding: .85rem 1.4rem !important; font-size: .9rem !important; }
.btn-group {
  display: flex !important;
  flex-direction: column !important;
  gap: .75rem !important;
}
.btn-group .btn {
  width: 100% !important;
  justify-content: center !important;
  min-height: 52px;
}

/* ── SERVICES GRID ───────────────────────────────────────── */
.services-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: .75rem !important;
}

.service-card {
  padding: 1.15rem 1rem !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: .5rem !important;
  align-items: flex-start;
  transition: transform .15s ease, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.service-card:active {
  transform: scale(.97);
  border-color: rgba(204,31,31,.5) !important;
}

.service-card.featured {
  grid-column: unset !important;
  padding: 1.15rem 1rem !important;
  background: var(--bg-card) !important;
  border-color: rgba(204,31,31,.35) !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: .5rem !important;
}
.service-card.featured .service-badge-featured {
  display: none !important;
}

.service-icon {
  width: 40px !important;
  height: 40px !important;
  font-size: 1.2rem !important;
  margin-bottom: .1rem;
}
.service-card h3 {
  font-size: .86rem !important;
  line-height: 1.3;
  margin: 0;
}
.service-card p {
  display: block !important;
  font-size: .78rem !important;
  color: #888;
  line-height: 1.55;
}
.service-link {
  font-size: .76rem !important;
  margin-top: auto;
  padding-top: .25rem;
  color: #cc1f1f;
}

/* ── FEATURE ROW ─────────────────────────────────────────── */
.feature-row,
.feature-row.reverse {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
  direction: ltr !important;
  grid-template-columns: unset !important;
  max-width: 100% !important;
}
.feature-row > .feature-img,
.feature-row.reverse > .feature-img  { order: 1 !important; }
.feature-row > .feature-text,
.feature-row.reverse > .feature-text { order: 2 !important; }

.feature-img {
  border-radius: 16px !important;
  aspect-ratio: 4/3 !important;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.feature-img img { width: 100%; height: 100%; object-fit: cover; }
/* Gradient overlay bottom */
.feature-img::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 35%;
  background: linear-gradient(transparent, rgba(9,9,9,.5));
  border-radius: 0 0 16px 16px;
  pointer-events: none;
}
.feature-text { display: flex !important; flex-direction: column !important; gap: .9rem !important; }
.feature-text > p { font-size: .875rem !important; color: #a0a0a0; }

/* ── WHY GRID — layout grid con icona a sinistra ───────── */
.why-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: .75rem !important;
}
.why-card {
  padding: 1.1rem 1.1rem !important;
  border-radius: 14px;
  display: grid !important;
  grid-template-columns: 44px 1fr !important;
  grid-template-rows: auto auto !important;
  column-gap: .85rem !important;
  row-gap: 0 !important;
  align-items: start;
}
.why-icon {
  font-size: 1.55rem !important;
  margin-bottom: 0 !important;
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: .15rem;
  flex-shrink: 0;
}
.why-card h3 {
  font-size: .95rem !important;
  margin-bottom: .2rem;
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: end;
}
.why-card p  {
  font-size: .82rem !important;
  color: #888;
  margin: 0;
  grid-column: 2 !important;
  grid-row: 2 !important;
  align-self: start;
}

/* ── CTA BAND ────────────────────────────────────────────── */
.cta-band {
  text-align: center !important;
  background: linear-gradient(135deg, #1a0505 0%, #0d0808 50%, #0a0a0a 100%) !important;
  border-top: 1px solid rgba(204,31,31,.2) !important;
  border-bottom: 1px solid rgba(204,31,31,.2) !important;
  position: relative;
  overflow: hidden;
}
/* Glow sfocato decorativo */
.cta-band::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 280px; height: 150px;
  background: radial-gradient(ellipse, rgba(204,31,31,.12) 0%, transparent 70%);
  pointer-events: none;
}
.cta-band h2 { margin-bottom: .75rem !important; position: relative; }
.cta-band p  { font-size: .9rem !important; margin-bottom: 1.6rem !important; color: #a0a0a0; position: relative; }

/* ── CLIENTI / LOGHI — carousel orizzontale ─────────────── */
.clients-logos-wrap {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: scroll !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-snap-type: x proximity !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  gap: .65rem !important;
  margin-top: 1.8rem !important;
  width: calc(100% + 2.5rem) !important;
  margin-left: -1.25rem !important;
  padding: .4rem 1.25rem 1.2rem !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 1 !important;
  justify-content: flex-start !important;
}
.clients-logos-wrap::-webkit-scrollbar { display: none !important; }

.client-logo-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  height: 52px !important;
  padding: 0 1.1rem !important;
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 10px !important;
  scroll-snap-align: start !important;
  filter: none !important;
  opacity: 0.65 !important;
  transition: opacity .2s !important;
  -webkit-tap-highlight-color: transparent !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}
.client-logo-link:active { opacity: 1 !important; }
.client-logo-img {
  max-height: 28px !important;
  max-width: 80px !important;
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0 !important;
}
.client-logo-text {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
}
.client-logo-link--light,
.client-logo-link--light-nf { background: rgba(255,255,255,.1) !important; }
.client-logo-link--dark      { background: rgba(50,50,50,.7) !important; }

/* ── CARDS ───────────────────────────────────────────────── */
.card { padding: 1.1rem !important; border-radius: 12px; }
.comp-item { font-size: .875rem !important; }

/* ── DPI — fix griglia su mobile ─────────────────────────── */
[style*="grid-template-columns:repeat(auto-fit,minmax(280px"] {
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
}
[style*="grid-template-columns:repeat(auto-fit,minmax(130px"] {
  grid-template-columns: 1fr 1fr !important;
}
[style*="grid-template-columns:repeat(auto-fit,minmax(260px"] {
  grid-template-columns: 1fr !important;
  gap: 1rem !important;
}

/* ── PAGE HERO (sottopagine) ─────────────────────────────── */
.page-hero {
  padding: calc(60px + 36px) 1.25rem 36px !important;
}
.breadcrumb { font-size: .75rem; margin-bottom: .9rem; }

/* ── CONTACT PAGE ────────────────────────────────────────── */
.contact-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 2rem !important;
  max-width: 100% !important;
}
.contact-item { gap: .7rem !important; }
.contact-icon { width: 36px !important; height: 36px !important; flex-shrink: 0; border-radius: 8px; }
.contact-form { padding: 1.2rem !important; border-radius: 14px; }
.form-row {
  display: flex !important;
  flex-direction: column !important;
  gap: .8rem !important;
  grid-template-columns: unset !important;
}
.form-group input,
.form-group select,
.form-group textarea { font-size: 16px !important; }

/* ── FOOTER ──────────────────────────────────────────────── */
.footer { padding: 40px 1.25rem 0 !important; }
.footer-top {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  grid-template-columns: unset !important;
  padding-bottom: 0 !important;
}
.footer-brand {
  padding-bottom: 1.2rem !important;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-logo img { height: 48px !important; }
.footer-brand > p { font-size: .82rem !important; color: #666; margin: .65rem 0 .9rem !important; }
/* Logo + PagoDIL inline su mobile */
.footer-brand > div {
  flex-direction: row !important;
  align-items: center !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
}

/* Accordion */
.footer-col { border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-col h4 {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: .9rem 0 !important;
  margin-bottom: 0 !important;
  cursor: pointer;
  user-select: none;
  font-size: .72rem !important;
  letter-spacing: 1.5px;
  color: #666;
  min-height: 48px;
}
.footer-col h4::after {
  content: '+';
  font-size: 1.1rem;
  font-weight: 300;
  color: #555;
  transition: transform .25s;
  flex-shrink: 0;
}
.footer-col.open h4::after { transform: rotate(45deg); }
.footer-col ul,
.footer-col .footer-contact-item { display: none !important; }
.footer-col.open ul {
  display: flex !important;
  flex-direction: column !important;
  gap: .55rem !important;
  padding-bottom: .9rem !important;
}
.footer-col.open .footer-contact-item { display: flex !important; }
.footer-col .footer-contact-item:last-child { margin-bottom: .9rem !important; }
.footer-col a  { font-size: .85rem !important; }
.footer-contact-item { font-size: .82rem !important; gap: .5rem !important; }

.footer-bottom {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: .35rem !important;
  padding: 1.1rem 0 !important;
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-bottom p { font-size: .73rem !important; color: #555; }

/* ── UTILITIES ───────────────────────────────────────────── */
.mt-4 { margin-top: 1.5rem !important; }
.text-center .divider { margin-left: auto !important; margin-right: auto !important; }

/* ── FADE-IN disabilitato su mobile (performance) ────────── */
.fade-in {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* -- HIDE SU MOBILE ---------------------------------------- */
.mob-hide { display: none !important; }

/* -- CONTATTI: Andrea prima, poi Luigi, poi Email ---------- */
.contacts-persons {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: unset !important;
}
.contacts-persons .card:nth-child(1) { order: 2; } /* Luigi → secondo */
.contacts-persons .card:nth-child(2) { order: 1; } /* Andrea → primo  */
.contacts-persons .card:nth-child(3) { order: 3; } /* Email  → terzo  */