/* Proper Mobile Adaptation - Following Best Practices */

/* Mobile Styles - 768px and below */
@media (max-width: 768px) {
    /* Header - Standard mobile height */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 64px; /* Standard mobile header height */
        background-color: #ffffff;
        z-index: 1000;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
    }
    
    /* Navigation container */
    .nav {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
    }
    
    /* Logo - Properly sized */
    .logo {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 18px;
        font-weight: 700;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    /* Hide desktop button */
    .nav .btn-primary {
        display: none;
    }
    
    /* Mobile menu button */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        padding: 10px;
        margin-right: -10px; /* Compensate padding for edge alignment */
        cursor: pointer;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background-color: #111827;
        transition: all 0.3s ease;
    }
    
    /* Mobile menu */
    .nav-menu {
        position: fixed;
        top: 64px; /* Below header */
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(100vh - 64px); /* Full height minus header */
        background-color: #ffffff;
        display: flex;
        flex-direction: column;
        padding: 24px 16px;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        min-height: 400px; /* Minimum height to ensure visibility */
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    /* Menu items */
    .nav-menu li {
        list-style: none;
        width: 100%;
    }
    
    .nav-menu a {
        display: block;
        padding: 20px 0; /* Increased padding for better touch targets */
        font-size: 18px; /* Slightly larger for better visibility */
        font-weight: 500;
        color: #111827;
        text-decoration: none;
        border-bottom: 1px solid #f3f4f6;
        width: 100%;
    }
    
    .nav-menu li:last-child a {
        border-bottom: none;
    }
    
    /* Mobile CTA button */
    .mobile-menu-cta {
        display: block; /* Changed to block for full width */
        background-color: #ef4444;
        color: white;
        padding: 16px 32px; /* Larger padding */
        border-radius: 6px;
        font-weight: 600;
        text-decoration: none;
        text-align: center;
        margin-top: 32px; /* More space above */
        border: none !important;
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Hamburger animation */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Content spacing */
    body {
        padding-top: 64px; /* Header height */
    }
    
    /* Hero section */
    .hero {
        padding: 48px 0;
    }
    
    .hero-title {
        font-size: 32px;
        line-height: 1.2;
        margin-bottom: 16px;
    }
    
    .hero-description {
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 24px;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 32px;
    }
    
    .hero-feature {
        font-size: 14px;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Buttons - Standard mobile size */
    .btn {
        padding: 14px 24px;
        font-size: 16px;
        width: 100%;
    }
    
    /* Sections */
    section {
        padding: 48px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .section-description {
        font-size: 16px;
    }
    
    /* Cards */
    .metric-card,
    .location-card,
    .pricing-card,
    .testimonial-card {
        padding: 24px;
    }
    
    /* Metrics */
    .metric-value {
        font-size: 36px;
    }
    
    .metric-unit {
        font-size: 20px;
    }
    
    /* Pricing */
    .price-value {
        font-size: 36px;
    }
    
    .pricing-name {
        font-size: 20px;
    }
    
    /* FAQ */
    .faq-question {
        padding: 16px;
        font-size: 16px;
    }
    
    .faq-answer {
        padding: 0 16px 16px;
        font-size: 14px;
    }
    
    /* Footer */
    .footer {
        padding: 48px 0 24px;
    }
    
    /* Grids */
    .metrics-grid,
    .locations-grid,
    .pricing-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Small devices (480px and below) */
@media (max-width: 480px) {
    /* Even more compact for very small screens */
    .hero-title {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .metric-value,
    .price-value {
        font-size: 32px;
    }
}

/* Landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        height: 56px;
    }
    
    body {
        padding-top: 56px;
    }
    
    .nav-menu {
        top: 56px;
    }
    
    .hero {
        padding: 32px 0;
    }
    
    section {
        padding: 32px 0;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects */
    .btn:hover,
    .location-card:hover,
    .pricing-card:hover,
    .testimonial-card:hover,
    .metric-card:hover {
        transform: none;
    }
    
    /* Ensure touch targets are large enough */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Hide mobile-only elements on desktop */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-menu-cta {
        display: none !important;
    }
    
    body {
        padding-top: 0;
    }
}

/* Overlay for mobile menu */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.nav-menu.active ~ .mobile-nav-overlay {
    display: block;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}