/* ─── MEGAMENU — Autocambio ─────────────────────────────────────────── */

/* ── Trigger item inside .nav-links ── */
.mm-item { position: relative; }
.mm-item-row { display: flex; align-items: center; }
.mm-item-link {
  display: inline-flex !important;
  align-items: center; gap: 5px;
}
.mm-item-chev {
  width: 9px; height: 9px; flex-shrink: 0;
  color: rgba(242,240,237,.32);
  transition: transform .2s ease, color .18s;
}
.mm-item.is-open .mm-item-chev,
.mm-item:hover  .mm-item-chev { transform: rotate(180deg); color: #E86010; }
.mm-mob-btn { display: none; }   /* hidden on desktop */
.mm-mob-panel { display: none; } /* hidden always; revealed by .is-open on mobile */

/* ── Desktop panel ── */
.mm {
  position: absolute;
  top: 66px; left: 0; right: 0;
  background: #0a0a0a;
  border-top: 1px solid rgba(232,96,16,.12);
  border-bottom: 1px solid #1e1e1e;
  box-shadow: 0 16px 48px rgba(0,0,0,.85);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 1;  /* stacks inside fixed nav, above page content */
}
.mm.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.mm-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 0;
}

/* ── 4-column service grid ── */
.mm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid #1e1e1e;
}

.mm-col-hd {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(232,96,16,.18);
}
.mm-col-title {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #E86010;
  margin-bottom: 5px;
}
.mm-col.is-active .mm-col-title { color: #ff6d14; }
.mm-col-desc {
  font-size: 12px;
  color: #757170;
  line-height: 1.4;
}

/* Service links */
.mm-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mm-link {
  display: flex;
  align-items: center;
  font-family: 'Barlow', sans-serif;
  font-size: 13.5px;
  color: rgba(242,240,237,.52);
  padding: 7px 0;
  transition: color .14s, padding-left .15s;
  outline: none;
  border-radius: 2px;
}
.mm-link::before {
  content: '';
  flex-shrink: 0;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #E86010;
  opacity: 0;
  margin-right: 0;
  transition: opacity .14s, margin-right .15s;
}
.mm-link:hover               { color: #f2f0ed; padding-left: 10px; }
.mm-link:hover::before       { opacity: 1; margin-right: 8px; }
.mm-link:focus-visible       { outline: 2px solid #E86010; outline-offset: 2px; }
.mm-link.is-active           { color: #E86010; padding-left: 10px; }
.mm-link.is-active::before   { opacity: 1; margin-right: 8px; }

/* ── Footer strip ── */
.mm-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 -32px;
  background: #070707;
  border-top: 1px solid #1e1e1e;
}
.mm-foot-block {
  padding: 22px 28px;
  border-right: 1px solid #1e1e1e;
}
.mm-foot-block:last-child { border-right: none; }
.mm-foot-title {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  color: #f2f0ed;
  margin-bottom: 5px;
  transition: color .18s;
  text-decoration: none;
}
a.mm-foot-title:hover { color: #E86010; }
.mm-foot-desc { font-size: 12px; color: #757170; line-height: 1.5; }

/* ═════════════════════════════ MOBILE ══════════════════════════════ */
@media (max-width: 768px) {

  /* Desktop panel hidden on mobile */
  .mm { display: none !important; }

  /* Hide the desktop chevron on mobile (the mobile button has its own) */
  .mm-item-chev { display: none; }

  /* Mobile toggle button (chevron beside Servizi text) */
  .mm-mob-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: none; border: none; cursor: pointer;
    padding: 4px; flex-shrink: 0;
    margin-left: auto;
  }
  .mm-mob-chev {
    width: 12px; height: 12px;
    color: rgba(242,240,237,.38);
    transition: transform .25s ease;
  }
  .mm-item.mob-open .mm-mob-chev { transform: rotate(180deg); color: #E86010; }

  /* Mobile accordion panel */
  .mm-mob-panel {
    display: none;
    background: rgba(255,255,255,.02);
    border-top: 1px solid #1e1e1e;
  }
  .mm-mob-panel.is-open { display: block; }

  /* "Vedi tutti" shortcut */
  .mm-mob-all {
    display: block;
    padding: 10px 24px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 11px; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: #E86010;
    border-bottom: 1px solid #1e1e1e;
  }

  /* Cluster accordion button */
  .mm-mob-cluster-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 24px 10px 32px;
    background: none; border: none; cursor: pointer;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600; font-size: 11px;
    letter-spacing: .14em; text-transform: uppercase;
    color: rgba(242,240,237,.4);
    transition: color .18s;
  }
  .mm-mob-cluster-btn:hover,
  .mm-mob-cluster.is-open .mm-mob-cluster-btn { color: #E86010; }

  .mm-mob-cluster-chev {
    width: 10px; height: 10px;
    color: rgba(242,240,237,.22);
    transition: transform .25s;
    flex-shrink: 0;
  }
  .mm-mob-cluster.is-open .mm-mob-cluster-chev {
    transform: rotate(180deg);
    color: #E86010;
  }

  /* Cluster service list */
  .mm-mob-cluster-panel { display: none; }
  .mm-mob-cluster.is-open .mm-mob-cluster-panel { display: block; }
  .mm-mob-cluster-panel a {
    display: block;
    padding: 9px 24px 9px 40px;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    color: rgba(242,240,237,.4);
    transition: color .18s;
  }
  .mm-mob-cluster-panel a:hover,
  .mm-mob-cluster-panel a.is-active { color: #E86010; }

  /* Mobile footer strip */
  .mm-mob-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #1e1e1e;
    margin-top: 4px;
    flex-wrap: wrap;
  }
  .mm-mob-footer-link {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 11px; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: #757170;
    flex: 1; min-width: 120px;
    transition: color .18s;
  }
  .mm-mob-footer-link:hover { color: #E86010; }
  .mm-mob-footer-cta { padding: 9px 14px !important; font-size: 11px !important; }

  /* Override existing #nav.open .nav-links a for the trigger row */
  #nav.open .nav-links .mm-item-link {
    padding: 12px 24px; font-size: 14px; flex: 1;
  }
  #nav.open .nav-links .mm-item-row {
    display: flex; align-items: center; border-bottom: none;
  }

  /* Make mobile nav scrollable when accordion is expanded */
  #nav.open .nav-links {
    max-height: calc(100svh - 66px);
    overflow-y: auto;
  }
}
