/* ==========================================================================
   RESPONSIVE MEDIA QUERIES - Dr. Deepesh Daultani Orthopedic
   ========================================================================== */

/* --- Desktop Styles (992px and up) --- */
@media (min-width: 992px) {
    .nav-item.mega-menu:hover .mega-menu-content {
        display: block;
        margin-top: 0;
        animation: megaFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    }

    .nav-item.dropdown:hover .dropdown-custom-menu {
        display: block;
        margin-top: 0;
        animation: slideUp 0.3s ease-out;
    }
}

/* --- Medium Desktop (1220px and below) --- */
@media (max-width: 1220px) {
    .navbar-main .btn-primary-custom {
        padding: 10px 22px;
        font-size: 12px;
    }
}

/* --- Tablet & Small Desktop (991px and below) --- */
@media (max-width: 991px) {
    .navbar-main {
        overflow-x: hidden;
    }

    .navbar {
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        gap: 10px;
    }

    .navbar-brand {
        margin-right: 0;
        flex-shrink: 1;
        min-width: 0;
    }

    .navbar-logo img {
        max-height: 60px !important;
        flex-shrink: 0;
    }

    .navbar-logo .d-flex.flex-column {
        min-width: 0;
    }

    .navbar-logo .d-flex.flex-column span:first-child {
        font-size: 0.9rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .navbar-logo .d-flex.flex-column span:last-child {
        font-size: 0.5rem !important;
        letter-spacing: 0px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .navbar-toggler {
        border: 2px solid var(--primary-blue) !important;
        padding: 5px 7px;
        border-radius: 6px;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }

    .navbar-toggler:focus {
        box-shadow: none;
        background: rgba(2, 86, 162, 0.05);
    }

    /* Offcanvas Styling */
    .offcanvas {
        width: 300px !important;
        border-right: 5px solid var(--primary-blue);
    }

    .offcanvas-header {
        background: #f8fbff;
        padding: 20px;
    }

    .offcanvas-body .nav-link-custom {
        color: var(--primary-blue) !important;
        font-weight: 700;
        padding: 12px 0 !important;
        border-bottom: 1px solid rgba(2, 86, 162, 0.1);
        font-size: 1rem;
    }

    .offcanvas-body .nav-link-custom::after {
        display: none;
    }

    .offcanvas-body .dropdown-menu .dropdown-item {
        padding: 10px 0;
        font-size: 0.9rem;
        color: var(--text-main);
    }

    .offcanvas-body .dropdown-item:hover {
        color: var(--accent-green);
        background: transparent;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .mega-menu-content {
        display: none !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-image-wrapper {
        max-width: 520px;
        margin: 0 auto;
    }

    .home-cta-heading {
        font-size: 2.5rem;
        letter-spacing: 3px;
    }

    .home-cta-text {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .section-padding {
        padding: 60px 0;
    }

    .info-grid-section .border-end {
        border-right: none !important;
        border-bottom: 1px solid rgba(2, 86, 162, 0.1);
    }

    .hero-content {
        padding-left: 0;
        text-align: center;
        width: 100%;
        padding: 0 20px;
    }

    .hero-btns {
        display: flex;
        justify-content: center;
        gap: 15px;
    }
}

/* --- Mobile (767px and below) --- */
@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-main .gallery-wrapper,
    #gallery-photos .gallery-wrapper {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .gallery-main .gallery-card,
    #gallery-photos .gallery-card {
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

/* --- Extra Small Mobile (575px and below) --- */
@media (max-width: 575px) {
    .about-image-wrapper {
        padding: 26px 16px 46px 20px;
    }

    .about-frame-border {
        inset: 6px 8px 18px 10px;
        border-radius: 32px;
    }

    .about-doctor-img {
        border-radius: 24px;
        border-width: 6px;
    }

    .experience-badge {
        left: 8px;
        bottom: 0;
        padding: 18px 16px;
        border-radius: 22px;
    }

    .experience-badge h3 {
        font-size: 2rem;
    }

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

    .section-title {
        font-size: 2rem !important;
    }

    .info-card {
        padding: 30px 20px !important;
    }
}


@media (max-width: 991px) {
    .fellowship-banner-wrapper {
        flex-direction: column;
    }

    .fellowship-col {
        height: 65px;
        min-height: 65px;
        flex: none !important;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .fellowship-col.is-expanded {
        height: 300px;
        min-height: 300px;
    }

    .vertical-label {
        width: 100% !important;
        height: 65px;
        left: 0;
        top: 0;
        background: rgba(2, 86, 162, 0.95);
    }

    .fellowship-col:nth-child(even) .vertical-label {
        background: rgba(118, 188, 67, 0.95);
    }

    .vertical-label span {
        transform: none;
        width: 100%;
        text-align: center;
        font-size: 1.1rem;
        font-weight: 700;
        letter-spacing: 1px;
    }

    .fellowship-content {
        transform: translateY(0);
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        padding-bottom: 20px !important;
    }

    .fellowship-col.is-expanded .fellowship-content {
        opacity: 1;
        visibility: visible;
        transition-delay: 0.15s;
    }
}

/* Reorder about section elements on mobile view */
@media (max-width: 991px) {
    #about .row {
        display: flex !important;
        flex-direction: column !important;
    }
    
    #about .row > div[class*="col-lg-"] {
        display: contents !important;
    }

    #about .section-title-box {
        order: 1 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    #about .about-image-wrapper {
        order: 2 !important;
        margin-top: 15px !important;
        margin-bottom: 25px !important;
    }

    #about p.text-justify {
        order: 4 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    #about .about-qual-card {
        order: 3 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    #about .about-features {
        order: 5 !important;
        margin-top: 20px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    #about .mt-4.pt-2 {
        order: 6 !important;
        margin-top: 15px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Hero Section Mobile adjustments (Same to Same as Desktop View) */
@media (max-width: 991px) {
    .hero-section {
        height: auto !important;
        min-height: auto !important;
        margin-top: 90px !important; /* Offset for fixed-top navbar */
        position: relative !important;
        overflow: hidden !important;
    }
    .heroSwiper {
        height: auto !important;
    }
    .heroSwiper .swiper-slide {
        height: 0 !important;
        padding-top: 56.25vw !important; /* Perfect 16:9 aspect ratio of Desktop View! */
        padding-bottom: 0 !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        background-color: transparent !important;
        position: relative !important;
    }
    .heroSwiper .swiper-slide::after {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: linear-gradient(90deg, rgba(2, 86, 162, 0.75) 0%, rgba(2, 86, 162, 0.2) 100%) !important;
        z-index: 1 !important;
        display: block !important;
    }
    .heroSwiper .swiper-slide .container {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        z-index: 2 !important;
    }
    .hero-content {
        width: 60% !important; /* Left columns width like desktop */
        padding: 0 0 0 5% !important;
        text-align: left !important;
        position: relative !important;
        z-index: 3 !important;
    }
    .hero-title {
        font-size: calc(10px + 1.8vw) !important; /* Crisp, perfectly proportional fluid size */
        line-height: 1.1 !important;
        margin-bottom: 1.5vw !important;
    }
    .hero-subtitle {
        font-size: calc(6px + 1vw) !important;
        margin-bottom: 2vw !important;
        max-width: 95% !important;
        margin-left: 0 !important;
    }
    .hero-btns {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 1.5vw !important;
        margin-bottom: 0 !important;
    }
    .hero-btns .btn {
        width: auto !important;
        padding: calc(4px + 0.8vw) calc(8px + 1.2vw) !important;
        font-size: calc(6px + 0.8vw) !important;
        border-radius: 50px !important;
    }
    .hero-section h4 {
        font-size: calc(5px + 0.8vw) !important;
        margin-top: 1.5vw !important;
        opacity: 0.85 !important;
    }
}

    @media (max-width: 575.98px) {
        .national-agenda::before {
            left: 22px;
        }

        .national-agenda-item {
            grid-template-columns: 58px minmax(0, 1fr);
            gap: 12px;
        }

        .national-agenda-marker {
            width: 46px;
            height: 46px;
            font-size: 0.9rem;
        }
    }