/* RESPONSIVE DESIGN - MFDEPUR
   Mobile: < 768px | Tablet: 768-991px | Desktop: 992-1199px | Large: ≥1200px */

/* NAVBAR RESPONSIVE */
@media (max-width: 992px) {
    .hamburger {
        display: flex;
    }

    .nav-menu-overlay {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 100px 30px 50px;
        gap: 0;
        transition: var(--transition-normal);
        box-shadow: var(--shadow-xl);
        z-index: 999;
    }

        .nav-menu.active {
            right: 0;
            z-index: 10000;
        }

        .nav-menu li {
            width: 100%;
            margin: 0;
            padding: 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

            .nav-menu li:last-child {
                border-bottom: none;
            }

    .nav-link {
        display: block;
        color: white !important;
        padding: 20px 0;
        font-size: 1.1rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: var(--transition-normal);
        width: 100%;
    }

        .nav-link:hover {
            color: rgba(255, 255, 255, 0.8) !important;
            transform: translateX(10px);
        }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* HERO RESPONSIVE */
@media (max-width: 768px) {
    .hero-section {
        background-attachment: scroll;
    }

    .hero-title {
        font-size: var(--font-size-3xl);
        margin-bottom: var(--spacing-lg);
    }

    .hero-button-contatta {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-base);
    }

    .hero-wrapper {
        padding: 0 var(--spacing-sm);
        text-align: center;
    }
}

/* PRODOTTI RESPONSIVE */
@media (max-width: 768px) {
    .product-section {
        padding: var(--section-padding-mobile);
    }

    .section-title {
        font-size: var(--font-size-4xl);
    }

    .product-image {
        height: 200px;
    }

    .product-content {
        padding: var(--spacing-xl) var(--spacing-md);
    }
}

/* ABOUT RESPONSIVE */
@media (max-width: 768px) {
    .about-section {
        padding: var(--section-padding-mobile);
    }

    .about-content .section-title {
        font-size: var(--font-size-4xl);
    }

    .floating-card {
        position: relative;
        top: 0;
        right: 0;
        margin-top: var(--spacing-md);
        max-width: 100%;
    }

    .main-image {
        height: 300px;
    }

    .stats-row {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .value-item {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .value-icon {
        margin-right: 0;
        margin-bottom: var(--spacing-sm);
    }
}

/* SERVIZI RESPONSIVE */
@media (max-width: 768px) {
    .services-section {
        top: -10px;
        padding: var(--section-padding-mobile);
    }

    .service-header {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .service-features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .advantages-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .services-section .section-title {
        font-size: var(--font-size-4xl);
    }

    .main-service-card {
        padding: var(--spacing-lg);
    }

    .service-card {
        padding: var(--spacing-lg);
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .advantages-row {
        grid-template-columns: 1fr;
    }
}

/* CONTATTI RESPONSIVE */
@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .contact-section {
        padding: 80px 0;
    }

    .contact-form-container,
    .contact-info-container {
        padding: 30px 25px;
        margin-bottom: 30px;
    }

    .contact-section .section-title {
        font-size: 2.2rem;
    }

    .form-header h3 {
        font-size: 1.6rem;
    }

    .info-header h3 {
        font-size: 1.5rem;
    }

    .form-row {
        gap: 15px;
    }

    .info-card {
        padding: 20px;
    }

    .contact-cta {
        padding: 25px 20px;
    }

    .contact-stats-section .row > div {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .contact-stats-section .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* FOOTER RESPONSIVE */
@media (max-width: 992px) {
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal-links {
        justify-content: center;
    }

    .contact-stats-section-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .contact-stats-section-container {
        display: block;
    }
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-md);
    }

    .newsletter-form {
        flex-direction: column;
    }

    .footer-certifications {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-legal-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .footer-section {
        text-align: center;
        margin-bottom: var(--spacing-xl);
    }

    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-contact-info {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .footer-certifications {
        align-items: center;
        justify-content: center;
    }

    .certification-badge {
        font-size: 0.7rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .footer-contact-item {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
}

/* UTILITY RESPONSIVE */

/* Container adjustments for mobile */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Typography scaling */
    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);
    }

    h5 {
        font-size: var(--font-size-lg);
    }

    h6 {
        font-size: var(--font-size-base);
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Further typography scaling for very small screens */
    h1 {
        font-size: 1.9rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    h3 {
        font-size: 1.4rem;
    }
}

/* OTTIMIZZAZIONI MOBILE */

/* Reduce animations on mobile for better performance */
@media (max-width: 768px) {
    *, *::before, *::after {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }

    /* Disable complex animations on low-end devices */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation: none !important;
            transition: none !important;
        }
    }
}

/* ACCESSIBILITÀ */

/* Focus states for better accessibility */
@media (max-width: 768px) {
    .nav-link:focus,
    .btn:focus,
    input:focus,
    textarea:focus,
    select:focus {
        outline: 2px solid var(--primary-200);
        outline-offset: 2px;
    }

    /* Larger touch targets for mobile */
    .btn,
    .nav-link,
    input,
    textarea,
    select {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ORIENTAMENTO LANDSCAPE */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 100vh;
    }

    .navbar {
        padding: 0.5rem 5%;
    }

    .hero-wrapper {
        padding-top: 60px;
    }
}

/* SCHERMI RETINA */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimizations for high DPI displays */
    .hero-section {
        background-size: cover;
    }

    .product-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* STILI STAMPA */
@media print {
    .navbar,
    .hamburger,
    .nav-menu-overlay,
    .hero-button-contatta,
    .footer-social,
    .newsletter-form,
    .emergency-btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
    }

    .hero-section {
        background: none;
        color: #000;
    }

    .section-title {
        color: #000;
        font-size: 18pt;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .footer {
        border-top: 1px solid #000;
        background: none;
        color: #000;
    }
}
