/* ========== MOBILE RESPONSIVE - GLOBAL FIXES ========== */

/* Tablet Styles (768px - 1024px) */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
    /* === LAYOUT FIXES === */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .app-container {
        overflow-x: hidden;
        width: 100%;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .content-wrapper {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* === SIDEBAR === */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 1001;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .close-sidebar {
        display: block;
    }
    
    .menu-toggle {
        display: block;
    }
    
    /* === HEADER === */
    .top-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    
    .header-search {
        max-width: none;
        flex: 1;
        order: 1;
    }
    
    .menu-toggle {
        order: 0;
    }
    
    .header-actions {
        order: 2;
    }
    
    .emergency-btn span {
        display: inline-block;
    }
    
    /* === ALL GRIDS - Force Stack on Mobile === */
    .services-grid,
    .projects-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    .service-card,
    .project-card {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box;
    }
    
    /* === SERVICE DETAILS (for service pages) === */
    .service-details {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .service-description,
    .service-cta {
        width: 100% !important;
    }
    
    .service-cta {
        position: static !important;
    }
    
    /* === SERVICE HERO === */
    .service-hero {
        padding: 1.5rem;
    }
    
    .service-hero h1 {
        font-size: 1.25rem;
    }
    
    .service-hero p {
        font-size: 0.75rem;
    }
    
    .service-icon-large {
        width: 50px;
        height: 50px;
    }
    
    .service-icon-large i {
        font-size: 1.5rem;
    }
    
    /* === SERVICE DESCRIPTION LIST === */
    .service-description li {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }
    
    .service-description li i {
        font-size: 1rem;
    }
    
    .service-description li strong {
        font-size: 0.8125rem;
    }
    
    .service-description li p {
        font-size: 0.6875rem;
    }
    
    /* === SECTION HEADERS === */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .section-header h2 {
        font-size: 0.9375rem;
    }
    
    .section-header a {
        font-size: 0.6875rem;
    }
    
    .section-subtitle {
        font-size: 0.6875rem;
    }
    
    /* === CARDS === */
    .service-card {
        padding: 1rem;
    }
    
    .service-card h3 {
        font-size: 0.875rem;
    }
    
    .service-card p {
        font-size: 0.75rem;
    }
    
    .service-icon {
        width: 40px;
        height: 40px;
    }
    
    .service-icon i {
        font-size: 1rem;
    }
    
    .service-link {
        font-size: 0.6875rem;
    }
    
    /* === PROJECT CARDS === */
    .project-card {
        width: 100%;
    }
    
    .project-image {
        height: 140px;
    }
    
    .project-image i {
        font-size: 2rem;
    }
    
    .project-card h3 {
        font-size: 0.875rem;
    }
    
    .project-card p {
        font-size: 0.75rem;
    }
    
    .project-link {
        font-size: 0.6875rem;
    }
    
    /* === HERO SECTION === */
    .hero {
        padding: 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.25rem;
    }
    
    .hero p {
        font-size: 0.75rem;
    }
    
    .hero-stats {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .stat h3 {
        font-size: 1.25rem;
    }
    
    .stat p {
        font-size: 0.6875rem;
    }
    
    /* === SERVICE TAGS === */
    .service-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        margin-top: 0.75rem;
        padding-top: 0.5rem;
    }
    
    .service-tags span {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* === CTA BUTTONS === */
    .cta-button {
        font-size: 0.75rem;
        padding: 0.625rem;
    }
    
    .service-cta h3 {
        font-size: 0.875rem;
    }
    
    .service-cta p {
        font-size: 0.6875rem;
    }
    
    /* === TECHNOLOGY STACK (Web Apps Page) === */
    .technology-stack .services-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .technology-stack .service-card {
        text-align: center;
        padding: 0.75rem;
    }
    
    .technology-stack .service-icon {
        margin: 0 auto 0.5rem;
    }
    
    .technology-stack .service-card h3 {
        font-size: 0.7rem;
    }
    
    /* === KEY FEATURES (Web Apps Page) === */
    .key-features .services-grid,
    .common-issues .services-grid,
    .service-highlights .services-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* === FEATURED BADGE === */
    .featured-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.6rem;
    }
    
    /* === SERVICE CATEGORY SPACING === */
    .service-category {
        margin-top: 1.5rem !important;
    }
    
    .service-category.featured {
        margin-top: 0 !important;
    }
    
    /* === CURRENT PROJECTS === */
    .current-projects .projects-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .current-projects .project-card {
        width: 100%;
    }
    
    /* === NO RESULTS === */
    .no-results {
        padding: 2rem;
    }
    
    .no-results i {
        font-size: 1.5rem;
    }
    
    .no-results h3 {
        font-size: 0.875rem;
    }
    
    .no-results p {
        font-size: 0.75rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .content-wrapper {
        padding: 0.75rem;
    }
    
    .service-hero {
        padding: 1rem;
    }
    
    .service-hero h1 {
        font-size: 1.125rem;
    }
    
    .hero h1 {
        font-size: 1.125rem;
    }
    
    .service-card {
        padding: 0.875rem;
    }
    
    .service-card h3 {
        font-size: 0.8125rem;
    }
    
    .service-card p {
        font-size: 0.6875rem;
    }
    
    .section-header h2 {
        font-size: 0.875rem;
    }
    
    .technology-stack .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .technology-stack .service-card h3 {
        font-size: 0.65rem;
    }
    
    .emergency-btn span {
        display: none;
    }
    
    .emergency-btn {
        padding: 0.5rem;
    }
}

/* Landscape Mode Fix */
@media (max-width: 768px) and (orientation: landscape) {
    .services-grid,
    .projects-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 1rem !important;
    }
    
    .service-card,
    .project-card {
        min-width: auto !important;
    }
}