/* Mobile Navigation and Optimization */

/* Hamburger Menu Icon */
.hamburger {
    display: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    z-index: 1001;
    /* Above nav links */
}

/* Base Styles */
/* Ensure html and body don't overflow horizontally */
html,
body {
    overflow-x: hidden;
    width: 100%;
}

/* Ensure images are responsive by default */
img {
    max-width: 100%;
    height: auto;
}

/* Tablet and Mobile Styles */
@media (max-width: 1024px) {

    /* Existing overrides... */
    .hero {
        flex-direction: column;
        text-align: center;
        padding-bottom: 80px;
        /* Ensure height is auto */
        height: auto;
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 50px;
        padding-right: 0;
    }

    .hero h1 {
        font-size: 3rem;
        /* Slightly smaller for tablets */
    }

    .info-cards-wrapper {
        margin-top: 30px;
        /* Reset negative margin */
        grid-template-columns: 1fr;
        /* Stack vertically */
        gap: 20px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        /* Stack vertically */
    }

    .programs-grid {
        gap: 40px;
        /* Reduce gap */
    }

    .why-us-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on tablet */
    }

    .testimonials-grid,
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        /* 2 columns */
    }
}

/* Mobile Specific Styles (Smartphones) */
@media (max-width: 768px) {

    /* Navigation */
    .hamburger {
        display: block;
        /* Show hamburger */
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden initially */
        height: 100vh;
        width: 70%;
        /* Slide in menu width */
        background-color: var(--primary-blue);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    }

    .nav-links.active {
        right: 0;
        /* Slide in */
    }

    .nav-links li {
        margin: 20px 0;
    }

    .nav-links a {
        font-size: 1.2rem;
        /* Larger links for touch */
    }

    /* .btn-nav handled by nav-links visibility now */

    /* Hero Section */
    .hero {
        padding: 40px 5% 60px 5%;
    }

    .hero h1 {
        font-size: 2.2rem;
        /* Mobile friendly size */
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
        max-width: 100%;
        /* Use full width */
    }

    .hero-image-container {
        width: 100%;
        height: auto;
        max-height: 400px;
        /* Limit height */
    }

    /* Show badges on mobile but adjust size and position */
    .badge {
        display: flex;
        padding: 8px 12px;
        min-width: auto;
        font-size: 0.75rem;
        z-index: 20;
    }

    .badge i {
        font-size: 0.9rem;
    }

    .badge.top-right {
        top: 10%;
        right: -5%;
        transform: scale(0.85) rotate(5deg);
    }

    .badge.bottom-left {
        bottom: 10%;
        left: -5%;
        transform: scale(0.85) rotate(-5deg);
    }

    /* Info Cards */
    .info-card {
        padding: 25px;
    }

    /* Services Section */
    .section-header h2 {
        font-size: 2rem;
    }

    .service-card {
        height: auto;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .card-content,
    .card-content.top-left,
    .card-content.bottom-left {
        position: relative;
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
        padding: 25px;
        order: 2;
        /* Ensure content is generally below or controllable */
    }

    /* Adjust order specifically based on card type to match design logic if needed,
       but HTML source order is: 
       Green: Image, Content. Reflow -> Image top, Content bottom.
       Orange: Content, Image. Reflow -> Content top, Image bottom.
       This works naturally without order:2 on all. 
    */

    /* Resetting order logic to rely on source order, but styles need to be clean */
    .service-card .card-content {
        order: unset;
        /* Use source order */
    }

    .card-image-container {
        position: relative;
        width: 100%;
        height: 220px;
        /* Fixed height for image area */
        right: auto;
        top: auto;
    }

    /* Tweaks for specific cards to look good stacked */
    .service-card.green .card-image-container,
    .service-card.blue .card-image-container {
        /* Image first in HTML. Radius bottom-left. */
        /* Maybe adjust radius for mobile stack appearance? */
        border-radius: 0;
        border-bottom-left-radius: 60px;
        /* Smaller curve for mobile */
    }

    .service-card.orange .card-image-container {
        /* Image second in HTML. Radius top-left. */
        border-radius: 0;
        border-top-left-radius: 60px;
    }

    .service-card .arrow-btn,
    .service-card .arrow-btn.top-left,
    .service-card .arrow-btn.bottom-left {
        top: auto !important;
        left: auto !important;
        bottom: 20px !important;
        /* Consistent bottom placement */
        right: 20px !important;
        /* Consistent right placement */
        z-index: 20;
    }

    .service-card {
        position: relative;
        /* Ensure absolute children position relative to this */
    }

    /* Programs */
    .program-item {
        width: 45%;
        /* 2 per row */
        margin-bottom: 20px;
    }

    .programs-grid {
        justify-content: space-around;
        gap: 10px;
    }

    .program-icon-circle {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .program-label {
        font-size: 1rem;
    }

    /* Why Choose Us */
    .why-us-grid {
        grid-template-columns: 1fr;
        /* Stack vertically on mobile */
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
        /* Stack */
    }

    /* Contact */
    .contact-section {
        margin: 40px 10px;
        border-radius: 15px;
    }

    .contact-info,
    .contact-form-wrapper {
        padding: 30px;
    }

    .contact-info h2 {
        font-size: 1.8rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        /* Stack */
        text-align: center;
    }

    .footer-links a {
        justify-content: center;
        /* Center align links */
    }

    .footer-brand p {
        margin: 0 auto 20px auto;
        /* Center paragraph */
    }

    .footer-brand div {
        justify-content: center;
        /* Center social icons */
    }
}

/* Additional Mobile Adjustments */
@media (max-width: 480px) {
    .section-header h2 {
        font-size: 1.8rem;
        /* Smaller headings on very small screens */
    }

    .why-us-header h2,
    .testimonials-header h2 {
        font-size: 1.8rem;
    }

    .hero-bg-props img {
        display: block;
        opacity: 0.1;
        /* Make them subtle */
        width: 30px !important;
        /* Force smaller size */
    }

    .footer-grid {
        gap: 30px;
        text-align: left;
        /* Revert to left align for readability on some layouts, or keep center */
    }

    .footer-links a {
        justify-content: flex-start;
        /* Align left */
    }

    .footer-brand p {
        text-align: left;
    }

    .footer-bottom {
        font-size: 0.8rem;
    }

    /* Adjust arrow button in services */
    .arrow-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
}