/* Additional Mobile Fixes */
@media (max-width: 768px) {
    /* Mobile Navigation Improvements */
    .nav-menu {
        align-items: flex-start;
        padding-top: 70px;
    }
    
    .nav-menu li {
        margin: 8px 0;
        padding-left: 30px;
    }
    
    .nav-link {
        text-align: left;
        padding: 12px 25px;
        font-size: 16px;
    }
    
    .mobile-only {
        display: block !important; /* Show on mobile */
        margin-top: 30px;
    }
    
    .mobile-book-btn {
        margin: 10px auto;
    }

    /* Enhanced Testimonials for Mobile */
    .testimonial-carousel-container {
        width: 100% !important; /* Override the 600% width */
        overflow: hidden;
        transition: none !important;
        transform: none !important;
    }
    
    .featured-testimonial {
        position: relative;
        overflow: hidden;
        height: auto !important;
        min-height: 450px;
        max-width: 100% !important;
    }
    
    .testimonial-card {
        width: 100% !important; /* Make each card take full width */
        display: none; /* Hide all cards by default */
        min-height: 420px;
        height: auto !important;
        padding: 25px !important;
        box-sizing: border-box;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
        position: absolute !important;
        left: 0;
        right: 0;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .testimonial-card.active {
        display: block !important; /* Only show active card */
        position: relative !important; /* Establish a stacking context */
        opacity: 1;
        visibility: visible;
        z-index: 5;
    }
    
    /* Ensure the featured testimonial container is positioned relative for navigation */
    .featured-testimonial {
        position: relative;
    }
    
    .testimonial-quote {
        max-height: none;
        overflow-y: visible;
        padding-right: 5px;
        font-size: 15px !important;
        line-height: 1.5 !important;
    }
    
    .testimonial-content {
        height: auto !important;
    }
    
    .treatment-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Enhanced Navigation Controls */
    .testimonial-navigation {
        position: relative;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        margin: 20px 0;
        z-index: 10;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        background: #FF7A00;
        color: white;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
        z-index: 20;
    }
    
    .prev-arrow {
        left: 5px;
        position: absolute;
    }
    
    .next-arrow {
        right: 5px;
        position: absolute;
    }
    
    .nav-arrow:hover, .nav-arrow:active {
        transform: scale(1.1);
        background: #E56600;
    }
    
    .testimonial-dots {
        display: flex;
        gap: 8px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
        background: #ddd;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .dot.active {
        background: #FF7A00;
        transform: scale(1.2);
    }
    
    /* Improve button visibility on various backgrounds */
    .nav-arrow {
        opacity: 0.9;
        z-index: 30;
    }
    
    .nav-arrow:hover {
        opacity: 1;
    }
    
    /* Position the dots below the card */
    .testimonial-dots {
        display: flex;
        justify-content: center;
        margin: 0 auto;
        gap: 8px;
        padding: 0 50px;
    }
    
    /* Make sure gallery has proper positioning */
    .facilities-gallery {
        position: relative;
        padding: 0 10px;
    }
    
    .gallery-container {
        overflow: hidden;
        position: relative;
    }
    
    .gallery-main {
        width: 100%;
        margin: 0 auto;
    }
    
    /* Gallery Navigation Button Positioning */
    .gallery-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        background: rgba(255, 255, 255, 0.9);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .prev-nav {
        left: 10px;
    }
    
    .next-nav {
        right: 10px;
    }
    
    /* Ensure gallery images and videos are consistently sized */
    .gallery-slide img,
    .gallery-slide video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    /* Video overlay improvements */
    #galleryVideoOverlay {
        z-index: 5;
    }
    
    #galleryPlayButton {
        z-index: 10;
    }
    
    /* Footer improvements */
    .footer-section {
        padding: 0 15px;
    }
    
    .footer-section ul {
        list-style-type: none;
        padding: 0;
        margin: 0 auto;
        max-width: 80%;
    }
    
    /* Improve spacing in footer content */
    .footer-logo img {
        display: block;
        margin: 0 auto;
    }
    
    .footer-section .footer-text {
        margin-left: auto;
        margin-right: auto;
        max-width: 90%;
    }
    
    .contact-info a {
        display: inline-block;
        margin: 0 auto;
    }
    
    /* Contact section improvements */
    .contact-container {
        flex-direction: column;
    }
    
    .contact-form,
    .contact-info {
        width: 100%;
    }
    
    .info-items {
        justify-content: center;
    }
}

/* Additional small phone fixes */
@media (max-width: 480px) {
    .testimonial-card {
        padding: 20px !important;
        min-height: 400px;
        height: auto !important;
    }
    
    .google-badge {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .rating-circle {
        width: 50px;
        height: 50px;
        font-size: 20px;
        min-width: 50px;
    }
    
    /* Enhanced Navigation Controls for small devices */
    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
        min-width: 36px;
    }
    
    .testimonial-dots {
        margin: 10px auto;
    }
    
    /* Adjust testimonial content for small screens */
    .testimonial-quote {
        font-size: 14px !important;
        line-height: 1.5 !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    .patient-name {
        font-size: 16px;
    }
    
    .treatment-tag {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .detail-item {
        padding: 10px;
    }
    
    .detail-label {
        font-size: 10px;
    }
    
    .detail-value {
        font-size: 12px;
    }
    
    .patient-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .featured-testimonial {
        min-height: 500px;
    }
    
    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .gallery-dots {
        margin-top: 15px;
    }
    
    .gallery-slide {
        height: 250px;
    }
    
    .gallery-slide img,
    .gallery-slide video {
        height: 250px;
    }
    
    /* Make the mobile book button more prominent */
    .mobile-book-btn {
        width: 90%;
        font-size: 14px;
        padding: 12px 15px;
    }
    
    /* Keep desktop book appointment button visible and styled properly */
    .header-book-btn {
        padding: 7px 12px;
        font-size: 11px;
        margin-right: 45px;
        background: #f97316;
        color: white;
        border: none;
        border-radius: 8px;
    }
}