/* For tablets and smaller desktops */
@media (max-width: 992px) {
    .container {
        padding: 60px 30px;
    }

    h1 {
        font-size: 48px;
    }

    h2 {
        font-size: 56px;
    }

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

    .about-text h2 {
        text-align: center;
    }

    .service-item {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .service-item.reverse .scroll-flip-container {
        grid-column: 1 / 2;
    }

    .service-item.reverse .service-text {
        grid-column: 1 / 2;
    }

    .solutions-list {
        columns: 2;
        -webkit-columns: 2;
        -moz-columns: 2;
    }

    .benefits-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-col-1 h2 {
        text-align: center;
    }
}

/* For mobile devices */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden; 
    }
    
    /* --- GENERAL & TYPOGRAPHY --- */
    .container {
        padding: 40px 20px; /* Reduced section padding */
    }

    h1 { font-size: 36px; line-height: 1.2; margin-bottom: 15px; } /* Responsive H1 */
    h2 { font-size: 40px; margin-bottom: 20px; } /* Responsive H2 */
    h3 { font-size: 20px; margin-bottom: 12px; } /* Responsive H3 */
    p { font-size: 16px; }
    .subtitle { font-size: 18px; margin-bottom: 30px; }

      /* --- HEADER & NAVIGATION --- */
    .header-container {
        padding: 10px 20px;
    }
    .logo img { height: 50px; }
    
    .main-nav {
        display: none;
    }

    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        cursor: pointer;
        z-index: 101;
    }

    .hamburger-menu .bar {
        width: 100%;
        height: 3px;
        background-color: var(--color-text-light);
        transition: all 0.3s ease;
    }
    
    /* Hamburger active state */
    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(11px) rotate(45deg);
    }
    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg);
    }
    .hamburger-menu.active .bar {
        background-color: var(--color-text-light); 
    }

    .mobile-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        box-sizing: border-box;
        background-color: var(--color-text); 
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1001;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    }

    .mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
        text-align: center;
    }

    .mobile-nav li {
        margin: 1.5rem 0;
    }

    .mobile-nav.active {
        transform: translateX(0);
    }

    .mobile-nav.active a {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
    }

    .mobile-nav a {
        color: var(--color-text-light);
        text-decoration: none;
        font-size: 2rem;
        margin: 1.5rem 0;
        opacity: 0;
        transform: translateY(20px);
    }

    /* --- HERO SECTION --- */
    #hero {
        min-height: 400px;
        padding: 60px 0;
    }
    .hero-content { padding: 0 20px; }
    .hero-content p { font-size: 16px; }
    .hero-buttons .button { 
        display: block; 
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px; /* Stack buttons */
        text-align: center;
    }

    /* --- POPUP MODAL FIXES --- */
    .modal-content {
        flex-direction: column;
        max-width: 90%; 
    }
    .modal-image {
        width: 100%;
        height: 200px;
    }
    .modal-image img {
        border-radius: 10px 10px 0 0; /* Adjust border radius for stacked image */
    }
    .modal-form {
        width: 100%;
        padding: 30px 20px;
    }
    .close-button {
        color: var(--color-text); /* Ensure good contrast */
    }

    /* --- ABOUT SECTION --- */
    .about-grid {
        gap: 30px;
    }
    .about-text h2 { 
        font-size: 40px;
    }
    .about-images {
        margin-top: 20px;
        grid-template-columns: 1fr; /* Stack images */
    }
    .about-images img {
        height: auto;
    }
    .about-images .image-flip-container:first-child { 
        grid-column: 1 / 2; /* Fix grid column span */
    }

    /* --- SERVICES SECTION FIXES --- */
    .service-item {
        gap: 30px;
        margin-bottom: 60px;
        padding: 20px; /* Reduced item padding */
    }
    .service-item img {
        height: 250px; /* Controlled image height */
    }
    /* Enforce image first, then text in single column layout */
    .scroll-flip-container { order: -1; }
    .service-item.reverse .scroll-flip-container { order: -1; }
    .service-item .service-text,
    .service-item.reverse .service-text {
        order: 1; 
        text-align: center; /* Center text on mobile */
    }

    /* --- SOLUTIONS SECTION --- */
    .solutions-list {
        columns: 1; /* Single column list on mobile */
        padding-left: 0;
        list-style: none; /* Remove list style for cleaner mobile look */
    }
    .solutions-list li {
        margin-bottom: 15px;
        font-size: 18px;
    }

    /* --- BENEFITS SECTION FIXES --- */
    .benefits-grid {
        grid-template-columns: 1fr; /* Single column for benefits */
        gap: 15px;
    }
    .benefit-item {
        grid-column: auto; /* Force single column on mobile */
        grid-row: auto;
        padding: 30px;
        text-align: left;
        font-size: 20px;
    }
    .benefit-icon {
        display: none; /* Hide decorative icons on mobile */
    }

    /* --- TESTIMONIALS SECTION FIXES --- */
    .testimonial-card {
        width: 100%; /* Full width for cards in a slide */
        padding: 30px;
    }
    .slide {
        flex-direction: column; /* Stack testimonials vertically in a slide */
        gap: 20px;
    }
    .slider-btn { 
        width: 40px; 
        height: 40px; 
        font-size: 20px;
    }
    .prev { left: 10px; }
    .next { right: 10px; }
    .slider-wrapper { padding: 0 10px; overflow: hidden; } /* Add padding to wrapper to keep buttons visible and hide overflow */


    /* --- FOOTER STYLES FIXES (Addressing 'complete footer not visible') --- */
    .site-footer {
        padding-top: 40px;
        padding-bottom: 20px;
    }
    .footer-container {
        padding: 0 20px;
    }
    .footer-grid {
        gap: 40px; 
        padding-bottom: 40px;
    }

    .footer-col-1 .footer-logo {
        font-size: 50px; 
        text-align: center;
    }

    .footer-col-1 .contact-info p {
        text-align: center;
    }

    .footer-col-2 h3 {
        font-size: 30px;
        text-align: center;
    }

    .form-group input[type='email'],
    .form-group textarea {
        border-radius: 10px;
    }
    
    .footer-links a,
    .footer-links p {
        text-align: center;
    }

    .footer-bottom {
        margin-top: 20px;
    }

    /* Page Ending Line */
    .page-end-line {
        height: 30px;
    }
    .page-end-line::before {
        content: 'CLEAR VISION. ADVANCED CARE.'; /* Keep full text on mobile */
        font-size: 10px;
        letter-spacing: 3px;
    }
}

/* For smaller mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 36px;
    }

    .subtitle {
        font-size: 16px;
    }

    .hero-content p {
        font-size: 14px;
    }

    .about-text h2 {
        font-size: 36px;
    }

    .service-item img {
        height: 200px;
    }

    .testimonial-card {
        padding: 20px;
    }

    .footer-col-1 .footer-logo {
        font-size: 40px;
    }

    .footer-col-2 h3 {
        font-size: 24px;
    }
}
