/* 
  MC2 Srl - Premium Redesign
  Primary: #227318 (Green)
  Secondary: #212121 (Dark Gray)
  Backgrounds: #ffffff, #f9fafb, #f3f4f6
*/

:root {
  --primary: #227318;
  --primary-light: #2c931f;
  --primary-dark: #195211;
  --secondary: #212121;
  --text-main: #333333;
  --text-muted: #666666;
  --bg-main: #ffffff;
  --bg-alt: #f9fafb;
  --bg-dark: #111111;
  --white: #ffffff;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 8px;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  color: var(--secondary);
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: 3.5rem;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

.section-bg-alt {
  background-color: var(--bg-alt);
}

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.header.scrolled {
  padding: 0.5rem 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  gap: 1.5rem;
}

.nav-container > nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Language Switcher */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 1.25rem;
  padding-left: 1.25rem;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.lang-selector a {
  color: var(--text-muted);
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  transition: var(--transition);
}

.lang-selector .lang-disabled {
  color: rgba(102, 102, 102, 0.55);
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  cursor: not-allowed;
  user-select: none;
}

.lang-selector a.active,
.lang-selector a:hover {
  color: var(--primary);
}

.lang-selector__compact {
  display: none;
  position: relative;
  align-items: center;
  min-width: 66px;
  height: 38px;
  border: 1px solid rgba(33, 33, 33, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  color: var(--secondary);
}

.lang-selector__compact:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 115, 24, 0.14);
}

.lang-selector__compact > i {
  margin-left: 0.65rem;
  color: var(--primary);
  font-size: 0.78rem;
  pointer-events: none;
}

.lang-selector__compact::after {
  content: '\f078';
  position: absolute;
  right: 0.65rem;
  color: var(--text-muted);
  font-family: 'Font Awesome 6 Free';
  font-size: 0.62rem;
  font-weight: 900;
  pointer-events: none;
}

.lang-selector__select {
  width: 100%;
  min-width: 0;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0.55rem 1.6rem 0.55rem 0.35rem;
}

/* Mobile menu button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
  padding: 0.25rem;
  line-height: 1;
}

/* Hero CTA button group */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.logo {
  display: block;
  width: 170px;
  height: 46px;
  background-image: url("../images/Logo-MC2-Completo-rid.webp");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: left center;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 1.35rem;
  align-items: center;
}

.nav-item {
  position: relative;
  font-weight: 600;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  font-size: 0.98rem;
  text-transform: none;
  letter-spacing: 0.1px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb a:hover {
  color: var(--white);
}

.breadcrumb-sep {
  opacity: 0.7;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.12);
  transform: translateY(0);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 0;
}

.cookie-banner__text {
  margin: 0;
  color: var(--secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-banner__btn {
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner__actions {
    justify-content: flex-end;
  }
}

.nav-item > a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.2rem;
  line-height: 1.2;
  position: relative;
  white-space: nowrap;
  color: var(--secondary);
}

.nav-item > a:hover {
  color: var(--primary);
}

.nav-item::after {
  display: none;
}

.nav-item a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-item a:hover::after {
  transform: scaleX(1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(34, 115, 24, 0.3);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background-color: var(--white);
  color: var(--primary);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: linear-gradient(rgba(33, 33, 33, 0.7), rgba(33, 33, 33, 0.6)), url('../images/header-home.webp') center/cover no-repeat;
  color: var(--white);
  padding-top: 80px;
}

/* Full-height homepage banner; internal page banners use 80% of the viewport. */
.hero {
  min-height: 100vh !important;
}

.hero[style*="min-height"] {
  min-height: 80vh !important;
}

.hero-content {
  width: 100%;
  max-width: 800px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
  animation: fadeUp 1s ease-out forwards;
  opacity: 0;
}

.hero h1 {
  color: var(--white);
  font-size: 4rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero p {
  font-size: 1.2rem;
  margin-right: auto;
  margin-bottom: 2rem;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
}

.hero-cta {
  justify-content: center;
}

.language-placeholder-hero .hero-content {
  max-width: 760px;
}

.language-placeholder-hero h1 {
  text-transform: none;
}

.language-placeholder-hero__label {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Features/Services Section */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border-bottom: 4px solid transparent;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(34, 115, 24, 0.03));
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-10px);
  border-bottom-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  display: inline-block;
}

/* Products Section Preview */
.product-showcase {
  display: flex;
  align-items: center;
  gap: 4rem;
  margin-bottom: 4rem;
}

.product-showcase:nth-child(even) {
  flex-direction: row-reverse;
}

.product-image {
  flex: 1;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.product-image img {
  width: 100%;
  transition: transform 0.5s ease;
}

.product-image:hover img {
  transform: scale(1.05);
}

.product-info {
  flex: 1;
}

.product-info h3 {
  color: var(--primary);
}

/* Stats Section */
.stats-section {
  background-color: var(--primary);
  color: var(--white);
  padding: 4rem 0;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.stat-item h4 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.stat-item p {
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 1px;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Footer */
.footer {
  background-color: var(--bg-dark);
  color: #a0aec0;
  padding: 5rem 0 2rem;
  overflow: hidden;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-grid--4col {
  grid-template-columns: repeat(4, 1fr);
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.footer-col h5 {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1.5rem 0 0.75rem;
  font-weight: 600;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transform: translateX(0);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(5px);
}

.footer-links a i {
  font-size: 0.8rem;
  width: 14px;
  text-align: center;
  color: var(--primary);
  opacity: 0.8;
}

/* Legal badge (UE) */
.footer-legal__badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(34, 115, 24, 0.25);
  color: #6fcf6f;
  border: 1px solid rgba(34, 115, 24, 0.4);
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
  margin-left: 2px;
  line-height: 1.4;
}

/* Careers button & submenu */
.footer-careers {
  position: relative;
}

.footer-careers__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  justify-content: space-between;
}

.footer-careers__btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(34, 115, 24, 0.35);
}

.footer-careers__arrow {
  transition: transform 0.25s ease;
  font-size: 0.75rem;
}

.footer-careers__btn[aria-expanded="true"] .footer-careers__arrow {
  transform: rotate(180deg);
}

.footer-careers__menu {
  list-style: none;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 0.4rem 0;
  margin-top: 0.5rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

.footer-careers__menu.is-open {
  max-height: 200px;
  opacity: 1;
}

.footer-careers__menu li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  color: #a0aec0;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-careers__menu li a i {
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
  color: var(--primary);
}

.footer-careers__menu li a:hover {
  background: rgba(34, 115, 24, 0.12);
  color: var(--white);
  padding-left: 1.25rem;
}

/* Footer bottom */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
}

.footer-bottom__links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0;
}

.footer-bottom__links a {
  color: #a0aec0;
  transition: var(--transition);
}

.footer-bottom__links a:hover {
  color: var(--primary);
}

.footer-bottom__links span {
  opacity: 0.4;
}

/* Full-width value proposition strip at the top of every footer. */
.footer-value-proposition {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 3rem;
}

.footer-value-proposition img {
  width: 100%;
  height: auto;
  display: block;
}

.product-image--claim {
  box-shadow: none;
  overflow: visible;
}

.company-vp-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  align-items: center;
  gap: 3rem;
  margin-top: 4rem;
  text-align: left;
  overflow: visible;
}

.company-vp-card:hover {
  transform: none;
}

.company-vp-card > * {
  position: relative;
  z-index: 1;
}

.company-vp-card__content {
  grid-column: 1;
  grid-row: 1;
  text-align: left;
}

.company-vp-card__image {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  justify-self: stretch;
}

.company-vp-card__label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company-vp-card__content h2 {
  margin-bottom: 1.25rem;
}

.company-vp-card__content h2 span {
  display: block;
  white-space: nowrap;
}

.company-values-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1050px) {
  .company-values-grid {
    grid-template-columns: 1fr;
  }
}

.contact-office-phone {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
  color: var(--primary);
  font-weight: 600;
}

.contact-office-phone a:hover {
  color: var(--primary-light);
}

.product-image--claim img {
  transform: scale(1) rotate(0deg);
  transform-origin: center;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
  .product-image--claim:hover img {
    transform: scale(1.08) rotate(1.5deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-image--claim img,
  .product-image--claim:hover img {
    transform: none;
    transition: none;
  }
}

/* Dropdown Mega Menu */
.dropdown {
  position: static; /* so the mega-menu can be absolute on the header */
}

/* The header needs relative so the mega-menu can anchor to it */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

/* Mega-menu: full-width, absolute on the .header */
.dropdown-menu {
  position: absolute;
  top: 100%; /* bottom edge of the header */
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  padding: 1.5rem 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1050;
  border-top: 3px solid var(--primary);
  pointer-events: none;
}

/* Invisible bridge: fills the small gap between nav item and panel */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

/* Simple dropdown (News > Stampa): relative to its own trigger */
.dropdown-menu--simple {
  position: absolute;
  top: calc(100% + 4px);
  left: auto;
  right: 0;
  width: min(240px, calc(100vw - 2rem));
  transform: translateY(-6px);
  margin: 0;
  border-radius: var(--border-radius);
  padding: 0.5rem;
  border-top: 3px solid var(--primary);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Simple dropdown needs its parent to be relative again */
.dropdown:has(.dropdown-menu--simple) {
  position: relative;
}

.dropdown-link {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  color: var(--secondary);
}

.nav-item .dropdown-menu--simple > .dropdown-link {
  display: flex;
  width: 100%;
  align-items: center;
  white-space: normal;
  border-bottom: 1px solid #eaeaea;
}

.nav-item .dropdown-menu--simple > .dropdown-link:last-child {
  border-bottom: 0;
}

@media (hover: hover) {
  .dropdown-link:hover {
    background: var(--bg-alt);
    color: var(--primary);
  }
}

.dropdown-link.active {
  color: var(--primary);
}

.dropdown-link:focus-visible {
  background: var(--bg-alt);
  color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Programmatic open state, available on every input type. */
.dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Hover opening is limited to devices with an actual pointing device. */
@media (hover: hover) and (pointer: fine) {
  .nav-links:has(.dropdown:hover) .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links:has(.dropdown:hover) .dropdown:hover .dropdown-menu--simple {
    transform: translateY(0);
  }
}

/* 5-column grid for 5 product families */
.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.mega-menu-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  background: var(--bg-main);
  border: 1px solid #eaeaea;
  min-width: 0;
}

@media (hover: hover) {
  .mega-menu-card:hover {
    background: var(--bg-alt);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
  }

  .mega-menu-card:hover h4 {
    color: var(--primary);
  }
}

.mega-menu-img {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius);
  overflow: hidden;
  flex-shrink: 0;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.mega-menu-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mega-menu-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mega-menu-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.mega-menu-info h4 {
  font-size: 0.9rem;
  margin: 0;
  color: var(--secondary);
  transition: var(--transition);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Compact desktop: three cards on the first row and two centred below. */
@media (min-width: 993px) and (max-width: 1439px) {
  .mega-menu-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .mega-menu-card {
    grid-column: span 2;
  }

  .mega-menu-card:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .mega-menu-card:nth-child(5) {
    grid-column: 4 / span 2;
  }
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */

/* ── 992px — Tablet layout ── */
@media (max-width: 992px) {
  h1 {
    font-size: 3rem;
  }

  .product-showcase,
  .product-showcase:nth-child(even) {
    flex-direction: column;
    gap: 2rem;
  }

  .company-vp-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .company-vp-card__content {
    grid-column: 1;
    grid-row: 1;
  }

  .company-vp-card__image {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ── 1240px — Compact navigation ──
   Le etichette tradotte possono essere più lunghe dell'italiano: prima che
   inizino a sovrapporsi, passiamo direttamente al menu hamburger. */
@media (max-width: 1240px) {
  /* Mobile nav overlay */
  .nav-container > nav {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--white);
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    overflow-x: visible;
    box-shadow: var(--shadow-md);
    z-index: 1000;
  }

  .nav-container > nav.active {
    left: 0;
  }

  .nav-links {
    flex-direction: column;
    /* Niente padding orizzontale: lo gestiamo voce per voce */
    padding: 1.5rem 0;
    gap: 0;
    align-items: flex-start;
  }

  .nav-item {
    width: 100%;
  }

  .nav-item::after {
    display: none;
  }

  .nav-item>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 1.15rem;
    /* Padding laterale uguale al vecchio padding di nav-links */
    padding: 0.75rem 2rem;
    border-bottom: 1px solid #eaeaea;
  }

  /* Hamburger button */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    padding: 0.25rem;
    flex-shrink: 0;
  }

  /* Lang selector — tuck beside hamburger */
  .lang-selector {
    position: relative;
    order: 2;
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
    gap: 0;
    font-size: 0;
  }

  /* Safe CSS fallback: without JavaScript, show only the active language. */
  .lang-selector > a,
  .lang-selector > .lang-disabled {
    display: none;
  }

  .lang-selector > a.active {
    display: inline-flex;
    align-items: center;
    min-width: 42px;
    min-height: 38px;
    justify-content: center;
    border: 1px solid rgba(33, 33, 33, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
  }

  .lang-selector--compact-ready > a.active {
    display: none;
  }

  .lang-selector--compact-ready .lang-selector__compact {
    display: inline-flex;
  }

  /* Nav container: logo | space | lang | hamburger */
  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }

  /* ── Dropdown mega-menu: mobile (inside slide-in nav) ── */
  .dropdown-menu {
    /* Reset fixed positioning from desktop */
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border-top: 1px solid #e8f0e8 !important;
    padding: 0 !important;
    /* Smooth open via max-height */
    display: block !important;
    max-height: 0;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: max-height 0.35s ease !important;
    pointer-events: auto !important;
    background: #fafcfa !important;
  }

  .dropdown:not(.active) > .dropdown-menu {
    border-top-width: 0 !important;
  }

  .dropdown.active > .dropdown-menu {
    max-height: 1200px;
    border-top-width: 1px !important;
  }

  .dropdown-menu--simple {
    width: 100% !important;
    padding: 0 !important;
    border-top-color: #eaeaea !important;
  }

  .nav-item .dropdown-menu--simple > .dropdown-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 2rem;
    min-height: 48px;
    border-bottom: 1px solid #eaeaea;
    border-radius: 0;
    background: #fafcfa;
    white-space: normal;
  }

  .mega-menu-grid {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    width: 100%;
    overflow: visible;
  }

  .mega-menu-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid #eeeeee;
    padding: 0.75rem 2rem;
    width: 100%;
    max-width: 100%;
    min-height: 64px;
    box-sizing: border-box;
    border-radius: 0;
  }

  .mega-menu-card:last-child {
    border-bottom: none;
  }

  .mega-menu-card:active {
    transform: none;
    box-shadow: none;
    background: #f0f5f0;
  }

  .mega-menu-img {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #eef2ee;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
  }

  .mega-menu-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }

  .mega-menu-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }

  .mega-menu-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.5px;
  }

  /* No truncation — titles can wrap on mobile */
  .mega-menu-info h4 {
    font-size: 0.88rem;
    margin: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    color: var(--secondary);
    line-height: 1.3;
  }

  /* Chevron rotation when dropdown is active */
  .dropdown.active > a .fa-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.25s ease;
  }
}

/* ── Desktop compatti — menu orizzontale con selettore lingua ridotto ── */
@media (min-width: 1241px) and (max-width: 1600px) {
  .nav-container {
    gap: 0.75rem;
  }

  .nav-links {
    gap: 0.85rem;
  }

  .lang-selector {
    position: relative;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    gap: 0;
    font-size: 0;
  }

  .lang-selector > a,
  .lang-selector > .lang-disabled {
    display: none;
  }

  .lang-selector > a.active {
    display: inline-flex;
    align-items: center;
    min-width: 42px;
    min-height: 38px;
    justify-content: center;
    border: 1px solid rgba(33, 33, 33, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
  }

  .lang-selector--compact-ready > a.active {
    display: none;
  }

  .lang-selector--compact-ready .lang-selector__compact {
    display: inline-flex;
  }
}

/* ── 768px — Mobile ── */
@media (max-width: 768px) {

  /* Typography */
  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.4rem;
  }

  /* Spacing */
  .section {
    padding: 3.5rem 0;
  }

  /* Container: less horizontal padding */
  .container {
    padding: 0 1.25rem;
  }

  /* Hero */
  .hero {
    padding-top: 80px;
  }

  .hero h1 {
    font-size: 2.2rem;
    letter-spacing: 0;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-content {
    max-width: 100%;
  }

  /* Hero CTA buttons — wrap on small screens */
  .hero-content>div[style*="display: flex"] {
    flex-wrap: wrap;
  }

  /* Stats */
  .stat-item h4 {
    font-size: 2.2rem;
  }

  /* Grid cards */
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Footer grid — single column */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Footer grid 4-col → 2 on tablet */
  .footer-grid--4col {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer bottom — stack */
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Footer contact list — wrap gracefully */
  .footer-col ul li {
    align-items: flex-start;
  }

  /* Brand logos section */
  .brand-logos-row {
    gap: 1.5rem;
    font-size: 1.1rem;
  }

  /* Page hero (inner pages) */
  .hero[style*="min-height: 50vh"] h1 {
    font-size: 2.2rem !important;
  }
}

/* ── 480px — Small phones (iPhone SE, etc.) ── */
@media (max-width: 480px) {

  /* Typography shrinks further */
  h1 {
    font-size: 1.85rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* Even tighter container */
  .container {
    padding: 0 1rem;
  }

  /* Sections */
  .section {
    padding: 2.5rem 0;
  }

  /* Hero */
  .hero h1 {
    font-size: 1.85rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  /* Buttons — stack vertically on very small screens */
  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  /* Stats grid — 2 columns */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .stat-item h4 {
    font-size: 1.8rem;
  }

  /* Cards */
  .card {
    padding: 1.75rem 1.25rem;
  }

  /* Footer */
  .footer {
    padding: 3rem 0 1.5rem;
  }

  .footer-bottom {
    font-size: 0.8rem;
  }

  /* Nav height reduced */
  .nav-container {
    height: 70px;
  }

  .nav-container > nav {
    top: 70px;
    height: calc(100vh - 70px);
  }

  /* Logo smaller */
  .logo {
    width: clamp(105px, 36vw, 150px);
    height: 40px;
  }

  /* Page hero inner */
  .hero[style*="min-height: 50vh"] h1 {
    font-size: 1.85rem !important;
  }
}

@media (max-width: 320px) {
  .nav-container {
    gap: 0.35rem;
  }

  .container {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .lang-selector__compact {
    min-width: 62px;
  }

  .lang-selector__compact > i {
    margin-left: 0.55rem;
  }

  .lang-selector__select {
    padding-right: 1.45rem;
    padding-left: 0.3rem;
  }

  .lang-selector__compact::after {
    right: 0.55rem;
  }
}

/* ── Page-specific responsive overrides ── */

/* product-grid: minmax troppo largo su mobile */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.product-card-img--contained {
  padding: 1.5rem;
}

.product-card-img.product-card-img--contained img {
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

.product-card:hover .product-card-img.product-card-img--contained img {
  transform: scale(1.03);
}

/* News categories — same visual language as the product overview */
.news-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.news-category-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid #eaeaea;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.news-category-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.news-category-card__image {
  height: 240px;
  overflow: hidden;
  background: var(--bg-alt);
}

.news-category-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-category-card:hover .news-category-card__image img {
  transform: scale(1.05);
}

.news-category-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.75rem;
}

.news-category-card__tag {
  margin-bottom: 0.4rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.news-category-card__content h3 {
  margin-bottom: 0.8rem;
  color: var(--secondary);
}

.news-category-card__content p {
  flex: 1;
  color: var(--text-muted);
}

/* Events and press archive */
.eventi-intro,
.stampa-intro {
  max-width: 720px;
  margin: 0 auto;
}

.eventi-grid,
.stampa-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.evento-card,
.stampa-card {
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  overflow: hidden;
  background: var(--white);
  border: 1px solid #eaeaea;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.evento-card:hover,
.stampa-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.evento-card:focus-visible,
.stampa-card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

.evento-card > img,
.stampa-card > img {
  display: block;
  width: 100%;
  height: 250px;
  box-sizing: border-box;
  border: 3px solid var(--white);
  object-fit: contain;
  background: var(--white);
  transition: transform 0.5s ease;
}

.evento-card:hover > img,
.stampa-card:hover > img { transform: scale(1.04); }

.evento-card__content,
.stampa-card__content { padding: 1.5rem; }
.evento-card__content span,
.stampa-card__content span,
.eventi-progetto__eyebrow {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.evento-card__content h3,
.stampa-card__content h3 { margin: 0.45rem 0 0.55rem; }
.evento-card__content p,
.stampa-card__content p { margin: 0; color: var(--text-muted); }

.eventi-progetto__content { max-width: 900px; margin: 0 auto; }
.eventi-progetto__content h2 { margin: 0.5rem 0 1.25rem; }
.eventi-progetto__content h3 { margin: 2rem 0 0.75rem; }
.eventi-progetto__content p { color: var(--text-muted); }
.eventi-progetto__banner {
  display: block;
  width: 100%;
  margin-top: 2.5rem;
}

.eventi-lightbox,
.stampa-lightbox {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 4.5rem;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

.eventi-lightbox[hidden],
.stampa-lightbox[hidden] { display: none; }
.eventi-lightbox__image,
.stampa-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.eventi-lightbox__close,
.stampa-lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
}
.eventi-lightbox__close:hover,
.eventi-lightbox__close:focus-visible,
.stampa-lightbox__close:hover,
.stampa-lightbox__close:focus-visible { background: var(--primary); }

/* Newsletter archive and reading pages */
.newsletter-intro { max-width: 720px; margin: 0 auto; }
.newsletter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.newsletter-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #eaeaea;
  border-radius: var(--border-radius);
  background: var(--white);
  box-shadow: var(--shadow-md);
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}
.newsletter-card:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.newsletter-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
.newsletter-card > img {
  display: block;
  width: 100%;
  height: 255px;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s ease;
}
.newsletter-card:hover > img { transform: scale(1.04); }
.newsletter-card__content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 1.5rem; }
.newsletter-card__content h3 { margin: 0 0 0.8rem; color: var(--secondary); }
.newsletter-card__content time { color: var(--text-muted); font-size: 0.95rem; }
.newsletter-card__link { margin-top: auto; padding-top: 1.4rem; color: var(--primary); font-weight: 700; }
.newsletter-reading {
  padding: 130px 0 6rem;
  background: var(--white);
}
.newsletter-article__breadcrumb {
  max-width: 880px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
}
.newsletter-article__breadcrumb a { color: var(--secondary); }
.newsletter-article {
  max-width: 880px;
  margin: 0 auto;
  color: var(--text-main);
}
.newsletter-article__back {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 2rem;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.newsletter-article__back:hover { color: var(--secondary); }
.newsletter-article__cover,
.newsletter-article__figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}
.newsletter-article__header {
  max-width: 780px;
  margin: 3rem auto 3.5rem;
  text-align: center;
}
.newsletter-article__category {
  display: block;
  margin-bottom: 1rem;
  color: var(--primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.newsletter-article__header h1 {
  margin-bottom: 1rem;
  color: var(--secondary);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.12;
}
.newsletter-article__header time {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.newsletter-article__lead {
  margin: 2rem auto 0;
  color: var(--secondary);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 500;
  line-height: 1.5;
}
.newsletter-article__body {
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  font-size: 1.08rem;
  line-height: 1.82;
}
.newsletter-article__body p { margin: 0 0 1.5rem; }
.newsletter-article__body h2 {
  margin: 4rem 0 1.4rem;
  color: var(--secondary);
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1.25;
}
.newsletter-article__body ul {
  margin: 0 0 2rem;
  padding-left: 1.35rem;
  list-style: disc;
}
.newsletter-article__body li { margin-bottom: 1rem; padding-left: 0.35rem; }
.newsletter-article__body li::marker { color: var(--primary); }
.newsletter-article__body a { color: var(--primary); font-weight: 700; }
.newsletter-article__figure { margin: 3.5rem 0; }
.newsletter-article__figure--cover { margin: 0; }
.newsletter-article__figure figcaption {
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}
.newsletter-article__cta {
  margin-top: 3rem !important;
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--primary);
  background: var(--bg-alt);
}
.newsletter-article__signature {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 4.5rem;
}

@media (max-width: 992px) {
  .news-category-grid {
    grid-template-columns: 1fr;
  }

  .eventi-grid,
  .stampa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .newsletter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .news-category-card__image {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .newsletter-reading { padding: 105px 0 4rem; }
  .newsletter-article__header { margin: 2.25rem auto 2.75rem; }
  .newsletter-article__body { font-size: 1rem; line-height: 1.72; }
  .newsletter-article__body h2 { margin-top: 3rem; }
  .newsletter-article__signature { margin-top: 3rem; }

  .eventi-grid,
  .stampa-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .newsletter-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .evento-card > img,
  .stampa-card > img { height: 230px; }
  .eventi-lightbox,
  .stampa-lightbox { padding: 1.25rem; }
  .eventi-lightbox__close,
  .stampa-lightbox__close { top: 0.75rem; right: 0.75rem; }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* case-history grid */
  .cases-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* contact form multi-column rows → single column */
  .form-row-2col {
    grid-template-columns: 1fr !important;
  }

  /* contact-info padding ridotto */
  .contact-info-card {
    padding: 2rem 1.5rem;
  }

  /* h1 inline 3.5rem sulle pagine interne — override sicuro */
  h1[style*="font-size: 3.5rem"] {
    font-size: 2.2rem !important;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .cases-grid {
    grid-template-columns: 1fr;
  }

  /* contact card */
  .contact-info-card {
    padding: 1.5rem 1rem;
  }

  h1[style*="font-size: 3.5rem"] {
    font-size: 1.85rem !important;
  }

  /* product card btn full width fix */
  .product-card .btn {
    width: 100%;
    text-align: center;
    align-self: stretch;
  }
}

@media (min-width: 992px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .product-grid > :nth-child(4) {
    grid-column: 1 / span 1;
  }
  .product-grid > :nth-child(5) {
    grid-column: 3 / span 1;
  }
}

/* ── Product Detail Page Layout ── */
.product-detail-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}
.product-detail-images img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-detail-images img.product-detail-image--contained {
  object-fit: contain;
  background: var(--bg-alt);
}

.product-detail-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
}
.product-detail-info-box {
  background: var(--bg-alt);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--primary);
}
.product-detail-info-box h3 {
  color: var(--secondary);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}
.product-detail-info-box ul {
  padding-left: 1.2rem;
}
.product-detail-info-box li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.industrial-sectors {
  margin-bottom: 4rem;
}

.industrial-sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.industrial-sector-card {
  display: grid;
  grid-template-rows: 116px 1fr;
  min-height: 280px;
  background: var(--white);
  border: 1px solid #e0e7e3;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.industrial-sector-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem 0.25rem;
}

.industrial-sector-card__icon img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.industrial-sector-card__content {
  padding: 0.9rem 1.5rem 1.5rem;
  text-align: center;
}

.industrial-sector-card__content h3 {
  margin-bottom: 0.65rem;
  color: var(--secondary);
  font-size: 1rem;
  line-height: 1.3;
  white-space: nowrap;
}

.industrial-sector-card__content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.product-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

@media (max-width: 768px) {
  .product-detail-images,
  .product-detail-info {
    grid-template-columns: 1fr;
  }

  .product-detail-images img.product-detail-image--contained {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .industrial-sector-card {
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .industrial-sector-card__content h3 {
    white-space: normal;
  }
}

/* ── Case History Detail Page Layout ── */
.case-detail-container {
  margin-top: 2rem;
  margin-bottom: 4rem;
}

.case-history-hero {
  min-height: 58vh;
  padding-top: 120px;
  align-items: center;
  overflow: hidden;
  background: var(--secondary);
}

.case-history-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(rgba(20, 20, 20, 0.82), rgba(20, 20, 20, 0.72));
}

.case-history-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.case-history-hero > .container {
  position: relative;
  z-index: 2;
}

.case-history-hero__content {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

.case-history-hero__sector {
  display: inline-block;
  padding: 0.35rem 1rem;
  margin-bottom: 1.15rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.case-history-hero__title {
  max-width: 1050px;
  margin: 0 auto;
  color: var(--white);
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  text-transform: uppercase;
  text-wrap: balance;
}

.case-history-hero__model {
  display: inline-block;
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.case-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
  align-items: start;
}

.case-detail-box {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
}

.case-detail-box--solution {
  border-left-color: var(--secondary);
}

.case-detail-heading {
  color: var(--secondary);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.case-detail-box--solution .case-detail-heading {
  color: var(--primary);
}

.case-detail-box p {
  color: var(--text-main);
  font-size: 1.05rem;
  line-height: 1.8;
}

.case-detail-box p:last-child {
  margin-bottom: 0;
}

.case-detail-list {
  display: grid;
  gap: 0.95rem;
  list-style: none;
}

.case-detail-list li {
  display: grid;
  grid-template-columns: 1rem 1fr;
  gap: 0.75rem;
  color: var(--text-main);
  line-height: 1.6;
}

.case-detail-list i {
  margin-top: 0.35rem;
  color: var(--primary);
  font-size: 0.72rem;
}

.case-detail-benefits {
  background: var(--bg-alt);
  padding: 3rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 4rem;
}

.case-benefit-heading {
  color: var(--secondary);
  margin-bottom: 2rem;
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.case-benefit-heading i {
  color: var(--primary);
}

.case-detail-benefits ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.case-detail-benefits li {
  background: var(--white);
  padding: 1.35rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  line-height: 1.55;
}

.case-detail-benefits li i {
  color: var(--primary);
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.case-gallery__item {
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border: 1px dashed rgba(34, 115, 24, 0.35);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(34, 115, 24, 0.07), rgba(33, 33, 33, 0.04)),
    var(--bg-alt);
}

.case-gallery__item--image {
  border-style: solid;
  background-color: var(--white);
}

.case-gallery__item--image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.case-protected-media {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

.site-protected-media {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.case-gallery__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.case-gallery__placeholder i {
  color: var(--primary);
  font-size: 1.8rem;
  opacity: 0.75;
}

.case-detail-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.case-card__link {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.case-card__link .case-content {
  flex: 1;
}

.case-content h3 {
  text-transform: uppercase;
}

.case-model {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .case-detail-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .case-history-hero {
    min-height: 52vh;
  }

  .case-detail-box,
  .case-detail-benefits {
    padding: 2rem 1.5rem;
  }

  .case-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .cases-grid {
    grid-template-columns: 1fr !important;
  }

  .case-history-hero__title {
    font-size: 2rem;
  }
}

/* ── Download Page Section ── */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.download-card {
  background: rgba(255, 255, 255, 0.05); /* Slight glassmorphism base for dark or light */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.download-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
}

.download-card-img {
  width: 100%;
  height: 220px;
  background: var(--bg-alt); /* using site background to match existing images nicely */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.download-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

.download-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background: var(--white);
}

.download-card-title {
  color: var(--secondary);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.download-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.download-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.download-card-meta i.fa-file-pdf {
  color: #e74c3c; /* standard PDF red icon */
  font-size: 1.2rem;
}

.download-card-action {
  margin-top: auto;
}

.download-card-action .btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
  padding: 0.8rem 1rem;
  border: 0;
  cursor: pointer;
}

.download-request-dialog {
  width: min(560px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 2.5rem;
  overflow-y: auto;
  color: var(--text-main);
  background: var(--white);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.download-request-dialog::backdrop {
  background: rgba(20, 25, 30, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.download-request-dialog__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.download-request-dialog__close:hover,
.download-request-dialog__close:focus-visible {
  color: var(--white);
  background: var(--primary);
}

.download-request-dialog__icon {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--white);
  background: var(--primary);
  border-radius: 50%;
  font-size: 1.35rem;
}

.download-request-dialog h2 {
  margin-bottom: 0.75rem;
  color: var(--secondary);
  font-size: clamp(1.65rem, 4vw, 2.15rem);
}

.download-request-dialog > p {
  margin-bottom: 1.75rem;
  color: var(--text-muted);
}

.download-request-form {
  display: grid;
  gap: 1.25rem;
}

.download-request-form .form-group {
  margin: 0;
}

.download-request-form .form-group > label:first-child {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--secondary);
  font-weight: 600;
}

.download-request-form .form-control {
  width: 100%;
}

.download-request-form small {
  display: block;
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.download-request-form__privacy {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.65rem;
}

.download-request-form__privacy input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  accent-color: var(--primary);
}

.download-request-form__privacy label {
  color: var(--text-muted) !important;
  font-size: 0.88rem;
  font-weight: 400 !important;
}

.download-request-form__privacy a {
  color: var(--primary);
  text-decoration: underline;
}

.download-request-form__submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  cursor: pointer;
}

.download-request-form__status {
  margin: 0;
  padding: 0.85rem 1rem;
  color: #245c34;
  background: #edf8f0;
  border: 1px solid #b9dfc3;
  border-radius: 6px;
  font-size: 0.9rem;
}

.formspree-status {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.formspree-status.is-success,
.download-request-form__status.is-success {
  color: #245c34;
  background: #edf8f0;
  border: 1px solid #b9dfc3;
}

.formspree-status.is-error,
.download-request-form__status.is-error {
  color: #8a1f24;
  background: #fff0f1;
  border: 1px solid #efb9bd;
}

.formspree-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

/* ── Form confirmation pages ── */
.form-thank-you {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  padding: 150px 0 80px;
  background:
    linear-gradient(rgba(17, 17, 17, 0.82), rgba(17, 17, 17, 0.72)),
    url('../images/header-contatti.webp') center / cover no-repeat;
}

.form-thank-you__card {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.form-thank-you__icon {
  width: 5rem;
  height: 5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--white);
  background: var(--primary);
  border-radius: 50%;
  font-size: 2rem;
}

.form-thank-you__messages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 2.25rem;
  overflow: hidden;
  background: #e8e8e8;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
}

.form-thank-you__message {
  padding: 1.5rem;
  text-align: left;
  background: var(--white);
}

.form-thank-you__message:last-child {
  grid-column: 1 / -1;
}

.form-thank-you__language {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-thank-you__message h1,
.form-thank-you__message h2 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.form-thank-you__message p {
  max-width: none;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-thank-you__contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.form-thank-you__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.form-thank-you__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

@media (max-width: 600px) {
  .form-thank-you {
    padding: 120px 1rem 50px;
  }

  .form-thank-you__card {
    padding: 1.5rem;
  }

  .form-thank-you__messages {
    grid-template-columns: 1fr;
  }

  .form-thank-you__message:last-child {
    grid-column: auto;
  }

  .form-thank-you__actions {
    flex-direction: column;
  }

  .form-thank-you__contact {
    padding: 0.7rem 0.85rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  .download-grid {
    grid-template-columns: 1fr;
  }

  .download-request-dialog {
    padding: 2rem 1.25rem 1.5rem;
  }
}

/* ── Legal Pages ── */
.legal-hero {
  min-height: 80vh !important;
  padding-top: 120px;
  align-items: center;
}

.legal-hero .hero-content {
  max-width: 900px;
}

.legal-hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  text-transform: none;
}

.legal-hero p {
  max-width: 760px;
}

.legal-section {
  padding-top: 5rem;
}

.legal-document {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 4rem);
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(33, 33, 33, 0.07);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.legal-document__intro {
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.legal-document__intro p:last-child {
  margin-bottom: 0;
}

.legal-document__kicker {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legal-document__updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.legal-toc {
  margin: 2rem 0 0;
  padding: 1.5rem;
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
}

.legal-toc h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.legal-toc ol {
  columns: 2;
  column-gap: 3rem;
  margin: 0;
  padding-left: 1.25rem;
}

.legal-toc li {
  margin-bottom: 0.5rem;
  break-inside: avoid;
}

.legal-toc a,
.legal-block a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legal-toc a:hover,
.legal-block a:hover {
  color: var(--primary-dark);
}

.legal-block {
  padding-top: 2.5rem;
  scroll-margin-top: 110px;
}

.legal-block + .legal-block {
  margin-top: 2.5rem;
  border-top: 1px solid #e5e7eb;
}

.legal-block h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(1.45rem, 3vw, 1.8rem);
}

.legal-block h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
  font-size: 1.1rem;
}

.legal-block ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.legal-block li {
  margin-bottom: 0.6rem;
}

.legal-table-wrap {
  width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}

.legal-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.legal-table th,
.legal-table td {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: rgba(34, 115, 24, 0.08);
  color: var(--secondary);
  font-size: 0.9rem;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-table code {
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 0.86em;
}

.legal-note {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding: 1.25rem;
  background: rgba(34, 115, 24, 0.07);
  border: 1px solid rgba(34, 115, 24, 0.2);
  border-radius: 10px;
}

.legal-note i {
  flex-shrink: 0;
  padding-top: 0.2rem;
  color: var(--primary);
}

.legal-note p {
  margin: 0;
}

.form-group label a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 768px) {
  .legal-hero {
    min-height: 80vh !important;
    padding-top: 105px;
  }

  .legal-section {
    padding: 3.5rem 0;
  }

  .legal-document {
    padding: 1.5rem;
    border-radius: 12px;
  }

  .legal-toc {
    padding: 1.25rem;
  }

  .legal-toc ol {
    columns: 1;
  }

  .legal-block,
  .legal-block + .legal-block {
    margin-top: 2rem;
    padding-top: 2rem;
  }

  .legal-table th,
  .legal-table td {
    padding: 0.85rem;
    font-size: 0.9rem;
  }
}
