/* Mobile-Specific Styles for TrailsXS */

/* Base Mobile Styles */
@media (max-width: 768px) {
    /* General */
    body {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Navigation Mobile */
    .navbar {
        height: 60px;
        padding: 0;
    }
    
    .nav-container {
        height: 60px;
        padding: 0 15px;
    }
    
    .logo {
        height: 80px;
        max-width: 200px;
        top: 15px;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        width: 100%;
        height: calc(100vh - 60px);
        flex-direction: column;
        background: white;
        padding: 30px 20px;
        gap: 0;
        transition: left 0.3s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        display: block;
        padding: 15px 0;
        font-size: 18px;
        border-bottom: 1px solid #e2e8f0;
        width: 100%;
        text-align: left;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-cta {
        margin-top: 20px;
        display: inline-block;
        padding: 12px 30px;
        text-align: center;
        background: #2563eb;
        color: white;
        border-radius: 8px;
    }
    
    /* Hamburger Menu */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 25px;
        height: 20px;
        cursor: pointer;
        z-index: 1001;
    }
    
    .hamburger span {
        display: block;
        height: 3px;
        width: 100%;
        background: #1e293b;
        border-radius: 3px;
        transition: all 0.3s ease;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hero Section Mobile */
    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .hero-cta {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        padding: 16px 30px;
        font-size: 16px;
    }
    
    .hero-features {
        justify-content: center;
        gap: 15px;
        margin-top: 30px;
    }
    
    .feature-badge {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .badge-icon {
        font-size: 16px;
    }
    
    .hero-visual {
        margin-top: 20px;
    }
    
    .device-mockup {
        max-width: 90%;
        margin: 0 auto;
    }
    
    /* Features Section Mobile */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.25rem;
    }
    
    /* Dashboard Section Mobile */
    .vehicle-dashboard {
        padding: 60px 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .telemetry-features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dashboard-mockup {
        padding: 20px;
    }
    
    .large-gauge {
        width: 150px;
        height: 150px;
    }
    
    .large-gauge .gauge-value {
        font-size: 2.5rem;
    }
    
    /* Hardware Control Mobile */
    .hardware-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hardware-item {
        padding: 25px;
    }
    
    /* Security Module Mobile */
    .security-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .security-info h2 {
        font-size: 2rem;
    }
    
    .security-features {
        gap: 20px;
    }
    
    .pin-interface {
        padding: 30px 20px;
    }
    
    .pin-keypad {
        max-width: 220px;
    }
    
    .pin-keypad button {
        padding: 12px;
        font-size: 1rem;
    }
    
    /* Communication System Mobile */
    .comm-features {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .network-diagram {
        padding: 40px 20px;
        min-height: 300px;
    }
    
    .vehicle-node {
        font-size: 0.85rem;
        padding: 10px 15px;
    }
    
    /* Trail Features Mobile */
    .trail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .trail-feature {
        padding: 25px;
    }
    
    /* SOS Features Mobile */
    .sos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sos-header h2 {
        font-size: 2rem;
    }
    
    .sos-feature.primary {
        grid-row: auto;
    }
    
    /* Hardware Store Mobile */
    .store-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .store-item {
        padding: 25px;
    }
    
    .item-price {
        font-size: 1.75rem;
    }
    
    /* Gallery Mobile */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .gallery-item {
        scroll-snap-align: center;
        padding: 15px;
    }
    
    .gallery-item.main {
        grid-column: 1;
    }
    
    /* Showcase Mobile */
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Specs Section Mobile */
    .specs-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .gauge-demo {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
    
    /* Download Section Mobile */
    .download-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .store-button img {
        height: 50px;
    }
    
    .qr-codes {
        flex-direction: column;
        gap: 20px;
    }
    
    .qr-code {
        width: 120px;
        height: 120px;
    }
    
    /* Pricing Section Mobile */
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pricing-card.featured {
        transform: scale(1);
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Section Headers Mobile */
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .feature-badge {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        font-size: 14px;
        padding: 14px 24px;
    }
    
    .feature-card {
        padding: 25px 15px;
    }
    
    .telemetry-item {
        padding: 20px 15px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .nav-link {
        padding: 18px 0;
    }
    
    .btn {
        min-height: 48px;
    }
    
    .pin-keypad button {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Remove hover effects on touch devices */
    .feature-card:hover,
    .hardware-item:hover,
    .trail-feature:hover,
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-caption {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .nav-menu {
        height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .dashboard-grid,
    .security-content,
    .comm-features {
        grid-template-columns: 1fr 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS Safari viewport height */
    .nav-menu {
        height: calc(100vh - 60px - env(safe-area-inset-bottom));
    }
    
    /* Smooth scrolling on iOS */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* Accessibility improvements for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}