/* Mobile & Tablet Responsive Fixes - HireMediaMind */

/* ============================================
   CRITICAL: Prevent Horizontal Scroll
============================================ */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* ============================================
   MOBILE MENU - SIMPLIFIED & FIXED
============================================ */
@media (max-width: 768px) {
    /* Ensure mobile menu button is visible */
    .mobile-menu-button {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 10000;
    }
    
    /* Hide desktop navigation */
    header nav:not(.mobile-menu nav) {
        display: none !important;
    }
    
    /* Mobile menu styling - SIMPLIFIED */
    .mobile-menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: white !important;
        z-index: 9999 !important;
        padding: 2rem !important;
        overflow-y: auto !important;
    }
    
    /* Close button styling */
    .close-mobile-menu {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        cursor: pointer;
        color: #4b5563;
    }
    
    /* Mobile menu links - ENSURED VISIBLE */
    .mobile-menu nav a {
        display: block !important;
        padding: 1rem 0 !important;
        font-size: 1.125rem !important;
        font-weight: 500 !important;
        color: #374151 !important;
        border-bottom: 1px solid #f3f4f6 !important;
        text-decoration: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .mobile-menu nav a:last-child {
        border-bottom: none !important;
    }
    
    /* Mobile menu select */
    .mobile-menu select {
        width: 100% !important;
        padding: 0.75rem !important;
        margin: 1rem 0 !important;
        border: 1px solid #d1d5db !important;
        border-radius: 0.5rem !important;
        background: white !important;
        display: block !important;
    }
    
    /* Ensure header has proper z-index */
    header {
        z-index: 1000 !important;
    }
    
    /* Container padding fix */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Text sizing for mobile */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    p, li, span {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    
    /* Hero section mobile */
    .hero-premium {
        padding-top: 6rem !important;
        padding-bottom: 2rem !important;
        min-height: auto !important;
    }
    
    .hero-title-premium {
        font-size: 2rem !important;
    }
    
    .hero-subtitle-premium {
        font-size: 1.125rem !important;
    }
    
    .hero-cta-group {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .hero-cta-group a {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }
    
    /* Stats grid mobile */
    .hero-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Services grid mobile */
    .service-card,
    #services .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Pricing cards mobile */
    #pricing .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Form mobile */
    #contact form {
        padding: 1.5rem !important;
    }
    
    .input-field {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Buttons mobile */
    button, .btn, a.button {
        width: 100% !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Images responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Tables scroll on mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ============================================
   TABLET: 769px - 1024px
============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    
    .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    h1 {
        font-size: 3rem !important;
    }
    
    h2 {
        font-size: 2.5rem !important;
    }
    
    /* Tablet: 2 column grids */
    #services .grid,
    #pricing .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Hero adjustments */
    .hero-title-premium {
        font-size: 3.5rem !important;
    }
    
    .hero-stats {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ============================================
   SMALL MOBILE: Max 480px
============================================ */
@media (max-width: 480px) {
    
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    /* Extra tight spacing */
    section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Single column everything */
    .grid,
    [class*="grid-cols"] {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   TOUCH-FRIENDLY BUTTONS
============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    button, a, .btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 20px !important;
    }
    
    .mobile-menu-button,
    .close-mobile-menu {
        min-width: 44px;
        min-height: 44px;
    }
    
    .mobile-menu nav a {
        padding: 1.25rem 0 !important;
    }
}

/* ============================================
   PREVENT iOS TEXT SIZE ADJUSTMENT
============================================ */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100%;
    }
}