/* ============================================
   Mobile Layout Fixes
   Comprehensive responsive design improvements
   ============================================ */

/* Hide mobile elements on desktop */
.mobile-cta {
    display: none;
}

/* Body lock when mobile menu is open */
body.body--lock {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-fixed) - 1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-backdrop.active {
    opacity: 1;
}

/* Mobile-First Responsive Improvements */
@media (max-width: 768px) {
    /* Container and Spacing */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }

    /* Hero Section */
    .hero {
        min-height: auto !important;
        padding: 2rem 0 !important;
    }

    .hero-container {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .hero-content {
        padding: 0 !important;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }

    .hero-subtitle {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
        margin: 1.5rem 0 !important;
    }

    .stat-item {
        padding: 0.75rem !important;
    }

    .stat-number {
        font-size: 1.5rem !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
    }

    .hero-cta {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    .hero-cta .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .trust-badges {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-top: 1.5rem !important;
    }

    .badge-item {
        font-size: 0.875rem !important;
        padding: 0.5rem !important;
    }

    /* Hero Visual */
    .hero-visual {
        margin-top: 2rem !important;
        padding: 0 !important;
    }

    .visual-card {
        border-radius: 1rem !important;
    }

    .hero-media-image {
        width: 100% !important;
        height: auto !important;
        border-radius: 1rem !important;
    }

    .media-caption {
        padding: 1rem !important;
        flex-direction: column !important;
        text-align: center !important;
    }

    .media-logo {
        width: 80px !important;
        height: auto !important;
        margin-bottom: 1rem !important;
    }

    /* Navigation */
    .navbar {
        padding: 0.75rem 1rem !important;
    }

    .nav-container {
        padding: 0 !important;
    }

    .logo-image-text {
        max-width: 150px !important;
        height: auto !important;
    }

    .nav-toggle {
        position: relative !important;
        z-index: calc(var(--z-fixed) + 1) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        padding: 0.5rem !important;
    }

    .nav-toggle span {
        display: block !important;
        width: 28px !important;
        height: 3px !important;
        background: var(--color-primary, #2d5016) !important;
        border-radius: 3px !important;
        transition: all 0.3s ease !important;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px) !important;
        background: white !important;
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0 !important;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px) !important;
        background: white !important;
    }

    .nav-backdrop {
        display: block;
    }

    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: var(--gradient-hero) !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 2rem !important;
        transform: translateX(100%) !important;
        transition: transform 0.3s ease !important;
        z-index: var(--z-fixed) !important;
    }

    .nav-menu.active {
        transform: translateX(0) !important;
    }

    .nav-menu li a {
        font-size: 1.5rem !important;
        color: white !important;
    }

    .nav-cta {
        display: none; /* Hidden in mobile, use mobile sticky CTA instead */
    }

    /* Sections */
    section {
        padding: 3rem 0 !important;
    }

    .section-header {
        margin-bottom: 2rem !important;
        text-align: center !important;
    }

    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.25rem) !important;
        margin-bottom: 0.75rem !important;
    }

    .section-subtitle {
        font-size: 0.9375rem !important;
        padding: 0 0.5rem !important;
    }

    /* Mission Section */
    .mission-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .mission-visual {
        order: 1;
    }

    .mission-text {
        order: 2;
    }

    .floating-card {
        display: none !important; /* Remove floating elements on mobile */
    }

    .text-block {
        margin-bottom: 1.5rem !important;
    }

    .text-block h3 {
        font-size: 1.25rem !important;
    }

    .mission-features {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Products Section */
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .product-card {
        max-width: 100% !important;
    }

    .product-features {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    .product-specs {
        grid-template-columns: 1fr !important;
    }

    .product-footer .btn {
        width: 100% !important;
    }

    /* Benefits Section */
    .benefits-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .benefit-card {
        padding: 1.5rem !important;
    }

    .benefit-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.75rem !important;
    }

    .benefit-card h3 {
        font-size: 1.125rem !important;
        margin-bottom: 0.75rem !important;
    }

    .benefit-card p {
        font-size: 0.9375rem !important;
        margin-bottom: 1rem !important;
    }

    .benefit-list {
        font-size: 0.875rem !important;
    }

    /* Testimonials Section */
    .testimonials-slider {
        padding: 0 !important;
    }

    .testimonial-card {
        padding: 1.5rem !important;
    }

    .testimonial-header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 0.75rem !important;
    }

    .avatar {
        width: 50px !important;
        height: 50px !important;
    }

    .testimonial-content p {
        font-size: 0.9375rem !important;
        line-height: 1.6 !important;
    }

    .trust-section {
        margin-top: 2rem !important;
    }

    .trust-metrics {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .metric-value {
        font-size: 1.5rem !important;
    }

    .metric-label {
        font-size: 0.75rem !important;
    }

    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .contact-info {
        order: 2;
    }

    .contact-form-wrapper {
        order: 1;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .info-card {
        padding: 1.25rem !important;
    }

    .social-icons {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    /* CTA Section */
    .cta-section {
        padding: 3rem 1rem !important;
    }

    .cta-content h2 {
        font-size: 1.5rem !important;
    }

    .cta-content p {
        font-size: 0.9375rem !important;
    }

    .cta-buttons {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    .cta-buttons .btn {
        width: 100% !important;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }

    .footer-col {
        padding: 0 !important;
    }

    .footer-social {
        justify-content: center !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
    }

    .footer-badges {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    /* Mobile Sticky CTA */
    .mobile-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
        background: white;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: var(--z-fixed);
        display: block !important;
    }

    .mobile-cta .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        font-weight: 600;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    /* Buttons */
    .btn {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.9375rem !important;
    }

    .btn-large {
        padding: 1rem 2rem !important;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Text Adjustments */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        hyphens: auto;
    }

    p {
        word-wrap: break-word;
    }

    /* Form Elements */
    input, textarea, select {
        font-size: 16px !important; /* Prevent zoom on iOS */
        width: 100%;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .container {
        overflow-x: hidden;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem !important;
    }

    .hero-stats {
        grid-template-columns: 1fr !important;
    }

    .trust-badges {
        grid-template-columns: 1fr !important;
    }

    .trust-metrics {
        grid-template-columns: 1fr !important;
    }

    .section-title {
        font-size: 1.5rem !important;
    }

    .btn {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.875rem !important;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto !important;
        padding: 1.5rem 0 !important;
    }

    .hero-stats,
    .trust-badges {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Touch Target Improvements */
@media (max-width: 768px) {
    a, button, .btn, .nav-link, .social-icon {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-toggle {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
    }
}
