/* Modularized Design & Responsiveness Enhancements */

/* --- MOBILE NAVIGATION --- */
@media (max-width: 992px) {
    .menu-toggle {
        display: block !important;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 5px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 80px 40px;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.4s ease;
        z-index: 1000;
        display: flex !important;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 15px 0 !important;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: none;
        transform: none;
        padding-left: 20px;
        background: #f9fafb;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .nav-cta {
        display: none !important;
        /* Hide CTA in mobile nav bar, add to menu if needed */
    }
}

/* --- FOOTER RESPONSIVENESS --- */
@media (max-width: 992px) {
    .hospital-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .hospital-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hospital-footer-about {
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .hospital-footer-contact .hospital-footer-heading::after,
    .hospital-footer-links .hospital-footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-links {
        justify-content: center;
    }

    .certifications {
        justify-content: center;
    }
}

/* Mega Menu Implementation */
.nav-links>li.has-mega {
    position: static;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-top: 2px solid var(--primary-color);
    padding: 50px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
}

/* Robust Hover Area for Mega Menu */
.nav-links>li.has-mega {
    position: static;
}

.nav-links>li.has-mega>a {
    padding-bottom: 30px;
    /* Expands hit area to the menu */
    margin-bottom: -30px;
}

.nav-links>li.has-mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    align-items: start;
}

.mega-column h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
}

.mega-column ul li {
    margin-bottom: 15px;
}

.mega-column ul li a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.mega-column ul li a i {
    width: 24px;
    height: 24px;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.mega-column ul li a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.mega-cta {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.mega-cta img {
    border-radius: 10px;
    margin-bottom: 15px;
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.mega-cta p {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Base Utility for subpages */
.sub-hero {
    transition: transform 0.3s ease;
}

/* --- LOGO FIXES --- */
.logo-svg {
    transition: transform 0.3s ease;
}

.logo:hover .logo-svg {
    transform: rotate(15deg);
}

/* Dropdown styling */
.nav-links .dropdown-menu {
    border-top: 3px solid var(--primary-color);
}

/* Department Grid Layout */
.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.dept-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 350px;
    box-shadow: var(--shadow-md);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.dept-item:hover {
    transform: translateY(-10px);
}

.dept-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.dept-item:hover img {
    transform: scale(1.1);
}

.dept-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 74, 153, 0.9));
    padding: 30px;
    color: var(--white);
    transition: background 0.4s ease;
}

.dept-overlay h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.dept-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}