/* =====================================================================
   Aves Digital Academy - Mobile Menu Fix
   File: public/frontend/assets/css/mobile-menu-fix.css

   ===================================================================== */

@media (max-width: 991.98px) {

    /* ---------- 1. Header bar ---------- */
    #mainNav {
        height: 72px;
        padding: 0;
        background-color: var(--navbar-bg-color, #030060);
    }
    #mainNav > .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }
    #mainNav .navbar-brand {
        margin-right: 0;
    }
    #mainNav .navbar-brand img {
        height: 44px;
        width: auto;
        max-width: 220px;
        object-fit: contain;
    }

    /* Hamburger: bada touch target (44x44) */
    #mainNav .navbar-toggler {
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* ---------- 2. Menu panel: full width, header ke neeche ---------- */
    #mainNav .main-menu-collapse {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 72px);
        height: calc(100dvh - 72px);
        margin: 0;
        padding: 16px 20px 40px;
        background-color: var(--heading-color, #040453);
        box-shadow: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        z-index: 1000;
    }

    /* Menu khula ho to peeche ka page scroll na ho (JS ye class lagata hai) */
    body.mobile-menu-open {
        overflow: hidden;
    }

    /* ---------- 3. Search + Courses (left block) ---------- */
    #mainNav .header-nav-left-side {
        padding: 0;
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }
    #mainNav .header-nav-left-side form {
        width: 100%;
        height: 48px;
        margin: 0;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    #mainNav .header-nav-left-side form .form-control {
        height: 44px;
        font-size: 16px; /* iOS auto-zoom rokne ke liye */
        color: #fff;
    }
    #mainNav .header-nav-left-side form .form-control::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }
    #mainNav .search-bar-suggestion-box {
        max-height: 50vh;
        overflow-y: auto;
    }

    /* ---------- 4. Saare menu rows ek jaise ---------- */
    #mainNav .navbar-nav {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    #mainNav .header-nav-left-side .navbar-nav {
        margin-bottom: 0 !important;
    }
    #mainNav .header-nav-right-side {
        margin-top: 0;
    }
    #mainNav .header-nav-right-side > .navbar-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    #mainNav .navbar-nav > .nav-item:not(.menu-round-btn) {
        flex: 0 0 100%;
        width: 100%;
    }

    #mainNav .navbar-nav .nav-item:not(.menu-round-btn):not(.menu-sign-in-btn) > .nav-link,
    #mainNav #librariesDropdown {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        max-width: none;
        min-height: 52px;
        margin: 0;
        padding: 12px 4px !important;
        font-size: 16px;
        font-weight: 600;
        color: #fff !important;
        background: transparent;
        border: 0;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    #mainNav .navbar-nav .nav-item:not(.menu-round-btn):not(.menu-sign-in-btn) > .nav-link:active,
    #mainNav #librariesDropdown:active {
        background-color: rgba(255, 255, 255, 0.06);
    }

    /* Chevron: right side me, khulne par ghoome */
    #mainNav .dropdown .dropdown-toggle:after,
    #mainNav .dropdown-toggle:after {
        margin-left: auto;
        transition: transform 0.2s ease;
    }
    #mainNav .dropdown-toggle[aria-expanded="true"]:after {
        transform: rotate(180deg);
    }

    /* ---------- 5. Dropdown lists (Courses / Pages) menu ke andar hi khulein ---------- */
    #mainNav .nav-item .dropdown-menu,
    #mainNav .dropdown-menu-profile {
        position: static !important;
        transform: none !important;
        float: none;
        width: 100%;
        min-width: 0;
        max-height: none !important; /* andar ka alag scroll hata diya */
        overflow: visible;
        margin: 4px 0 8px;
        padding: 4px 0;
        background-color: rgba(255, 255, 255, 0.08) !important;
        border: 0;
        border-radius: 12px;
        box-shadow: none;
    }
    #mainNav .navbar-nav .dropdown-menu a,
    #mainNav .navbar-nav .dropdown-menu .dropdown-item {
        min-height: 46px;
        padding: 10px 16px;
        white-space: normal;
        color: rgba(255, 255, 255, 0.88);
        font-size: 15px;
    }
    #mainNav .navbar-nav .dropdown-menu a:active,
    #mainNav .navbar-nav .dropdown-menu .dropdown-item:active {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    #mainNav .dropdown-menu .dropdown-menu {
        margin: 0 8px 8px 16px;
        background-color: rgba(0, 0, 0, 0.25) !important;
    }
    #mainNav .dropdown-menu .dropdown-toggle:after {
        color: rgba(255, 255, 255, 0.7);
    }
    #mainNav .dropdown-divider {
        border-color: rgba(255, 255, 255, 0.12);
    }

    /* ---------- 6. Flag / Bell / Cart / Avatar: ek horizontal row ---------- */
    /* li ko "display: contents" kiya, taaki icon aur uska dropdown
       dono direct flex-items ban jaayein aur hum unhe order de sakein */
    #mainNav .menu-round-btn {
        display: contents;
    }
    #mainNav .menu-round-btn > a,
    #mainNav .menu-round-btn > .nav-link {
        order: 1;
        position: relative;
        width: 44px;
        height: 44px;
        margin: 16px 14px 8px 0 !important;
        padding: 0 !important;
        border: 0;
        border-radius: 50%;
        background-color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    #mainNav .menu-round-btn > a img {
        width: 30px;
        height: 30px;
        object-fit: cover;
    }
    #mainNav .navbar-nav .nav-item.menu-round-btn > a.nav-link svg {
        width: 20px;
        height: 20px;
        padding: 0;
    }
    /* Round buttons ke chhote chevron hide */
    #mainNav .menu-round-btn .dropdown-toggle:after {
        display: none;
    }
    /* Badge: icon ke upar-right corner me */
    #mainNav .menu-round-btn .badge {
        top: 2px !important;
        left: auto !important;
        right: -4px;
        transform: none !important;
        min-width: 20px;
        font-size: 11px;
        line-height: 1.3;
    }
    /* Khula hua dropdown icons ki row ke NEECHE, poori width me */
    #mainNav .menu-round-btn > .dropdown-menu {
        order: 2;
        flex: 0 0 100%;
        width: 100%;
    }

    /* ---------- 7. Profile card (dark theme ke hisaab se) ---------- */
    #mainNav .dropdown-menu-profile {
        padding: 8px 0;
    }
    #mainNav .dropdown-menu-profile .dropdown-user-info .message-user-item,
    #mainNav .menu-notification-tab-content .message-user-item {
        background-color: transparent !important; /* white bg hatao */
        margin: 0;
        padding: 12px 16px;
    }
    #mainNav .dropdown-menu-profile .dropdown-user-info {
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    #mainNav .dropdown-menu-profile .dropdown-user-info h6 {
        color: #fff !important;
        font-size: 16px;
        margin: 0 0 2px;
    }
    #mainNav .dropdown-menu-profile .dropdown-user-info p {
        color: rgba(255, 255, 255, 0.7) !important;
        margin: 0;
        word-break: break-all;
    }
    #mainNav .dropdown-menu-profile .user-dropdown-item-box {
        margin: 0;
        padding: 6px 0;
        list-style: none;
        border-top: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    #mainNav .dropdown-menu-profile .user-dropdown-item-box:last-child {
        border-bottom: 0;
    }
    #mainNav .dropdown-menu-profile .user-dropdown-item-box .dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 46px;
        padding: 10px 16px !important; /* purane !important padding ko override */
        color: rgba(255, 255, 255, 0.9);
    }
    #mainNav .dropdown-menu-profile .user-dropdown-item-box .iconify {
        font-size: 20px;
        flex-shrink: 0;
        color: rgba(255, 255, 255, 0.85);
    }

    /* Notification panel text readable */
    #mainNav .menu-notification-tab-content {
        max-height: 40vh;
        overflow-y: auto;
    }
    #mainNav .menu-notification-tab-list .nav-link {
        color: #fff;
    }
    #mainNav .menu-notification-tab-content h6,
    #mainNav .menu-notification-tab-content p {
        color: #fff !important;
    }
    #mainNav .menu-notification-tab-content .color-gray {
        color: rgba(255, 255, 255, 0.6) !important;
    }

    /* ---------- 8. Sign In / Sign Up (logged-out) ---------- */
    #mainNav .navbar-nav > .nav-item.menu-sign-in-btn {
        flex: 1 1 calc(50% - 6px);
        width: auto;
        margin-top: 16px;
    }
    #mainNav .navbar-nav > .nav-item.menu-sign-in-btn > .nav-link {
        justify-content: center;
        min-height: 48px;
        border-radius: 10px;
    }
}

/* =====================================================================
   Header me Cart icon (sirf mobile) - navbar.blade.php me
   ===================================================================== */
.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mobile-header-actions .mobile-cart-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}
.mobile-header-actions .mobile-cart-btn svg {
    width: 22px;
    height: 22px;
}
.mobile-header-actions .mobile-cart-btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    font-size: 11px;
    line-height: 1.3;
}
@media (max-width: 991.98px) {
    /* Menu ke andar wala cart icon chhupao (header me already hai) */
    #mainNav .navbar-nav > li.menu-round-btn.menu-cart-btn {
        display: none;
    }
}
/* =====================================================================
   Course details page - mobile hero spacing fix
   ===================================================================== */
@media (max-width: 991.98px) {
    .course-single-page-header .section-overlay {
        padding: 110px 0 36px;   /* pehle 230px upar / 130px neeche tha */
    }
    .course-single-page-header .page-banner-heading {
        font-size: 30px;
        line-height: 1.25;
        padding-bottom: 14px;
    }
    .course-single-page-header .page-banner-sub-heading {
        font-size: 15px;
        line-height: 1.6;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}
@media (max-width: 575.98px) {
    .course-single-page-header .section-overlay {
        padding: 100px 0 30px;
    }
    .course-single-page-header .page-banner-heading {
        font-size: 26px;
    }
}
/* Desktop: course hero gap fix */
@media (min-width: 992px) {
    .course-single-page-header .section-overlay {
        padding: 170px 0 130px;
    }
}