:root {
    --primary-color: #007bff;
    /* Medical Blue */
    --secondary-color: #28a745;
    /* Medical Green */
    --accent-color: #17a2b8;
    /* Cyan */
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #333;
    --white: #ffffff;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--dark-color);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.section-title p {
    color: #666;
    max-width: 600px;
    margin: 15px auto 0;
}

/* Header & Nav */
.header {
    background: var(--white);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

.header.sticky {
    padding: 10px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 60px;
    text-decoration: none;
    flex-shrink: 0 !important;
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
    flex-shrink: 0 !important;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    white-space: nowrap !important;
}

.logo span strong {
    color: var(--secondary-color);
}


.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--dark-color);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.btn-nav {
    padding: 10px 25px !important;
    background: var(--secondary-color) !important;
    color: white !important;
    border-radius: 25px;
}

.btn-nav:hover {
    background: #218838 !important;
    color: white !important;
}

.btn-nav::after {
    display: none;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Slider */
.hero-slider {
    height: 92vh;
    max-height: 750px;
    min-height: 500px;
    width: 100%;
    position: relative;
    margin-top: 80px; /* Push below the fixed header */
}

/* Swiper Styles */
.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide-inner {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}

/* Slider Overlay Modification */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient instead of solid dark color for better visibility */
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.1));
    z-index: 1;
}

.hero-slider .overlay {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.02));
}

.slide-content {
    position: relative;
    /* Above overlay */
    z-index: 2;
    text-align: left;
    color: #fff;
    max-width: 800px;
}

.slide-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    /* Stronger text shadow for readability */
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 250px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    transition: bottom 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    bottom: 0;
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.slide-btns {
    display: flex;
    gap: 20px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* Welcome Section */
.welcome-section {
    padding-top: 100px;
    /* Space for content below 100vh hero */
    background: #fff;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: #fff;
    padding: 60px 0 20px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 40px;
}

.footer h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer p,
.footer li {
    color: #aaa;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer a {
    color: #aaa;
}

.footer a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.footer i {
    color: var(--secondary-color);
    margin-right: 10px;
    width: 20px;
}

.copyright {
    text-align: center;
    color: #777;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: auto;
        padding: 40px 0;
        background: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        transition: var(--transition);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-bottom: 4px solid var(--primary-color);
    }

    .nav-links.active {
        left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-align: center;
    border-bottom: 3px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid var(--secondary-color);
}

.service-card .icon {
    width: 70px;
    height: 70px;
    background: #e6f7ff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
    font-size: 1.8rem;
    transition: var(--transition);
}

.service-card:hover .icon {
    background: var(--primary-color);
    color: var(--white);
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.service-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    color: var(--secondary-color);
}

/* Why Choose Us / Stats */
.why-choose-us {
    position: relative;
    z-index: 1;
}

.stat-item {
    flex: 1;
    min-width: 200px;
}

/* Page Header */
.page-header {
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: 80px;
    /* Offset for fixed header */
}

.page-header .container {
    position: relative;
    z-index: 2;
    color: white;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: white;
}

.page-header p {
    font-size: 1.2rem;
    color: #f0f0f0;
}

/* Doctor Card */
.doctor-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-align: center;
}

.doctor-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.doctor-img {
    height: 450px;
    position: relative;
    overflow: hidden;
}

.doctor-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.doctor-card:hover .doctor-img img {
    transform: scale(1.1);
}

.social-links {
    position: absolute;
    bottom: -50px;
    /* Hidden initially */
    left: 0;
    width: 100%;
    padding: 10px 0;
    background: rgba(40, 167, 69, 0.9);
    /* Green overlay */
    display: flex;
    justify-content: center;
    gap: 15px;
    transition: bottom 0.3s ease;
}

.doctor-card:hover .social-links {
    bottom: 0;
}

.social-links a {
    color: white;
    font-size: 1.1rem;
}

.social-links a:hover {
    color: var(--dark-color);
}

.doctor-info {
    padding: 25px;
}

.doctor-info h3 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.doctor-info span {
    display: block;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.doctor-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    min-height: 40px;
    /* Align buttons */
}

.btn-sm {
    display: inline-block;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-sm:hover {
    background: var(--primary-color);
    color: white;
    transform: none;
    /* Reset base btn transform if unwanted */
}

/* Contact Form */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea.form-control {
    resize: none;
}

/* Hover Overlay Animation Styles */
.hover-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.hover-wrapper img {
    transition: transform 0.6s ease;
}

.hover-wrapper:hover img {
    transform: scale(1.1);
}

.hover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 30px 20px;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.hover-wrapper:hover .hover-overlay {
    opacity: 1;
}

.hover-overlay h4 {
    color: #fff;
    font-size: 1.1rem;
    transform: translateY(20px);
    transition: all 0.4s ease;
    margin: 0;
    text-align: center;
}

.hover-wrapper:hover .hover-overlay h4 {
    transform: translateY(0);
}

/* Floating Buttons */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}

.float-btn:hover {
    transform: scale(1.1);
}

.map-btn {
    background-color: #4285F4;
    /* Google Maps Blue */
    animation-delay: 0.1s;
}

.whatsapp-btn {
    background-color: #25D366;
    /* WhatsApp Green */
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }

    .float-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* Navigation Container Right & Language Switcher styling */
.nav-container-right {
    display: flex;
    align-items: center;
    gap: 25px;
    height: 100%;
}

.lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #28a745, #218838);
    color: var(--white);
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
    transition: var(--transition);
    outline: none;
    user-select: none;
}

.lang-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.35);
    background: linear-gradient(135deg, #218838, #1e7e34);
}

.lang-toggle-btn i {
    font-size: 0.95rem;
}

/* Adjustments for mobile view */
@media (max-width: 1200px) {
    .nav-container-right {
        gap: 15px;
    }
    
    .lang-toggle-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 6px;
    }
}

/* ==========================================
   Certificates Page Styling & Protection
   ========================================== */

.certificates-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.certificates-intro p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.08);
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.certificate-card-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificate-card-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.certificate-container {
    position: relative;
    width: 100%;
    background: #111;
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

/* This transparent overlay sits on top of the canvas, preventing right-clicks and selection */
.certificate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: transparent;
    pointer-events: auto; /* It intercepts all clicks/drags */
}

.certificate-canvas {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none; /* Pointer events are handled by the overlay and forwarded or read on overlay coordinates */
    transition: filter 0.3s ease;
}

.certificate-info {
    padding: 20px;
    border-top: 1px solid #f1f1f1;
}

.certificate-info h3 {
    font-size: 1.15rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.certificate-info p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Instructions badge */
.view-instruction {
    display: block;
    text-align: center;
    background: #f8f9fa;
    color: #6c757d;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    border-top: 1px dashed #e2e8f0;
}

.view-instruction i {
    margin-right: 5px;
    color: var(--accent-color);
}

/* Print Protection */
@media print {
    body, html, main, header, footer, .floating-buttons {
        display: none !important;
    }
}

/* Layout Responsiveness & Stacking Rules */
@media (max-width: 992px) {
    .slide-content h1 {
        font-size: 2.5rem;
    }
    .slide-content p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    /* Logo adjustments for mobile */
    .logo {
        height: 45px;
        gap: 8px;
        flex-shrink: 0 !important;
    }
    .logo span {
        font-size: 1.15rem;
        white-space: nowrap !important;
    }

    /* General Row & Column Stacking - overrides inline flex styles */
    .row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 30px !important;
    }
    
    .col-half {
        width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    /* Slide Content adjustments */
    .slide-content h1 {
        font-size: 2rem;
    }
    .slide-content p {
        font-size: 1rem;
    }
    .slide-btns {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }
    .slide-btns .btn {
        padding: 10px 22px;
        font-size: 0.9rem;
    }
    
    /* Section padding */
    .section-padding {
        padding: 50px 0;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }

    /* Slider mobile height */
    .hero-slider {
        height: 70vh;
        max-height: 560px;
        min-height: 400px;
    }

    .slide-content {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    /* Adjust spacing on small screens */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Extra small mobile: tighter slider */
    .hero-slider {
        height: 65vh;
        max-height: 500px;
        min-height: 360px;
    }

    .slide-content h1 {
        font-size: 1.7rem;
        line-height: 1.3;
    }

    .slide-content p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
}

/* Our Specialized Services Section */
.specialized-services-section {
    background-color: #f8f9fa;
}

.specialized-section-title h2::after {
    background: linear-gradient(to right, #28a745 50%, #dc3545 50%) !important;
}

.specialized-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin: 50px auto 0;
}

.specialized-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.specialized-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.specialized-card.anesthesiology-card {
    border-top: 4px solid #28a745;
}

.specialized-card.emergency-card {
    border-top: 4px solid #dc3545;
}

.specialized-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    margin-bottom: 25px;
    transition: var(--transition);
}

.anesthesiology-icon {
    background: #eafaf1;
    color: #28a745;
}

.emergency-icon {
    background: #fdf2f2;
    color: #dc3545;
}

.specialized-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 15px;
}

.specialized-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

@media (max-width: 768px) {
    .specialized-services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .specialized-card {
        padding: 30px 20px;
    }
}

/* Obsolete mobile header overrides removed */

/* ===================================================
   COMPREHENSIVE RESPONSIVE IMPROVEMENTS
   =================================================== */

/* --- Mobile Nav Links Dropdown --- */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 10px 0 20px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.12);
        z-index: 999;
        border-top: 2px solid var(--primary-color);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px 25px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 1rem;
    }

    .nav-links a::after {
        display: none;
    }

    .btn-nav {
        display: block !important;
        margin: 10px 20px !important;
        text-align: center !important;
        border-radius: 8px !important;
    }

    .mobile-menu-btn.active i::before {
        content: "\f00d"; /* fa-times */
    }
}

/* --- Footer Grid --- */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .footer-col h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
}

/* --- Doctor Cards --- */
@media (max-width: 768px) {
    .doctors-grid {
        grid-template-columns: 1fr !important;
    }

    .doctor-card {
        max-width: 380px;
        margin: 0 auto;
    }
}

/* --- Services Grid --- */
@media (max-width: 576px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Our Branches Section --- */
@media (max-width: 768px) {
    .branches-grid {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }
}

/* --- Specialized Services --- */
@media (max-width: 576px) {
    .specialized-services-grid {
        grid-template-columns: 1fr !important;
    }

    .specialized-card {
        padding: 25px 18px !important;
    }
}

/* --- Section Titles for Small Screens --- */
@media (max-width: 480px) {
    .section-title h2 {
        font-size: 1.5rem !important;
    }

    .section-title p {
        font-size: 0.9rem !important;
    }

    .section-padding {
        padding: 40px 0 !important;
    }

    /* Stats counter on very small */
    .stat-item h2 {
        font-size: 2rem !important;
    }
}

/* --- Row / Col-Half Stacking --- */
@media (max-width: 768px) {
    .row[style*="flex"] {
        flex-direction: column !important;
    }

    /* Override inline flex-direction: row-reverse on mobile */
    .row[style*="row-reverse"] {
        flex-direction: column !important;
    }

    .col-half {
        min-width: 100% !important;
        width: 100% !important;
    }
}

/* --- Gallery Grid --- */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
    }

    .gallery-item {
        height: 200px !important;
    }
}

/* --- Hero Slider on very narrow --- */
@media (max-width: 360px) {
    .slide-content h1 {
        font-size: 1.4rem !important;
    }

    .slide-content p {
        font-size: 0.85rem !important;
    }

    .slide-btns .btn {
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
    }
}

/* --- Floating Buttons Spacing --- */
@media (max-width: 480px) {
    .floating-buttons {
        bottom: 15px !important;
        right: 12px !important;
        gap: 10px !important;
    }

    .float-btn {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.2rem !important;
    }
}

/* --- Map iFrame Responsive --- */
@media (max-width: 768px) {
    iframe[src*="maps"] {
        height: 280px !important;
    }
}



/* ==========================================
   Navigation Dropdown Menu Styles
   ========================================== */

/* Dropdown Navigation Base Styles */
.nav-links li {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 12px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border-top: 3px solid var(--primary-color);
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
    color: var(--dark-color) !important;
    transition: var(--transition) !important;
    border-bottom: none !important;
    font-weight: 500 !important;
}

.dropdown-menu a:hover {
    background: var(--light-color) !important;
    color: var(--primary-color) !important;
    padding-left: 25px !important;
}

/* Show Dropdown on Hover (Desktop only) */
@media (min-width: 1201px) {
    .nav-links li.dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile Dropdown Styling override */
@media (max-width: 1200px) {
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 5px 0 10px 25px !important;
        background: #fdfdfd !important;
        border-top: none !important;
        min-width: 100% !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .dropdown-menu.active {
        display: block !important;
    }
    
    .dropdown-toggle.active i {
        transform: rotate(180deg) !important;
    }
}

/* ==========================================
   Mobile Responsiveness Overrides
   ========================================== */

/* Disable inline min-width constraints on columns in mobile screens to prevent overflow */
@media (max-width: 768px) {
    .col-half {
        min-width: 0 !important;
        width: 100% !important;
        flex: 1 1 100% !important;
    }
}

/* Force Swiper container to clip slider animations and prevent horizontal scroll stretching */
.swiper {
    overflow: hidden !important;
}

/* ===================================================
   CRITICAL GLOBAL MOBILE OVERFLOW & RESPONSIVENESS FIXES
   =================================================== */

/* Prevent horizontal scroll / overflow at viewport boundary */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
}

/* Enforce containment on layout container elements */
.container {
    width: 100% !important;
    max-width: 1200px;
    box-sizing: border-box !important;
}

/* Enforce layout boundaries on all slider and grid container blocks */
.swiper,
.hero-slider,
.page-header,
.gallery-grid,
.services-grid,
.specialized-services-grid,
.certificates-grid,
.doctors-grid,
.branches-grid {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Override all grid template columns on mobile viewports to prevent overflow */
@media (max-width: 768px) {
    /* Auto-collapse any element with inline grid display */
    div[style*="display: grid"],
    .row[style*="display: grid"],
    .grid[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .gallery-grid,
    .services-grid,
    .specialized-services-grid,
    .certificates-grid,
    .doctors-grid,
    .branches-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* Mobile Header Professional Optimization (Prevents wrapping & vertical stretching) */
@media (max-width: 768px) {
    .header {
        height: 70px !important;
        line-height: 70px !important;
    }
    
    .navbar {
        height: 70px !important;
    }
    
    .logo {
        height: 45px !important;
        max-width: 65% !important;
        gap: 8px !important;
    }
    
    .logo img {
        height: 45px !important;
        width: auto !important;
    }
    
    .logo span {
        font-size: 1.25rem !important;
        white-space: nowrap !important;
    }
    
    .nav-container-right {
        gap: 10px !important;
        height: 100% !important;
    }
    
    .lang-toggle-btn {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        background: linear-gradient(135deg, #28a745, #218838) !important;
        color: var(--white) !important;
        border: none !important;
        padding: 6px 12px !important;
        border-radius: 20px !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        width: auto !important;
        height: auto !important;
        box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2) !important;
        transform: none !important;
    }
    
    .lang-toggle-btn i {
        font-size: 0.85rem !important;
    }
    
    #lang-toggle-text {
        display: inline !important;
        font-size: 0.82rem !important;
    }
    
    .mobile-menu-btn {
        font-size: 1.3rem !important;
        padding: 5px !important;
        margin-left: 2px !important;
    }
    
    /* Reposition the mobile navigation dropdown menu below the optimized header height */
    .nav-links {
        top: 70px !important;
        max-height: calc(100vh - 70px) !important;
    }
    
    /* Correct hero and page top margin offsets to align with new header height */
    .hero-slider,
    .page-header {
        margin-top: 70px !important;
    }
}

/* Tighten logo typography on extremely narrow mobile viewports to prevent layout overflow */
@media (max-width: 480px) {
    .container {
        padding: 0 10px !important;
    }
    
    .header, .navbar {
        height: 65px !important;
    }
    
    .logo {
        height: 42px !important;
        max-width: 60% !important;
        gap: 6px !important;
    }
    
    .logo img {
        height: 42px !important;
    }
    
    .logo span {
        font-size: 1.12rem !important;
    }
    
    .lang-toggle-btn {
        padding: 5px 10px !important;
        font-size: 0.78rem !important;
        gap: 4px !important;
    }
    
    .lang-toggle-btn i {
        font-size: 0.8rem !important;
    }
    
    #lang-toggle-text {
        font-size: 0.78rem !important;
    }
    
    .nav-links {
        top: 65px !important;
        max-height: calc(100vh - 65px) !important;
    }
    
    .hero-slider, .page-header {
        margin-top: 65px !important;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 8px !important;
    }
    
    .header, .navbar {
        height: 60px !important;
    }
    
    .logo {
        height: 38px !important;
        gap: 5px !important;
    }
    
    .logo img {
        height: 38px !important;
    }
    
    .logo span {
        font-size: 1.02rem !important;
    }
    
    .lang-toggle-btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
    
    #lang-toggle-text {
        font-size: 0.75rem !important;
    }
    
    .nav-container-right {
        gap: 5px !important;
    }
    
    .nav-links {
        top: 60px !important;
        max-height: calc(100vh - 60px) !important;
    }
    
    .hero-slider, .page-header {
        margin-top: 60px !important;
    }
}