/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

/* Top Header - Logistics Page */
.top-header {
    padding: 0.5rem 1rem !important;
}

.top-header-content {
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
}

.contact-info {
    gap: 0.75rem !important;
    font-size: 0.75rem !important;
}

.working-hours {
    display: none !important;
}

/* Screen Reader Only */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================
   MOBILE OPTIMIZATIONS (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        overflow-x: hidden;
        scroll-behavior: smooth;
    }

    .main-header {
        padding: 0.5rem 1rem !important;
    }

    .main-header-content {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .logo {
        height: 40px !important;
        width: auto !important;
    }
    
    .logo-text {
        display: none !important;
    }
    
    .logo-container {
        gap: 0.5rem !important;
        flex-shrink: 1 !important;
    }

    /* ---- Hero Sections ---- */
    .hero-section {
        padding: 2rem 1rem 1.5rem !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    .hero-section > div:not(.hero-slideshow):not(.hero-overlay) {
        position: relative !important;
        z-index: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .hero-section > div > img.hero-logo {
        margin: 0 auto 0.5rem !important;
    }
    
    .hero-logo {
        height: auto !important;
        max-height: 80px !important;
        width: auto !important;
        max-width: 200px !important;
        margin: 0 auto 1.5rem !important;
        object-fit: contain;
    }
    
    .hero-section h1,
    h1 {
        font-size: clamp(1.8rem, 5vw, 2.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
        letter-spacing: -0.02em;
    }
    
    .hero-section p {
        font-size: clamp(1rem, 3vw, 1.2rem) !important;
        line-height: 1.6 !important;
        max-width: 600px;
        margin: 0 auto 1.5rem !important;
        opacity: 0.9;
    }
    
    /* ---- Containers ---- */
    .container {
        padding: 1.5rem 1rem !important;
        max-width: 100% !important;
    }
    
    /* ---- Grid Systems (Single Column) ---- */
    .stats-grid,
    .index-grid,
    .product-grid,
    .blog-grid,
    .testimonial-grid,
    .market-grid,
    .features-grid,
    .services-grid,
    .solutions-grid,
    .steps-grid,
    .team-grid,
    .certifications-grid,
    .documents-grid,
    .routes-grid,
    .partners-grid,
    .tracking-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin: 1.5rem 0 !important;
    }

    /* Gallery grid: 2 columns on mobile (standard) */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    /* ---- Filter Tabs ---- */
    .filter-tabs {
        display: flex !important;
        gap: 0.5rem !important;
        padding: 0.5rem 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    .filter-tabs::-webkit-scrollbar {
        display: none !important;
    }
    
    .filter-tab {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 20px !important;
        background: transparent !important;
        color: white !important;
        white-space: nowrap !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        min-height: 36px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .filter-tab.active {
        background: #ff9800 !important;
        border-color: #ff9800 !important;
        color: #000 !important;
        font-weight: 600 !important;
    }
    
    .filter-tab:active {
        transform: scale(0.95) !important;
    }
    
    /* ---- Cards ---- */
    .stat-card,
    .index-item,
    .product-card,
    .blog-card,
    .testimonial-card,
    .market-card,
    .gallery-item,
    .feature-card,
    .service-card,
    .solution-card,
    .step-card,
    .team-card,
    .certification-card,
    .document-card,
    .route-card {
        padding: 1.5rem !important;
        border-radius: 16px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .stat-card:active,
    .product-card:active,
    .blog-card:active {
        transform: scale(0.98) !important;
    }
    
    .stat-card h2 {
        font-size: clamp(1.5rem, 4vw, 2rem) !important;
        font-weight: 800 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* ---- Section Titles ---- */
    .section-title {
        font-size: clamp(1.4rem, 4vw, 2rem) !important;
        margin: 2.5rem 0 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    /* ---- Images ---- */
    .product-image,
    .blog-card .image,
    .market-card > div:first-child {
        height: 200px !important;
        overflow: hidden;
    }
    
    .product-image img,
    .blog-card .image img,
    .market-card img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .gallery-item img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }
    
    /* ---- Buttons ---- */
    .btn,
    button,
    [type="submit"] {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 48px !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease !important;
        text-decoration: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .btn:active,
    button:active {
        transform: scale(0.96) !important;
    }
    
    /* ---- Forms ---- */
    form div,
    .form-group {
        margin-bottom: 1.25rem !important;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        width: 100% !important;
        min-height: 48px !important;
        padding: 0.875rem 1rem !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        background: rgba(255, 255, 255, 0.05) !important;
        color: white !important;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        -webkit-appearance: none;
        appearance: none;
    }
    
    input:focus,
    select:focus,
    textarea:focus {
        outline: none !important;
        border-color: #ff9800 !important;
        box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.2) !important;
    }
    
    textarea {
        min-height: 120px !important;
        resize: vertical;
    }
    
    /* ---- Tables ---- */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        border-spacing: 0;
    }
    
    /* ---- Footer ---- */
    footer {
        padding: 3rem 1rem 2rem !important;
        margin-top: 4rem !important;
    }
    
    footer > div > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
        text-align: center;
    }
    
    footer > div > div:last-child {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
        gap: 1rem !important;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    footer a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ---- Small Phones (480px and below) ---- */
@media (max-width: 480px) {
    h1, .hero-section h1 {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
    }
    
    .section-title {
        font-size: clamp(1.2rem, 5vw, 1.5rem) !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .hero-section {
        padding: 3rem 1rem 2rem !important;
        min-height: 50vh;
    }
    
    .container {
        padding: 1rem 0.75rem !important;
    }
    
    .stat-card,
    .product-card,
    .blog-card {
        padding: 1.25rem !important;
    }
}

/* ---- Landscape Mode Fix ---- */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: 2rem 1.5rem !important;
    }
    
    nav {
        padding: 0.5rem 1rem !important;
    }
}

/* ---- Accessibility: Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- Dark Mode Support ---- */
@media (prefers-color-scheme: dark) {
    /* Already dark theme - no changes needed */
}

/* ---- Print Styles ---- */
@media print {
    .menu-toggle,
    nav,
    footer,
    .btn,
    .floating-send,
    .nav-backdrop {
        display: none !important;
    }
}
