/*
 * Mobile Responsive Fixes for MitraKargo
 * Created: 3 Feb 2026
 * Updated: 4 Feb 2026 - Fixed desktop layout issues
 *
 * This file contains responsive CSS fixes for:
 * - Tracking widget spacing
 * - Text padding across all pages
 * - Auto-detect screen sizes
 * - ONLY affects mobile/tablet, NOT desktop layouts
 */


/* ============================================
   BASE MOBILE IMPROVEMENTS
   ============================================ */


/* Better text readability on mobile */
@media (max-width: 640px) {


    /* Container padding - consistent left and right */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }


    /* Fix text alignment - ensure left align on mobile */
    .text-center-mobile-fix {
        text-align: left !important;
    }


    /* Headings - prevent text overflow but keep natural flow */
    h1,
    h2,
    h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: inherit;
    }


    /* Better paragraph spacing and alignment */
    p {
        line-height: 1.6;
        text-align: inherit;
    }


    /* Form elements - larger touch targets */
    input,
    select,
    textarea,
    button {
        min-height: 44px;
        font-size: 16px !important;
        /* Prevents zoom on iOS */
    }
}


/* ============================================
   HERO SECTION TEXT FIX
   ============================================ */


@media (max-width: 640px) {


    /* Ensure hero text is properly aligned and padded */
    section .container>div {
        padding-left: 0;
        padding-right: 0;
    }


    /* Fix hero content alignment */
    .text-white h1,
    .text-white p {
        text-align: left;
        padding-right: 0;
    }
}


/* ============================================
   TRACKING WIDGET SPECIFIC FIXES
   ============================================ */


/* Add bottom margin to tracking widget on mobile */
@media (max-width: 1024px) {
    .tracking-widget {
        margin-bottom: 2rem !important;
    }


    /* Stats section - add more top padding on mobile */
    .stats-section {
        padding-top: 3rem !important;
        margin-top: 0 !important;
    }
}


@media (max-width: 640px) {
    .tracking-widget {
        margin-bottom: 2.5rem !important;
        padding: 1.25rem !important;
    }


    .tracking-widget h3 {
        font-size: 1.125rem !important;
    }


    .stats-section {
        padding-top: 2rem !important;
    }
}


/* ============================================
   SERVICE PAGES - CONSISTENT PADDING
   ============================================ */


@media (max-width: 640px) {


    /* Hero sections on service pages */
    .service-hero {
        padding-top: 5rem !important;
        padding-bottom: 2rem !important;
    }


    .service-hero .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }


    /* Feature grids */
    .feature-grid {
        gap: 1rem !important;
    }


    /* Pricing cards */
    .pricing-card {
        padding: 1.25rem !important;
    }
}


/* ============================================
   FOOTER MOBILE FIXES
   ============================================ */


@media (max-width: 640px) {
    footer .grid {
        gap: 1.5rem !important;
    }


    footer a {
        padding: 0.375rem 0 !important;
        display: block !important;
    }
}


/* ============================================
   NAVIGATION MOBILE FIXES
   ============================================ */


@media (max-width: 768px) {


    /* Mobile nav items should have better touch targets */
    .nav-link {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
    }
}


/* ============================================
   EXTRA SMALL DEVICES (< 375px)
   iPhone SE, older phones, etc.
   ============================================ */


@media (max-width: 375px) {
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }


    h1 {
        font-size: 1.625rem !important;
        line-height: 1.2 !important;
    }


    h2 {
        font-size: 1.375rem !important;
    }


    /* Smaller buttons on tiny screens */
    .btn,
    button[type="submit"] {
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
    }


    /* Tracking widget adjustments */
    .tracking-widget {
        padding: 1rem !important;
    }
}


/* ============================================
   TABLET SPECIFIC (768px - 1024px)
   ONLY adjust spacing, NOT grid layouts
   ============================================ */


@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}


/* ============================================
   LANDSCAPE MODE ADJUSTMENTS
   ============================================ */


@media (max-height: 500px) and (orientation: landscape) {


    /* Reduce vertical spacing in landscape */
    .hero-section,
    .service-hero {
        min-height: auto !important;
        padding-top: 3rem !important;
        padding-bottom: 2rem !important;
    }


    .tracking-widget {
        padding: 1rem !important;
    }
}


/* ============================================
   SAFE AREA INSETS (iPhone X+ notch)
   ============================================ */


@supports (padding: max(0px)) {
    @media (max-width: 640px) {
        .container {
            padding-left: max(1rem, env(safe-area-inset-left)) !important;
            padding-right: max(1rem, env(safe-area-inset-right)) !important;
        }


        footer {
            padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
        }
    }
}


/* ============================================
   GRID FIXES FOR MOBILE ONLY
   ============================================ */


@media (max-width: 640px) {


    /* Ensure grids stack properly on mobile */
    .grid.lg\:grid-cols-2,
    .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }


    /* Fix any overflow issues */
    .overflow-hidden {
        overflow: hidden !important;
    }


    /* Ensure images don't overflow */
    img {
        max-width: 100%;
        height: auto;
    }
}


/* ============================================
   BUTTON FIXES FOR MOBILE
   ============================================ */


@media (max-width: 640px) {


    /* Fix button text wrapping */
    a.inline-flex,
    button.inline-flex {
        white-space: nowrap;
        font-size: 0.875rem !important;
    }


    /* Stack buttons vertically on very small screens */
    .flex.flex-wrap.gap-4 {
        flex-direction: column;
        gap: 0.75rem !important;
    }


    .flex.flex-wrap.gap-4>a,
    .flex.flex-wrap.gap-4>button {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================
   FIX: vertical-align warning for media elements
   ============================================ */


/* Override Tailwind preflight to prevent browser warning */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    /* Remove vertical-align since display:block makes it ineffective */
    vertical-align: unset;
}


/* ============================================
   BUTTON CONSISTENCY - MOBILE ONLY
   ============================================ */


/* Minimum button touch target on mobile devices */
@media (max-width: 768px) {


    a.inline-flex,
    button.inline-flex,
    .btn {
        min-height: 44px;
    }
}


/* ============================================
   CARD GRID - MOBILE ONLY
   ============================================ */


/* Fleet/Feature cards - ensure consistent sizing on small screens */
@media (max-width: 480px) {
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}


/* ============================================
   TEXT SCALING - PREVENT OVERFLOW
   ============================================ */


/* Ensure no horizontal overflow on any screen */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}


/* Heading scaling for extra small screens only */
@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }


    .text-4xl {
        font-size: 1.5rem !important;
    }


    .text-3xl {
        font-size: 1.25rem !important;
    }
}


/* ============================================
   RENTAL OPTIONS CARDS - MOBILE ONLY
   ============================================ */


@media (max-width: 640px) {


    /* Stack rental cards on mobile */
    .sm\:grid-cols-2,
    .md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }


    /* Adjust card padding */
    .p-6.sm\:p-8 {
        padding: 1.25rem !important;
    }
}


/* ============================================
   FEATURES LIST - MOBILE ONLY
   ============================================ */


@media (max-width: 640px) {


    /* Single column on mobile */
    .sm\:grid-cols-2.md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }


    /* Feature cards spacing */
    .flex.items-start.gap-4 {
        gap: 0.75rem !important;
    }


    /* Feature icon size */
    .w-10.h-10 {
        width: 2rem !important;
        height: 2rem !important;
        min-width: 2rem !important;
    }
}



