/* Mobile-Optimized Styles for ATOWN Group
   Focusing on Web Vitals and User Experience */

/* Mobile-first media queries */
@media (max-width: 992px) {
    /* General optimizations */
    section {
        padding: 60px 0;
    }

    .container {
        padding: 0 15px;
    }

    /* Header optimizations */
    .main-header .container {
        padding: 10px 15px;
        height: 70px;
    }

    /* Mobile navigation */
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: 0;
        background-color: #fff;
        overflow: hidden;
        transition: all 0.3s ease;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
    }

    .main-nav.active {
        height: auto;
        max-height: calc(100vh - 70px);
        opacity: 1;
        visibility: visible;
        overflow-y: auto;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
    }

    .main-nav ul li {
        width: 100%;
        text-align: center;
    }

    .main-nav ul li a {
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .main-nav ul li:last-child a {
        border-bottom: none;
    }

    /* Show menu toggle on mobile */
    .menu-toggle {
        display: block;
        cursor: pointer;
        font-size: 1.5rem;
        z-index: 1001;
    }

    /* Hero section optimizations */
    .hero-section {
        padding: 40px 0 60px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-content {
        padding-right: 0;
        text-align: center;
        order: 2;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .hero-features {
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-image-container {
        height: auto;
        max-height: 350px;
        order: 1;
    }

    .hero-main-image {
        max-height: 300px;
        object-position: center;
    }

    /* Optimize floating elements for mobile */
    .floating-element {
        display: none;
    }

    /* Only show the most important ones with reduced size */
    .element-1, .element-3 {
        display: flex;
        width: 50px;
        height: 50px;
    }

    .element-1 {
        top: 10%;
        left: 10px;
    }

    .element-3 {
        bottom: 10%;
        right: 10px;
    }

    /* Optimize shapes for mobile */
    .shape-1, .shape-2 {
        opacity: 0.5;
        width: 150px;
        height: 150px;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-feature {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
    }

    .hero-image-container {
        max-height: 250px;
    }

    .hero-main-image {
        max-height: 220px;
    }
}

/* Critical rendering path optimizations */
.main-header {
    will-change: transform;
    contain: layout style;
}

.hero-section {
    contain: content;
}

/* Reduce CLS (Cumulative Layout Shift) */
.hero-image-container {
    aspect-ratio: 16/9;
}

.hero-main-image {
    aspect-ratio: 16/9;
}

/* Improve tap targets for mobile */
.main-nav ul li a, 
.btn-primary,
.menu-toggle {
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .floating-element, 
    .shape,
    .hero-main-image:hover {
        animation: none;
        transition: none;
        transform: none;
    }
}
