/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Estratta dal logo MA.DE. INFISSI ROMA */
    --primary-color: #3E9E72;      /* Verde teal dal logo */
    --primary-dark: #2D7354;       /* Verde teal più scuro */
    --primary-light: #5CB88A;      /* Verde teal più chiaro */
    --secondary-color: #ffffff;    /* Bianco puro */
    --accent-color: #D49414;       /* Oro/Ambra dal logo */
    --accent-secondary: #B07A0E;   /* Oro più scuro */
    --text-primary: #1a1a1a;       /* Nero per testi principali */
    --text-secondary: #4a4a4a;     /* Grigio per testi secondari */
    --text-muted: #6b6b6b;         /* Grigio chiaro per testi muted */
    --white: #ffffff;
    --light-gray: #f8f8f8;
    --border-color: #e8e8e8;
    --shadow-light: 0 1px 3px rgba(62, 158, 114, 0.12);
    --shadow-medium: 0 4px 6px rgba(62, 158, 114, 0.12);
    --shadow-heavy: 0 10px 15px rgba(62, 158, 114, 0.15);
    
    /* Typography */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family-brand: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    --font-size-4xl: 36px;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Borders */
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Base Typography */
html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: -100px;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    z-index: 1000;
    transition: all var(--transition-fast);
    opacity: 0;
}

.skip-link:focus {
    top: 6px;
    left: 6px;
    opacity: 1;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover, a:focus {
    color: var(--primary-dark);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-medium);
    min-height: 48px; /* Touch-friendly size */
}

.btn:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline:hover, .btn-outline:focus {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.btn-full {
    width: 100%;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.header {
    background-color: var(--white);
    box-shadow: var(--shadow-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.navbar {
    padding: var(--spacing-sm) 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    border: none;
    outline: none;
    transition: opacity var(--transition-fast);
}

.navbar-brand .brand-link:hover {
    opacity: 0.75;
}

.navbar-brand .logo {
    height: 70px;
    width: auto;
    border: none !important;
    background: transparent !important;
    outline: none;
    box-shadow: none;
}

.brand-name {
    font-family: var(--font-family-brand);
    font-size: var(--font-size-lg);
    font-weight: 900;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.navbar-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-link {
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    border-radius: var(--border-radius);
}

.nav-link:hover,
.nav-link:focus {
    background-color: var(--primary-light);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-light);
}

.nav-link.active::after,
.nav-link:hover::after {
    display: none;
}

.nav-link.cta-button {
    background-color: var(--accent-color);
    color: var(--white);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 600;
    box-shadow: var(--shadow-light);
}

.nav-link.cta-button:hover {
    background-color: var(--accent-secondary);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.nav-link.cta-button::after {
    display: none;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    gap: 4px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: all var(--transition-medium);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .brand-name {
        font-size: var(--font-size-base);
    }
    
    .navbar-brand .logo {
        height: 50px;
    }
    
    .navbar-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        box-shadow: var(--shadow-medium);
        padding: var(--spacing-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-medium);
    }
    
    .navbar-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        padding: var(--spacing-sm);
        width: 100%;
        text-align: center;
        margin-bottom: var(--spacing-xs);
    }
}

/* ==========================================================================
   Main Content Spacing
   ========================================================================== */

main {
    margin-top: 80px; /* Account for fixed header */
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--light-gray) 100%);
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
}

.hero-title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.hero-subtitle {
    display: block;
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
    font-weight: 400;
    margin-top: var(--spacing-xs);
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.7;
}

.hero-actions {
    display: inline-grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.hero-actions .btn {
    text-align: center;
    white-space: nowrap;
}

.btn-brochure {
    background-color: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}

.btn-brochure:hover,
.btn-brochure:focus {
    background-color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.hero-slideshow {
    position: relative;
}

.slideshow-container {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    contain: layout style paint;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    will-change: opacity;
}

.slide.active {
    opacity: 1;
}

.slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(44, 44, 44, 0.8));
    color: var(--white);
    padding: var(--spacing-xl);
    text-align: left;
}

.slide-overlay h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.slide-overlay p {
    font-size: var(--font-size-base);
    opacity: 0.9;
}

/* Navigation Arrows */
.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(44, 44, 44, 0.7);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-medium);
    z-index: 10;
}

.slideshow-nav:hover {
    background: rgba(44, 44, 44, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.slideshow-nav.prev {
    left: var(--spacing-md);
}

.slideshow-nav.next {
    right: var(--spacing-md);
}

/* Slide Indicators */
.slideshow-indicators {
    position: absolute;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-xs);
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--white);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.indicator.active,
.indicator:hover {
    background: var(--white);
}

@media (max-width: 768px) {
    .hero-section .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-xl);
    }
    
    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
    
    .slideshow-container {
        height: 300px;
    }
    
    .slideshow-nav {
        width: 35px;
        height: 35px;
    }
    
    .slideshow-nav.prev {
        left: var(--spacing-xs);
    }
    
    .slideshow-nav.next {
        right: var(--spacing-xs);
    }
    
    .slide-overlay {
        padding: var(--spacing-md);
    }
    
    .slide-overlay h3 {
        font-size: var(--font-size-lg);
    }
    
    .slide-overlay p {
        font-size: var(--font-size-sm);
    }
}

/* ==========================================================================
   Section Styles
   ========================================================================== */

section {
    padding: var(--spacing-2xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-secondary));
}

.section-description {
    text-align: center;
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Features Section
   ========================================================================== */

.features-section {
    padding: var(--spacing-xl) 0;
}

.features-compact {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    align-items: center;
    margin-top: var(--spacing-lg);
}

.features-image {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.features-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.features-content {
    padding-left: var(--spacing-md);
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-icon {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.feature-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .features-compact {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .features-image {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .features-content {
        padding-left: 0;
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xs);
    }
    
    .feature-icon {
        align-self: center;
    }
}

/* ==========================================================================
   Products Section
   ========================================================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    contain: layout;
}

.product-card {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
    will-change: transform, box-shadow;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.product-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-content {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.product-title {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
    line-height: 1.3;
    min-height: 2.6em; /* Fixed height for titles */
}

.product-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
    flex-grow: 1;
    min-height: 6em; /* Fixed minimum height for descriptions */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-brands {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-sm) 0;
    border-top: 1px solid var(--border-color);
}

.brands-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.brand-logos {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: flex-start;
    align-items: center;
    margin-top: var(--spacing-sm);
}

.product-brands .brand-link {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    width: 120px;
    flex: 0 0 auto;
}

.product-brands .brand-link:hover {
    background-color: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.brand-logo-img {
    max-height: 35px;
    max-width: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.brand-text {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: inherit;
}

/* ==========================================================================
   Company Section
   ========================================================================== */

.company-section {
    background-color: var(--light-gray);
}

.company-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
}

.company-description {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
}

.company-values {
    display: grid;
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

/* Highlight Service Styles */
.highlight-service {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    margin: var(--spacing-xl) 0;
    box-shadow: var(--shadow-medium);
    border-left: 4px solid var(--primary-color);
}

.service-highlight-title {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.service-highlight-description {
    color: var(--text-primary);
    font-size: var(--font-size-base);
    line-height: 1.7;
}

.service-highlight-description strong {
    color: var(--primary-color);
    font-weight: 700;
}

.service-highlight-description em {
    color: var(--primary-dark);
    font-style: normal;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.value-item h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.company-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
}

@media (max-width: 768px) {
    .company-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ==========================================================================
   Services Section
   ========================================================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.service-item {
    text-align: center;
    padding: var(--spacing-xl);
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-medium);
    position: relative;
}

.service-item:hover {
    transform: translateY(-3px);
}

/* Featured Service Styling */
.featured-service {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-heavy);
}

.featured-service:hover {
    transform: translateY(-5px);
}

.service-badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    letter-spacing: 0.5px;
}

.featured-service h3 {
    color: var(--primary-color);
    font-weight: 700;
}

.featured-service p {
    color: var(--text-primary);
    font-weight: 500;
}

.service-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-section {
    background-color: var(--light-gray);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
}

.contact-description {
    margin-bottom: var(--spacing-xl);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.contact-icon {
    font-size: var(--font-size-xl);
    margin-top: 4px;
}

.contact-item h3 {
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
}

/* Social Media Styles */
.social-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.social-section h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-lg);
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-light);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.social-link.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: var(--white);
}

.social-link.facebook {
    background: linear-gradient(135deg, #1877F2, #166FE5);
    color: var(--white);
}

.social-link.instagram {
    background: linear-gradient(135deg, #E4405F, #833AB4);
    color: var(--white);
}

.social-link svg {
    flex-shrink: 0;
}

.social-link span {
    font-size: var(--font-size-sm);
}

@media (max-width: 768px) {
    .social-links {
        flex-direction: column;
    }
    
    .social-link {
        justify-content: center;
        width: 100%;
    }
}

/* ==========================================================================
   Forms
   ========================================================================== */

.contact-form {
    background-color: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
}

.form-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--primary-color);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: border-color var(--transition-fast);
    background-color: var(--white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 44, 44, 0.1);
}

/* Remove default invalid styling - errors handled by JavaScript */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #e53e3e;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
}

.form-checkbox {
    width: auto;
    margin-top: 4px;
}

.checkbox-label {
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.radio-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.radio-fieldset legend {
    padding: 0;
    margin-bottom: var(--spacing-xs);
}

.radio-group {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-radio:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    background-image: radial-gradient(circle, var(--white) 30%, transparent 30%);
}

.form-radio:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.radio-label {
    font-size: var(--font-size-base);
    cursor: pointer;
    color: var(--text-primary);
}

.azienda-field {
    transition: opacity var(--transition-medium);
}

.error-message {
    display: block;
    color: #e53e3e;
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

.form-status {
    text-align: center;
    margin-top: var(--spacing-sm);
    font-weight: 500;
}

.form-status.success {
    color: #38a169;
}

.form-status.error {
    color: #e53e3e;
}

@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .contact-form {
        padding: var(--spacing-md);
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background-color: var(--text-primary);
    color: var(--white);
    padding: var(--spacing-2xl) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-logo-img {
    height: 40px;
    width: auto;
    margin-bottom: var(--spacing-sm);
    filter: brightness(0) invert(1); /* Make logo white */
}

.footer-description {
    color: #a0aec0;
    line-height: 1.6;
}

.footer-title {
    color: var(--white);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-lg);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.footer-links a {
    color: #a0aec0;
    transition: color var(--transition-fast);
}

.footer-links a:hover,
.footer-links a:focus {
    color: var(--white);
}

.footer-contact p {
    color: #a0aec0;
    margin-bottom: var(--spacing-xs);
}

.footer-contact a {
    color: #a0aec0;
}

.footer-contact a:hover,
.footer-contact a:focus {
    color: var(--primary-light);
}

/* Footer Social Media */
.footer-social {
    margin-top: var(--spacing-lg);
}

.footer-social h4 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-base);
}

.footer-social-links {
    display: flex;
    gap: var(--spacing-sm);
}

.footer-social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-medium);
    opacity: 0.8;
}

.footer-social-link:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.footer-social-link.whatsapp {
    background: #25D366;
    color: var(--white);
}

.footer-social-link.facebook {
    background: #1877F2;
    color: var(--white);
}

.footer-social-link.instagram {
    background: linear-gradient(45deg, #E4405F, #833AB4);
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding-top: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-legal {
    display: flex;
    gap: var(--spacing-md);
}

.footer-legal a {
    color: #a0aec0;
    font-size: var(--font-size-sm);
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

/* ==========================================================================
   Animation & Loading States
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: black !important;
        text-shadow: none !important;
        filter: none !important;
    }
    
    .header,
    .footer,
    .hero-actions,
    .contact-form {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.3;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    p, li {
        orphans: 3;
        widows: 3;
    }
}

/* ==========================================================================
   Accessibility Media Queries
   ========================================================================== */

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-img,
    .product-card:hover .product-image img {
        transform: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn,
    .form-input,
    .form-select,
    .form-textarea {
        border-width: 2px;
    }
    
    .feature-card,
    .product-card,
    .service-item {
        border: 2px solid var(--border-color);
    }
}

/* ==========================================================================
   Legal Pages Styles
   ========================================================================== */

.legal-page {
    background-color: var(--light-gray);
    min-height: 100vh;
    padding: var(--spacing-2xl) 0;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    padding: var(--spacing-2xl);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
}

.legal-content h1 {
    color: var(--primary-color);
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-sm);
    text-align: center;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: var(--spacing-md);
}

.last-updated {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: var(--spacing-2xl);
    font-size: var(--font-size-sm);
}

.legal-section {
    margin-bottom: var(--spacing-2xl);
}

.legal-section h2 {
    color: var(--primary-color);
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid var(--accent-color);
    padding-left: var(--spacing-md);
}

.legal-section h3 {
    color: var(--primary-dark);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.legal-section h4 {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

.legal-section p {
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
    text-align: justify;
}

.legal-section ul,
.legal-section ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xl);
}

.legal-section li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.6;
}

.company-info {
    background-color: var(--light-gray);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin: var(--spacing-md) 0;
    border-left: 4px solid var(--accent-color);
}

.company-info p {
    margin-bottom: var(--spacing-xs);
}

.company-info p:last-child {
    margin-bottom: 0;
}

/* Cookie Table Styles */
.cookie-table {
    margin: var(--spacing-lg) 0;
    overflow-x: auto;
}

.cookie-table table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
    box-shadow: var(--shadow-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.cookie-table th,
.cookie-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cookie-table th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookie-table td {
    font-size: var(--font-size-sm);
    vertical-align: top;
}

.cookie-table tr:last-child td {
    border-bottom: none;
}

.cookie-table tr:nth-child(even) {
    background-color: var(--light-gray);
}

/* Browser Instructions */
.browser-instructions {
    background-color: var(--light-gray);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin: var(--spacing-lg) 0;
}

.browser-instructions h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
}

.browser-instructions ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

.browser-instructions ol:last-child {
    margin-bottom: 0;
}

.browser-instructions li {
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

/* Back to Site Button */
.back-to-site {
    text-align: center;
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

/* Legal Pages Mobile Responsiveness */
@media (max-width: 768px) {
    .legal-content {
        margin: var(--spacing-md);
        padding: var(--spacing-lg);
    }
    
    .legal-content h1 {
        font-size: var(--font-size-3xl);
    }
    
    .legal-section h2 {
        font-size: var(--font-size-xl);
    }
    
    .legal-section h3 {
        font-size: var(--font-size-lg);
    }
    
    .cookie-table {
        font-size: var(--font-size-sm);
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .browser-instructions {
        padding: var(--spacing-md);
    }
}

/* ==========================================================================
   Product Modal
   ========================================================================== */

.product-card {
    cursor: pointer;
}

.product-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn 0.25s ease;
}

.product-modal-overlay[hidden] {
    display: none;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.product-modal-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    max-width: 980px;
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
    position: relative;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.product-modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    background: var(--light-gray);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background var(--transition-fast), color var(--transition-fast);
    color: var(--text-secondary);
}

.product-modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.product-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 88vh;
    max-height: 88vh;
    overflow: hidden;
}

.product-modal-info {
    padding: 2.5rem 2rem 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-right: 1px solid var(--border-color);
}

.product-modal-title {
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
    font-weight: 700;
    padding-right: 2rem;
}

.product-modal-description {
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: var(--font-size-base);
    flex: 1;
}

.product-modal-description p {
    margin-bottom: 0.85rem;
}

.product-modal-description ul {
    padding-left: 1.25rem;
    margin-bottom: 0.85rem;
}

.product-modal-description li {
    margin-bottom: 0.4rem;
}

.product-modal-cta {
    align-self: flex-start;
    margin-top: auto;
}

/* Modal Slideshow */
.product-modal-slideshow {
    position: relative;
    overflow: hidden;
    background: #111;
}

.modal-slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.modal-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.modal-slide.active {
    opacity: 1;
    position: relative;
    height: 100%;
}

.modal-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #111;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.82);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background var(--transition-fast);
    color: var(--text-primary);
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 1);
}

.modal-prev { left: 0.75rem; }
.modal-next { right: 0.75rem; }

.modal-indicators {
    position: absolute;
    bottom: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 5;
}

.modal-indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.modal-indicator.active {
    background: var(--white);
}

@media (max-width: 768px) {
    .product-modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: 260px 1fr;
        height: 90vh;
        max-height: 90vh;
    }

    .product-modal-slideshow {
        order: -1;
    }

    .product-modal-info {
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 1.5rem 1.25rem;
    }
}