/* --- Mobile Responsive Styles --- */
html,
body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
}

@media (max-width: 1024px) {

    .mission-block,
    .vision-block {
        min-width: 100%;
        padding: 80px 40px;
    }

    .about-grid-revamped {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .about-image-side {
        max-width: 500px;
        margin: 0 auto;
    }

    .nav-links {
        width: 100% !important;
        right: -100% !important;
    }

    .nav-links.active {
        right: 0 !important;
    }
}

@media (max-width: 768px) {

    /* Section Padding */
    .section-padding {
        padding: 40px 0 !important;
    }

    /* Navigation Improvements */
    nav {
        background: rgba(255, 255, 255, 0.95) !important;
        padding: 12px 0 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
        transition: all 0.3s ease !important;
    }

    nav.scrolled {
        background: rgba(255, 255, 255, 0.98) !important;
        padding: 10px 0 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    }

    .logo img {
        height: 82px !important;
        filter: none !important;
        /* Original logo colors - strictly preserved */
    }

    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        z-index: 1001 !important;
        cursor: pointer;
        position: absolute !important;
        right: 20px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    .hamburger i {
        color: var(--primary) !important;
        font-size: 26px !important;
        display: block !important;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        width: 100%;
        height: 100vh;
        background: var(--primary);
        flex-direction: column;
        justify-content: flex-start;
        /* Changed from center to allow top-down scroll space */
        align-items: center;
        transition: 0.4s ease-in-out;
        z-index: 999;
        display: flex;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        /* Enable vertical scroll */
        padding-top: 100px;
        /* Space for logo/hamburger area */
        padding-bottom: 50px;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 20px 0;
    }

    .nav-links a {
        font-size: 20px;
        color: var(--white);
    }

    .nav-btn-cta {
        display: none;
    }

    /* .hamburger {
        display: block;
        z-index: 1000;
        cursor: pointer;
    } */

    .nav-phone {
        display: none;
        /* Hide phone in nav on very small screens or move it into menu */
    }

    /* Hero Section Refinement */
    .hero {
        height: auto;
        padding-top: 80px;
        padding-bottom: 30px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-content h1,
    .hero-content h2,
    .hero-content h3,
    .section-title,
    .page-hero h1 {
        line-height: 1.2 !important;
        margin-bottom: 15px;
    }

    .hero-content p {
        margin-left: auto;
        margin-right: auto;
        font-size: 15px;
        line-height: 1.5;
    }

    .hero-btns {
        justify-content: center;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 10px;
    }

    .hero-btns .btn {
        width: calc(50% - 5px);
        min-width: 140px;
        font-size: 13px;
        padding: 12px 15px;
    }

    .form-card {
        max-width: 100%;
        margin: 0;
        padding: 25px;
    }

    #contactForm {
        grid-template-columns: 1fr;
    }

    .form-group:nth-child(5),
    .btn-block {
        grid-column: span 1;
    }

    /* Component Grids */
    .about-grid,
    .trust-content,
    .capabilities-grid,
    .service-boxes-grid,
    .mission-vision,
    .benefit-grid,
    .blog-cards,
    .form-row,
    .tech-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .trust-stats,
    .cert-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .footer-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2-column grid */
        gap: 30px;
        text-align: left;
    }

    /* Logo/Description spans full width */
    .footer-grid .footer-col:first-child {
        grid-column: span 2;
    }

    /* Quick Links and Services occupy one column each (shared row) */
    .footer-grid .footer-col:nth-child(2),
    .footer-grid .footer-col:nth-child(3) {
        grid-column: span 1;
    }

    /* Contact Info spans full width */
    .footer-grid .footer-col:nth-child(4) {
        grid-column: span 2;
    }

    .footer-col {
        margin-bottom: 10px;
    }

    .about-image {
        height: 300px;
    }

    .about-features {
        justify-items: center;
    }

    .apply-container {
        padding: 40px 20px;
    }

    /* Contact Page Mobile Refinements */
    .contact-page-grid {
        gap: 30px !important;
        text-align: left !important;
    }

    .contact-info-side {
        text-align: left !important;
    }

    .contact-methods-list {
        margin-top: 25px !important;
    }

    .contact-method {
        justify-content: flex-start !important;
        text-align: left !important;
        margin-bottom: 25px !important;
    }

    .contact-method i {
        margin-right: 15px !important;
    }

    .contact-form-container {
        padding: 30px 20px !important;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid #eee !important;
    }

    .contact-form .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .contact-form .form-group label {
        text-align: left !important;
        display: block !important;
        margin-left: 0 !important;
    }

    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        background: #f9f9f9 !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        padding: 12px 15px !important;
        color: var(--primary) !important;
        text-align: left !important;
    }

    .contact-form input::placeholder,
    .contact-form textarea::placeholder {
        color: #999 !important;
    }

    .map-container {
        height: 300px !important;
        margin-top: 30px !important;
    }

    .page-hero {
        padding: 80px 0 40px;
    }

    .page-hero::before {
        display: none !important;
        /* Remove blurry gradient on mobile */
    }

    .page-hero h1 {
        font-size: 28px;
    }

    .service-item-row,
    .service-item-row.reverse {
        flex-direction: column;
        gap: 30px;
        text-align: left;
        margin-bottom: 40px !important;
    }

    /* .section-tag underline alignment fix */
    .section-tag {
        text-align: left !important;
        display: inline-block !important;
        /* Wrap underline to text width */
    }

    .section-tag::after {
        left: 0 !important;
        transform: none !important;
    }

    /* Feature list "Proper Table Way" alignment (Revised flex for robustness) */
    .feature-list li {
        display: flex !important;
        align-items: flex-start !important;
        gap: 15px !important;
        text-align: left !important;
        padding-left: 0 !important;
    }

    .feature-list i {
        flex: 0 0 20px !important;
        margin-top: 5px !important;
        /* Visual vertical center with first line */
        font-size: 16px !important;
    }

    .feature-list li strong {
        display: inline !important;
        margin-right: 5px !important;
    }

    .apply-container {
        grid-template-columns: 1fr;
        padding: 30px;
    }

    .job-card {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .experience-badge {
        position: static;
        margin-top: 20px;
        width: 100%;
        padding: 20px;
    }

    .whatsapp-float {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        right: 20px !important;
        font-size: 24px !important;
    }

    /* Career Page Specific Fixes */
    .apply-info h2 {
        font-size: 24px !important;
        word-wrap: break-word;
    }

    .job-card h3 {
        color: var(--primary) !important;
        font-size: 18px;
    }

    .job-card span {
        color: var(--text-muted) !important;
    }

    .why-career .section-padding {
        padding: 40px 0;
    }

    .openings .section-padding {
        padding: 40px 0;
    }

    .benefit-grid,
    .job-list {
        gap: 20px;
    }

    /* Global heading reductions for mobile typography */
    h1 {
        font-size: 32px !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 26px !important;
        line-height: 1.2 !important;
    }

    h3 {
        font-size: 20px !important;
    }

    h4 {
        font-size: 18px !important;
    }

    h5,
    h6 {
        font-size: 16px !important;
    }

    .hero-content h1,
    .page-hero h1 {
        font-size: 30px !important;
        line-height: 1.2 !important;
        margin-bottom: 12px;
    }

    .section-title {
        font-size: 24px !important;
        line-height: 1.25 !important;
        margin-bottom: 15px;
    }

    /* Fix for truncated cards in user screenshots */
    .trust-stat,
    .cert-item {
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box !important;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 28px;
    }

    .section-tag {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .hero-btns {
        flex-direction: column;
        gap: 0;
    }
}