/* 3D Academy — global fixed navbar (all pages) */

.academy-nav-shell {
    --nav-h: 76px;
    --blue-400: #46B6E6;
    --blue-500: #2BA9E0;
    --blue-600: #1C8FD0;
    --blue-700: #1C75BC;
    --brand-grad: linear-gradient(135deg, #2BA9E0 0%, #1C75BC 100%);
    --ink: #11243A;
    --ink-2: #33485E;
    --muted: #6A7889;
    --line: #E3E9F0;
    --line-2: #EEF2F7;
    --bg: #F4F8FB;
    --shadow: 0 14px 40px -18px rgba(17, 36, 58, 0.22);
    --shadow-lg: 0 40px 80px -30px rgba(17, 36, 58, 0.30);
    --maxw: 1280px;
    --head: "Cairo", sans-serif;
    --body: "Tajawal", sans-serif;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    width: 100%;
    transition: box-shadow 0.25s ease, background 0.25s ease;
}

/* Reserve document flow space — fixed nav is removed from layout */
.academy-nav-spacer {
    height: var(--nav-h, 76px);
    flex-shrink: 0;
    pointer-events: none;
}

@media (max-width: 680px) {
    .academy-nav-spacer {
        height: 68px;
    }
}

.academy-nav-shell.is-scrolled {
    box-shadow: 0 8px 32px -12px rgba(17, 36, 58, 0.18);
}

.academy-nav-shell .wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

.academy-nav-shell header.academy-header {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(227, 233, 240, 0.9);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.academy-nav-shell.is-scrolled header.academy-header,
.academy-nav-shell header.academy-header.scrolled {
    background: rgba(255, 255, 255, 0.97);
    border-bottom-color: var(--line);
}

.academy-nav-shell header.academy-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-grad);
    opacity: 0.85;
}

/* Override Bootstrap `.nav` (flex-wrap, list-style) on academy header bar */
.academy-nav-shell .wrap.nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: var(--nav-h);
    width: 100%;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
    gap: 16px;
}

.academy-nav-shell .wrap.nav > .nav-links {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    max-width: 720px;
    margin: 0 auto;
}

.academy-nav-shell .wrap.nav > .brand {
    flex-shrink: 0;
    min-width: 0;
    width: 168px;
}

.academy-nav-shell .wrap.nav > .nav-cta {
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
    width: auto;
    justify-content: flex-end;
}

.academy-nav-shell .nav-links a {
    white-space: nowrap;
}

.academy-nav-shell .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
}

.academy-nav-shell .brand .site-brand-logo--header {
    display: block;
    height: auto;
    width: auto;
    max-height: 72px;
    max-width: 220px;
    object-fit: contain;
    object-position: center;
}

.academy-nav-shell .nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.academy-nav-shell .nav-links a {
    font-family: var(--head);
    font-weight: 700;
    font-size: 14px;
    color: var(--ink-2);
    position: relative;
    padding: 9px 14px;
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.academy-nav-shell .nav-links a::after {
    display: none;
}

.academy-nav-shell .nav-links a:hover {
    color: var(--blue-700);
    background: #fff;
    box-shadow: 0 4px 14px -8px rgba(28, 117, 188, 0.35);
}

.academy-nav-shell .nav-cta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.academy-nav-shell .nav-cart {
    position: relative;
    flex-shrink: 0;
}

.academy-nav-shell .nav-cart-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--blue-700);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    text-decoration: none;
}

.academy-nav-shell .nav-cart-btn:hover {
    border-color: var(--blue-500);
    box-shadow: 0 8px 22px -12px rgba(28, 117, 188, 0.45);
    color: var(--blue-700);
}

.academy-nav-shell .nav-cart-btn svg {
    width: 20px;
    height: 20px;
}

.academy-nav-shell .nav-cart-badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brand-grad);
    color: #fff;
    font-family: var(--head);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 4px 10px -4px rgba(28, 117, 188, 0.55);
}

.academy-nav-shell .nav-cart .dropdown-menu.nav-cart-menu {
    inset-inline-end: 0;
    left: auto !important;
    right: 0;
    min-width: min(360px, calc(100vw - 36px));
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
}

[dir="rtl"] .academy-nav-shell .nav-cart .dropdown-menu.nav-cart-menu {
    right: auto !important;
    left: 0 !important;
}

.academy-nav-shell .nav-cart .navbar-shopping-cart {
    max-height: 360px;
}

.academy-nav-shell .mobile-menu-cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.academy-nav-shell .mobile-menu-cart__count {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brand-grad);
    color: #fff;
    font-family: var(--head);
    font-size: 12px;
    font-weight: 800;
}

.academy-nav-shell .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    line-height: 0;
}

.academy-nav-shell .nav-cart-btn {
    width: 42px;
    height: 42px;
    border-radius: 11px;
}

.academy-nav-shell .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: var(--head);
    font-weight: 700;
    font-size: 16px;
    padding: 14px 26px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    white-space: nowrap;
    text-decoration: none;
}

.academy-nav-shell .btn-primary {
    background: var(--brand-grad);
    color: #fff;
    box-shadow: 0 12px 26px -10px rgba(28, 117, 188, 0.6);
}

.academy-nav-shell .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -10px rgba(28, 117, 188, 0.7);
    color: #fff;
}

.academy-nav-shell .btn-ghost {
    background: #fff;
    color: var(--ink);
    border: 1.5px solid var(--line);
}

.academy-nav-shell .btn-ghost:hover {
    border-color: var(--blue-500);
    color: var(--blue-700);
    transform: translateY(-2px);
}

.academy-nav-shell .nav-auth-login {
    padding: 10px 18px;
    font-size: 14px;
}

.academy-nav-shell .nav-panel-btn {
    padding: 10px 18px;
    font-size: 14px;
}

.academy-nav-shell .nav-user {
    position: relative;
}

.academy-nav-shell .nav-user-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 5px 14px 5px 5px;
    cursor: pointer;
    font-family: var(--head);
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.academy-nav-shell .nav-user-toggle:hover,
.academy-nav-shell .nav-user.open .nav-user-toggle {
    border-color: var(--blue-500);
    box-shadow: 0 8px 22px -12px rgba(28, 117, 188, 0.45);
}

.academy-nav-shell .nav-user-toggle img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.academy-nav-shell .nav-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.academy-nav-shell .nav-user-chevron {
    width: 16px;
    height: 16px;
    color: var(--muted);
    transition: transform 0.2s ease;
}

.academy-nav-shell .nav-user.open .nav-user-chevron {
    transform: rotate(180deg);
}

.academy-nav-shell .nav-user-menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1200;
}

.academy-nav-shell .nav-user.open .nav-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.academy-nav-shell .nav-user-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--line-2);
    margin-bottom: 4px;
}

.academy-nav-shell .nav-user-menu-head img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.academy-nav-shell .nav-user-menu-head strong {
    display: block;
    font-family: var(--head);
    font-size: 15px;
    color: var(--ink);
}

.academy-nav-shell .nav-user-menu-head span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.academy-nav-shell .nav-user-menu a {
    display: block;
    padding: 11px 14px;
    border-radius: 10px;
    font-family: var(--head);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink-2);
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.academy-nav-shell .nav-user-menu a:hover {
    background: #EAF5FC;
    color: var(--blue-700);
}

.academy-nav-shell .nav-user-menu a.is-danger {
    color: #c0392b;
}

.academy-nav-shell .nav-user-menu a.is-danger:hover {
    background: #fdecea;
    color: #a93226;
}

.academy-nav-shell .nav-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--head);
    font-weight: 700;
    font-size: 13px;
    color: var(--ink);
    direction: ltr;
    text-decoration: none;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.academy-nav-shell .nav-phone:hover {
    border-color: var(--blue-500);
    color: var(--blue-700);
    box-shadow: 0 6px 18px -10px rgba(28, 117, 188, 0.4);
}

.academy-nav-shell .nav-phone svg {
    width: 16px;
    height: 16px;
    color: var(--blue-600);
    flex-shrink: 0;
}

.academy-nav-shell .hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.academy-nav-shell .hamburger:hover {
    border-color: var(--blue-500);
    box-shadow: 0 6px 18px -10px rgba(28, 117, 188, 0.35);
}

.academy-nav-shell .hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.academy-nav-shell .hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.academy-nav-shell .hamburger.active span:nth-child(2) {
    opacity: 0;
}

.academy-nav-shell .hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

body.academy-nav-open {
    overflow: hidden;
}

body.academy-nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(17, 36, 58, 0.35);
    z-index: 1190;
    backdrop-filter: blur(2px);
}

.academy-nav-shell .mobile-menu {
    display: none;
}

.academy-nav-shell .mobile-auth {
    border-top: 1px solid var(--line-2);
    margin-top: 8px;
    padding-top: 8px;
}

.academy-nav-shell .mobile-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-2);
    margin-bottom: 4px;
}

.academy-nav-shell .mobile-user-card img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.academy-nav-shell .mobile-user-card strong {
    display: block;
    font-family: var(--head);
    font-size: 16px;
    color: var(--ink);
}

.academy-nav-shell .mobile-user-card span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.academy-nav-shell .mobile-auth-logout {
    color: #c0392b !important;
}

.academy-nav-shell .mobile-auth .btn {
    width: 100%;
    margin-top: 14px;
}

@media (max-width: 1100px) {
    .academy-nav-shell .nav-links {
        gap: 18px;
    }

    .academy-nav-shell .nav-links a {
        font-size: 14px;
    }

    .academy-nav-shell .nav-phone {
        display: none;
    }

    .academy-nav-shell .nav-user-name {
        display: none;
    }
}

@media (max-width: 900px) {
    .academy-nav-shell .nav-links {
        display: none;
    }

    .academy-nav-shell .nav-auth-login {
        display: none;
    }

    .academy-nav-shell .hamburger {
        display: flex;
    }

    .academy-nav-shell .mobile-menu {
        display: block;
        position: fixed;
        inset: var(--nav-h) 0 auto 0;
        background: #fff;
        box-shadow: var(--shadow-lg);
        padding: 16px 20px 28px;
        transform: translateY(calc(-100% - var(--nav-h)));
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1195;
        max-height: calc(100vh - var(--nav-h));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--line);
    }

    .academy-nav-shell .mobile-menu.open {
        transform: translateY(0);
    }

    .academy-nav-shell .mobile-menu > a {
        display: block;
        font-family: var(--head);
        font-weight: 700;
        font-size: 16px;
        padding: 14px 12px;
        margin-bottom: 4px;
        border-radius: 12px;
        border-bottom: none;
        color: var(--ink);
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .academy-nav-shell .mobile-menu > a:hover {
        background: #EAF5FC;
        color: var(--blue-700);
    }

    .academy-nav-shell .mobile-menu .btn {
        width: 100%;
        margin-top: 16px;
    }
}

@media (max-width: 680px) {
    .academy-nav-shell .wrap {
        padding: 0 18px;
    }

    .academy-nav-shell .wrap.nav,
    .academy-nav-shell .nav {
        height: 68px;
    }

    .academy-nav-shell {
        --nav-h: 68px;
    }

    .academy-nav-shell .brand .site-brand-logo--header {
        max-height: 58px;
        max-width: 190px;
    }

    .academy-nav-shell .nav-cta {
        gap: 8px;
    }

    .academy-nav-shell .nav-cart-btn,
    .academy-nav-shell .hamburger {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .academy-nav-shell .mobile-menu {
        inset: var(--nav-h) 0 auto 0;
        max-height: calc(100vh - var(--nav-h));
    }
}

/* Panel: hide redundant dashboard CTA while already in panel */
#panel_app .academy-nav-shell .nav-panel-btn {
    display: none !important;
}
