/* ===========================
   MOBILE NAV & TOP BAR
   (max-width: 767px)
   =========================== */

@media only screen and (max-width: 767px) {

    /* ===== BODY OVERLAY STATE ===== */
    body.menu-open {
        overflow: hidden;
    }

    body.menu-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 500;          /* below .navigation (z:1000) */
        pointer-events: none;  /* overlay is visual only */
    }

    /* ===== MAIN DRAWER PANEL ===== */
    .navigation nav#main-navigation {
        position: fixed;
        top: 71px;
        right: 0;
        left: auto;
        width: 82vw;
        height: calc(100vh - 71px);
        background: #fffdf7;
        padding: 26px 20px 32px;
        display: none;              /* closed by default */
        flex-direction: column;
        align-items: stretch;
        z-index: 9001;
        box-shadow: -14px 0 38px rgba(15, 23, 42, 0.28);
        overflow-y: auto;
        border-radius: 16px 0 0 0;
    }

    body.menu-open .navigation nav#main-navigation {
        display: flex !important;
    }

    /* ===== TOP-LEVEL ITEMS (Home, Courses, etc.) ===== */
    .navigation nav#main-navigation > .ds-nav-item {
        display: block;
        width: 100%;
        margin: 4px 0;
        padding: 8px 0;
        text-align: left;
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    }

    .navigation nav#main-navigation > .ds-nav-item:last-child {
        border-bottom: none;
    }

    .navigation nav#main-navigation > .ds-nav-item > a,
    .navigation nav#main-navigation > .ds-nav-item > .dropdown-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-left: 5px;
        font-size: 1.1rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        color: var(--Secondary-Color) !important;
        text-decoration: none;
        padding: 2px 0;
    }

    /* Force Pay Now button text white inside navigation */
    .navigation nav#main-navigation .ds-paynow-btn,
    .navigation nav#main-navigation .ds-paynow-btn:link,
    .navigation nav#main-navigation .ds-paynow-btn:visited,
    .navigation nav#main-navigation .ds-paynow-btn:hover,
    .navigation nav#main-navigation .ds-paynow-btn:focus{
        color: #ffffff !important;
    }
    
    /* ===== Courses parent: label + big block under it ===== */
    .navigation nav#main-navigation > .ds-nav-item.parent {
        padding-bottom: 0;        /* submenu handles its own spacing */
        border-bottom: none;
        margin-bottom: 0;
    }

    .navigation nav#main-navigation > .ds-nav-item.parent::after {
        content: "";
        display: block;
        height: 1px;
        background: rgba(148, 163, 184, 0.25);
        margin-top: 10px;
    }

    /* Arrow rotation when open */
    .navigation .dropdown-label {
        gap: 8px;
    }

    .navigation .dropdown-parent .dropdown-arrow {
        transition: transform 0.2s ease;
    }

    .navigation .dropdown-parent.mobile-open .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* ==============
       MOBILE SUBMENU
       LCPS-STYLE BLOCK
       ============== */

    /* sits directly under "Courses", full width, solid background */

    .navigation .submenu {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        display: none;

        /* align with text, no weird inset */
        margin: 8px 0 10px;       /* just vertical gap */
        padding: 16px 16px 18px;

        background: #e1479f;
        color: #ffffff;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        box-shadow: 0 16px 32px rgba(15, 23, 42, 0.25);
    }

    /* show when JS adds .mobile-open to parent */
    .navigation .dropdown-parent.mobile-open .submenu {
        display: block !important;
    }

    /* stack all columns vertically */
    .navigation .submenu .row {
        margin: 0;
        display: block;
    }

    .navigation .submenu .submenu-column {
        padding: 0;
        margin-bottom: 18px;
    }

    .navigation .submenu .submenu-column:last-child {
        margin-bottom: 0;
    }

    /* category headings (Undergraduate / Adult Care, etc.) */
    .navigation .submenu-heading {
        font-size: 0.85rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.9);
        margin: 0 0 6px;
    }

    .navigation .submenu-heading::after {
        content: "";
        display: block;
        width: 52px;
        height: 1px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.7);
        margin-top: 5px;
    }

    /* course list */
    .navigation .submenu ul {
        list-style: none;
        padding: 0;
        margin: 6px 0 0;
    }

    .navigation .submenu ul li {
        padding: 1px 0;
        border-bottom: none;
    }

    .navigation .submenu ul li a,
    .navigation .submenu ul li a:link,
    .navigation .submenu ul li a:visited {
        display: block;
        font-size: 0.96rem;
        font-weight: 600;
        text-decoration: none;
        color: #ffffff;
        padding: 7px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 0;
        position: relative;
        transition:
            background-color 0.16s ease,
            color 0.16s ease,
            transform 0.16s ease;
    }

    .navigation .submenu ul li:last-child a {
        border-bottom: none;
    }

    /* remove small desktop bullet */
    .navigation .submenu ul li a::before {
        content: none;
    }

    .navigation .submenu ul li a:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        transform: translateX(2px);
    }

    /* ============ HAMBURGER ============ */

    #nav-icon1 {
        width: 25px;
        height: 14px;
        position: relative;
        transform: rotate(0deg);
        transition: 0.5s ease-in-out;
        cursor: pointer;
        margin-left: auto;
        margin-top: auto;
        margin-bottom: auto;
        z-index: 9002;
    }

    #nav-icon1 span {
        display: block;
        position: absolute;
        height: 2px;
        width: 100%;
        background: var(--Primary-Color);
        border-radius: 9px;
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: 0.25s ease-in-out;
    }

    #nav-icon1 span:nth-child(1) { top: 0px; }
    #nav-icon1 span:nth-child(2) { top: 6px; }
    #nav-icon1 span:nth-child(3) { top: 12px; }

    #nav-icon1.open span:nth-child(1) {
        top: 6px;
        transform: rotate(135deg);
    }
    #nav-icon1.open span:nth-child(2) {
        opacity: 0;
        left: -60px;
    }
    #nav-icon1.open span:nth-child(3) {
        top: 6px;
        transform: rotate(-135deg);
    }

    /* ===== TOP BAR + SOCIAL ICONS ===== */

    .facebook {
        background: url('/images/icons/facebook.png') no-repeat center center;
        background-size: cover;
        width: 30px;
        height: 30px;
        display: inline-block;
    }

    .instagram {
        background: url('/images/icons/instagram.png') no-repeat center center;
        background-size: cover;
        width: 30px;
        height: 30px;
        display: inline-block;
    }

    .tiktok {
        background: url('/images/icons/tiktok.png') no-repeat center center;
        background-size: cover;
        width: 30px;
        height: 30px;
        display: inline-block;
    }

    #top-bar {
        padding: 4px 0;
    }

    #top-bar .topbar-container {
        padding: 4px 10px;
    }

    #top-bar .topbar-container > div:first-child {
        text-align: center;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
    }

    #top-bar .row {
        margin-top: 4px;
    }

    #top-bar .row .col-12 {
        display: flex;
        justify-content: center !important;
        align-items: center;
    }

    #top-bar .contact-icons {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding-right: 0;
    }

    #top-bar .contact-icons a {
        padding: 0 4px;
    }

    #top-bar .icon-white {
        width: 18px;
        height: 18px;
        filter: invert(1);
    }

    #top-bar .contact-link .contact-text {
        display: none;
    }

    form.default .row {
        margin-top: 0;
    }
}
