/* ==========================================
   AZIENDAN METALMECCANICA - STYLES
   Responsive Design - Mobile First
   ========================================== */

/* === PREVENZIONE OVERFLOW ORIZZONTALE === */
html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* === CSS VARIABLES === */
:root {
    /* Colors */
    --primary-color: #00848A;
    --primary-dark: #006468;
    --primary-light: #17a2b8;
    --secondary-color: #2c3e50;
    --secondary-light: #34495e;
    --accent-color: #3498db;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;

    /* Typography */
    --font-primary: 'Lora', serif;
    --font-heading: 'Poppins', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
    margin-bottom: var(--spacing-sm);
}

/* === UTILITIES === */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.section {
    padding: var(--spacing-xl) 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-center {
    text-align: center;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--secondary-color);
}

.btn-white {
    background-color: var(--white);
    color: var(--secondary-color);
}

.btn-white:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-outline-white {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline-white:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* === NAVBAR BASE === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* === LOGO === */
.nav-logo a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.logo-text {
  color: #34495e;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.logo-subtitle {
  color: #00848A;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* === HAMBURGER === */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: #34495e;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* === DESKTOP NAV === */
@media (min-width: 768px) {
  .nav-center {
    display: flex;
    flex: 1;
    justify-content: center;
  }

  .nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
  }
}

/* === MOBILE NAV === */
@media (max-width: 767px) {
  .navbar {
    height: 60px;
  }

  .nav-container {
    display: flex;
    align-items: center; /* Allinea verticalmente tutto */
    justify-content: space-between;
    height: 60px;
    padding: 0 1rem;
    position: relative;
  }

  /* Hamburger a sinistra - allineato */
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .hamburger span {
    width: 24px;
    height: 3px;
    background-color: #34495e;
    border-radius: 2px;
  }

  /* Logo centrato - allineato */
  .nav-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
  }

  .logo-text {
    font-size: 1.1rem;
    line-height: 1;
  }

  .logo-subtitle {
    font-size: 0.6rem;
    line-height: 1;
  }

  /* Icone a destra - allineate */
  .nav-right {
    display: flex;
    align-items: center;
    gap: -4px;
    flex-shrink: 0;
  }

  .nav-contacts {
    display: flex;
    align-items: center;
    gap: -4px;
  }

  .nav-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #34495e;
    padding: 0;
  }

  .nav-contact-item svg {
    width: 20px;
    height: 20px;
  }

  /* Nascondi LinkedIn su mobile */
  .nav-contact-item.linkedin {
    display: none;
  }

  /* Nascondi testo */
  .contact-text {
    display: none;
  }

  /* Nascondi CTA */
  .nav-cta {
    display: none;
  }

  /* Menu slide-in */
  .nav-center {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: #ffffff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 2rem 1rem;
    overflow-y: auto;
    z-index: 999;
  }

  .nav-center.active {
    transform: translateX(0);
  }

  .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (max-width: 380px) {
  /* Su schermi molto piccoli, riduci ulteriormente */
  .logo-text {
    font-size: 1rem;
  }

  .nav-contact-item svg {
    width: 18px;
    height: 18px;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .contact-text {
        display: none;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .nav-menu {
        display: flex;
    }

    .nav-right {
        display: flex;
    }

    .contact-text {
        display: inline;
    }

    .hamburger {
        display: none;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .nav-container {
        gap: 3rem;
    }

    .nav-menu {
        gap: 2.5rem;
    }

    .nav-contacts {
        gap: 1.25rem;
    }
}

/* === HERO SECTION === */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(44,62,80,0.85) 0%, rgba(52,73,94,0.85) 100%);
    background-image: url('img/heroimg.jpg'),
                      linear-gradient(135deg, rgba(44,62,80,0.9) 0%, rgba(52,73,94,0.9) 100%);
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    margin-top: 0;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(44,62,80,0.8) 0%, rgba(52,73,94,0.6) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

.hero-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero-title {
    color: var(--white);
    margin-bottom: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-size: 0.9rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* === STATS SECTION === */
.stats {
    padding: var(--spacing-lg) 0;
    background-color: var(--white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 1.5rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 1rem;
}

/* === SECTION HEADERS === */
.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.section-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(0,132,138,0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.section-title {
    margin-bottom: 1rem;
}

.section-description {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* === SETTORI PREVIEW === */
.settori-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.settore-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.settore-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.settore-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.settore-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.settore-card:hover .settore-image img {
    transform: scale(1.1);
}

.settore-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(44,62,80,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.settore-card:hover .settore-overlay {
    opacity: 1;
}

.settore-content {
    padding: 1.5rem;
}

.settore-content h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.settore-content p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Show buttons in content */
.settore-content .btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

/* Mobile: Show button in content instead of overlay */
@media (max-width: 768px) {
    .settore-overlay {
        display: none;
    }

    .settore-content {
        padding: 1.5rem;
    }

    .settore-content::after {
        content: '';
        display: block;
        margin-top: 1rem;
    }

    .settore-content .btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 1rem;
    }
}

/* === PROCESSO TIMELINE === */
.processo-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto 3rem;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 4px;
    background-color: var(--border-color);
    transform: translateY(-50%);
    border-radius: 2px;
}

.timeline-progress {
    position: absolute;
    top: 50%;
    left: 5%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transform: translateY(-50%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.5s ease;
}

.timeline-steps {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-normal);
    z-index: 2;
}

.step-dot {
    width: 60px;
    height: 60px;
    background-color: var(--white);
    border: 4px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: var(--transition-normal);
    position: relative;
}

.step-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-light);
    transition: var(--transition-normal);
}

.step-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    text-align: center;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.timeline-step:hover .step-dot,
.timeline-step.active .step-dot {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 132, 138, 0.3);
}

.timeline-step:hover .step-num,
.timeline-step.active .step-num {
    color: var(--white);
}

.timeline-step:hover .step-title,
.timeline-step.active .step-title {
    color: var(--primary-color);
}

.timeline-step.completed .step-dot {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.timeline-step.completed .step-num {
    color: var(--white);
}

.processo-details {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    min-height: 400px;
}

.processo-detail {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.processo-detail.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-card {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

.detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.detail-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.detail-card:hover .detail-image img {
    transform: scale(1.05);
}

.detail-content {
    padding: 2rem;
}

.detail-content h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    text-align: center;
}

.detail-content p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 1rem;
    text-align: center;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.detail-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.detail-list li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.detail-list li:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* === CASE STUDIES === */
.case-studies-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.case-study-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.case-study-card:hover {
    box-shadow: var(--shadow-lg);
}

.case-study-card.featured {
    grid-column: 1 / -1;
}

.case-image {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.case-study-card:hover .case-image img {
    transform: scale(1.05);
}

.case-content {
    padding: 2rem;
}

.case-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(0,132,138,0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.case-content h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.case-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.case-link {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.case-link:hover {
    color: var(--primary-dark);
    gap: 0.75rem;
}

/* === CASE STUDY STYLES === */
.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.testimonial {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.testimonial svg {
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.testimonial blockquote {
    font-size: 1.3rem;
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.testimonial-author {
    font-weight: 600;
    color: var(--secondary-color);
}

.testimonial-role {
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* === CLIENTI === */
.clienti {
    padding: var(--spacing-md) 0;
    background-color: var(--bg-light);
}

.clienti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    align-items: center;
    justify-items: center;
}

.cliente-item {
    opacity: 0.6;
    transition: var(--transition-normal);
}

.cliente-item:hover {
    opacity: 1;
    transform: scale(1.05);
}

.cliente-item img {
    max-width: 120px;
    height: auto;
    filter: grayscale(100%);
    transition: var(--transition-normal);
}

.cliente-item:hover img {
    filter: grayscale(0%);
}

/* === CTA SECTION === */
.cta-section {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    text-align: center;
}

.cta-content h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === FOOTER === */
.footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.footer-logo .logo-text {
    color: var(--white);
}

.footer-logo .logo-subtitle {
    color: rgba(255,255,255,0.7);
}

.footer-tagline {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-address {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-contacts li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.7);
}

.footer-contacts svg {
    flex-shrink: 0;
}

.footer-contacts a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}



/* === CASE STUDY HERO SECTION === */
.case-study-hero,
section.hero {
  position: relative;
  min-height: 500px;
  height: 70vh;
  max-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-top: 80px; /* Altezza navbar desktop */
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(44,62,80,0.85) 0%, rgba(52,73,94,0.75) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  text-align: center;
  width: 100%;
  max-width: 1200px;
  padding: 2rem 1rem;
}

.hero-content h1 {
  color: var(--white);
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-lead {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.95);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb span {
  color: rgba(255, 255, 255, 0.6);
}

/* === CASE STUDY CONTENT === */
.case-study-section {
  padding: 3rem 1rem;
}

.case-study-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.challenge-grid,
.solution-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Immagini nei case study */
.case-study-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

/* === FIX OVERFLOW CASE STUDY === */
.case-study-page * {
  box-sizing: border-box;
  max-width: 100%;
}

.case-study-page img {
  max-width: 100%;
  height: auto;
}

.case-study-page .container {
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 100%;
}

/* === SETTORE PAGES === */
.settore-hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 70px;
    background-size: cover;
    background-position: center;
}

.settore-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 100%);
}

.settore-hero .hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    text-align: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumb a {
    color: var(--white);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    opacity: 0.6;
}

.settore-hero h1 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.hero-lead {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    opacity: 0.95;
}

.description-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.description-content h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.description-content h3 {
    color: var(--secondary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.description-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.features-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.features-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    transition: var(--transition-normal);
}

.features-list li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.features-list li:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.description-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-box,
.cta-box {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.info-box h4,
.cta-box h4 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.specs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.specs-list li {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.specs-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.specs-list strong {
    color: var(--secondary-color);
}

.cta-box p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-block + .btn-block {
    margin-top: 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition-normal);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem 1rem 1rem;
    color: var(--white);
}

.gallery-caption {
    font-weight: 600;
    font-size: 1rem;
}

.altri-settori {
    background-color: var(--bg-light);
}

.altri-settori h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.settori-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.settore-link {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition-normal);
}

.settore-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.settore-link.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    pointer-events: none;
}

/* === RESPONSIVE HERO === */
@media (max-width: 767px) {
  .hero {
    height: 100vh;
    min-height: 500px;
    padding-top: 70px;
  }

  .hero-content {
    padding: 1rem;
  }

  .hero-text {
    padding: 0;
  }

  .hero-title {
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  .hero-label {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    margin-bottom: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 60px;
    min-height: 450px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.875rem;
  }
}

/* === RESPONSIVE === */
@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }

    .nav-contacts {
        display: flex;
    }

    .contact-text {
        display: inline;
    }

    .hamburger {
        display: none;
    }

    .hero {
        margin-top: 0;
        padding-top: 80px;
    }

    .case-studies-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .case-study-card.featured {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .case-study-card.featured .case-image {
        height: 100%;
    }

    .settore-hero {
        margin-top: 80px;
        min-height: 500px;
    }

    .description-grid {
        grid-template-columns: 2fr 1fr;
    }
}

@media (max-width: 768px) {
    .processo-timeline {
        padding: 1rem 0;
    }

    .timeline-line,
    .timeline-progress {
        left: 2%;
        right: 2%;
    }

    .timeline-steps {
        padding: 0 2%;
        gap: 0.5rem;
    }

    .step-dot {
        width: 45px;
        height: 45px;
        border-width: 3px;
    }

    .step-num {
        font-size: 1rem;
    }

    .step-title {
        font-size: 0.75rem;
        max-width: 50px;
        white-space: normal;
        line-height: 1.2;
    }

    .detail-card {
        max-width: 100%;
    }

    .detail-image {
        height: 200px;
    }

    .detail-content {
        padding: 1.5rem;
    }

    .detail-content h3 {
        font-size: 1.25rem;
    }

    .detail-content p {
        font-size: 0.95rem;
    }

    .detail-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .step-dot {
        width: 35px;
        height: 35px;
    }

    .step-num {
        font-size: 0.9rem;
    }

    .step-title {
        display: none;
    }

    .timeline-steps {
        gap: 0.25rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .settori-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .settori-grid .settore-card:nth-child(4) {
        grid-column: 1 / 3;
    }

    .settori-grid .settore-card:nth-child(5) {
        grid-column: 3 / 4;
    }
}

/* === COOKIE BANNER === */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background-color: rgba(44, 62, 80, 0.98);
  color: var(--white);
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10000; /* Molto alto per essere sopra tutto */
  transform: translateY(100%);
  transition: transform 0.4s ease-in-out;
  opacity: 0;
  visibility: hidden;
}

.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 280px;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
}

.cookie-banner-text a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
}

.cookie-banner-text a:hover {
  color: var(--primary-light);
}

.cookie-banner-buttons {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* Fix bottoni per mobile */
.cookie-banner-buttons .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  white-space: nowrap;
  min-width: 100px;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cookie-banner-buttons .btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.cookie-banner-buttons .btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.cookie-banner-buttons .btn-secondary {
  background-color: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.cookie-banner-buttons .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
}

/* === RESPONSIVE COOKIE BANNER === */
@media (max-width: 767px) {
  .cookie-banner {
    padding: 1rem;
  }

  .cookie-banner-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .cookie-banner-text {
    min-width: 100%;
  }

  .cookie-banner-text p {
    font-size: 0.85rem;
  }

  .cookie-banner-buttons {
    width: 100%;
    flex-direction: column;
  }

  .cookie-banner-buttons .btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .cookie-banner-text p {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .cookie-banner-buttons .btn {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* === RESPONSIVE CASE STUDY HERO === */
@media (max-width: 767px) {
  .case-study-hero,
  section.hero {
    height: auto;
    min-height: 400px;
    max-height: none;
    margin-top: 60px; /* Altezza navbar mobile */
    padding: 3rem 0;
  }

  .hero-content {
    padding: 2rem 1rem;
  }

  .hero-content h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .hero-lead {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    gap: 0.3rem;
  }
}

@media (max-width: 480px) {
  .case-study-hero,
  section.hero {
    min-height: 350px;
    margin-top: 60px;
    padding: 2.5rem 0;
  }

  .hero-content {
    padding: 1.5rem 1rem;
  }

  .hero-content h1 {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .hero-lead {
    font-size: 0.875rem;
  }

  .breadcrumb {
    font-size: 0.75rem;
  }
}

/* === RESPONSIVE CASE STUDY CONTENT === */
@media (max-width: 767px) {
  .case-study-section {
    padding: 2rem 1rem;
  }

  .challenge-grid,
  .solution-grid,
  .results-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .case-study-card,
  .challenge-card,
  .result-card {
    padding: 1.5rem;
  }
}

/* Related Case Studies */
.related-studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 767px) {
  .related-studies-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* === RESPONSIVE CASE STUDY OVERFLOW FIX === */
@media (max-width: 767px) {
  .case-study-page section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Evita gap eccessivi */
  .case-study-page .grid,
  .case-study-page [class*="grid"] {
    gap: 1rem;
  }
}

/* === NAVBAR HEIGHT CONSISTENCY === */
.navbar {
  height: 80px;
}

@media (max-width: 767px) {
  .navbar {
    height: 60px;
  }
}
