/* ===================== Smart navbar (Alpine.js) ===================== */
[x-cloak] { display: none !important; }
.nb-util { background: #0c1845; color: rgba(255, 255, 255, .78); font-size: .8rem; }
.nb-util-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 36px; }
.nb-util-left, .nb-util-right { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.nb-util a, .nb-util span { color: rgba(255, 255, 255, .8); display: inline-flex; align-items: center; gap: .35rem; }
.nb-util a:hover { color: #fff; }
.nb-util .icon { width: 14px; height: 14px; }
.nb.site-header { box-shadow: 0 1px 0 #eee; }
.nb .header-actions { display: flex; align-items: center; gap: 6px; }
.nb .icon-btn { width: 40px; height: 40px; }
.nb .icon-btn[aria-expanded="true"] { background: #f2f2f2; color: var(--orange); }
.nb-pop-wrap { position: relative; }
.nb-pop { position: absolute; right: 0; top: calc(100% + 12px); width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 50px -20px rgba(15, 23, 42, .35); z-index: 80; overflow: hidden; }
.nb-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #eef0f3; font-size: .92rem; }
.nb-pop-head strong { color: #111827; }
.nb-pop-head a { font-size: .82rem; font-weight: 600; color: var(--orange); }
.nb-loading { padding: 18px 16px; color: #6b7280; font-size: .88rem; }
.nb-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 24px 16px; color: #6b7280; font-size: .9rem; text-align: center; }
.nb-empty .icon { width: 30px; height: 30px; color: #c4c8d0; }

/* search */
.nb-search { position: absolute; right: -60px; top: calc(100% + 12px); width: min(560px, 92vw); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 50px -20px rgba(15, 23, 42, .35); z-index: 80; overflow: hidden; }
.nb-search-box { position: relative; display: flex; align-items: center; border-bottom: 1px solid #eef0f3; }
.nb-search-box > .icon { position: absolute; left: 16px; color: #9ca3af; }
.nb-search-box input { width: 100%; border: 0; outline: none; padding: 16px 44px 16px 46px; font: inherit; font-size: .98rem; background: transparent; }
.nb-spin { position: absolute; right: 16px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #e5e7eb; border-top-color: var(--orange); animation: nbspin .7s linear infinite; }
@keyframes nbspin { to { transform: rotate(360deg); } }
.nb-search-body { max-height: min(60vh, 460px); overflow-y: auto; padding: 8px 0; }
.nb-hint { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 16px 12px; font-size: .82rem; color: #6b7280; }
.nb-hint a { background: #f3f4f6; color: #374151; padding: .3rem .65rem; border-radius: 6px; font-weight: 600; }
.nb-hint a:hover { background: #fdeeee; color: var(--orange); }
.nb-group-title { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #9ca3af; padding: 10px 16px 4px; }
.nb-sug { display: flex; gap: 12px; align-items: center; padding: 8px 16px; color: #111827; outline: none; }
.nb-sug:hover, .nb-sug:focus { background: #f6f7f9; }
.nb-sug .ph { width: 56px; height: 36px; border-radius: 6px; background: #eef0f3; overflow: hidden; flex-shrink: 0; }
.nb-sug .ph img { width: 100%; height: 100%; object-fit: cover; }
.nb-sug strong { display: block; font-size: .9rem; line-height: 1.3; }
.nb-sug small { display: block; font-size: .78rem; color: #6b7280; }
.nb-all { display: flex; align-items: center; justify-content: center; gap: .4rem; margin: 6px 16px 8px; padding: .6rem; border-radius: 8px; background: #f6f7f9; font-weight: 700; font-size: .86rem; color: var(--orange); outline: none; }
.nb-all:hover, .nb-all:focus { background: #fdeeee; }

/* cart */
.nb-cart-row { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f3f4f6; }
.nb-cart-row .ph { width: 40px; height: 54px; border-radius: 4px; background: #eef0f3; overflow: hidden; flex-shrink: 0; }
.nb-cart-row .ph img { width: 100%; height: 100%; object-fit: cover; }
.nb-cart-row .tx { flex: 1; min-width: 0; }
.nb-cart-row .tx a { display: block; color: #111827; font-weight: 600; font-size: .86rem; line-height: 1.3; }
.nb-cart-row .tx small { color: #6b7280; font-size: .78rem; }
.nb-cart-row .rm { border: 0; background: none; color: #9ca3af; cursor: pointer; padding: 4px; border-radius: 6px; }
.nb-cart-row .rm:hover { color: var(--orange); background: #fdeeee; }
.nb-cart-foot { padding: 12px 16px 16px; }
.nb-cart-foot > div { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .92rem; }
.nb-cart-foot strong { color: var(--orange); }
.nb-cart-foot .btn, .nb-empty .btn, .nb-login .btn { border-radius: 8px; }

/* notifications */
.nb-notif-row { display: block; padding: 11px 16px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.nb-notif-row:hover { background: #f6f7f9; }
.nb-notif-row strong { display: block; font-size: .88rem; color: #111827; }
.nb-notif-row span { display: block; font-size: .82rem; color: #4b5563; line-height: 1.45; }
.nb-notif-row small { display: block; font-size: .72rem; color: #9ca3af; margin-top: 2px; }

/* user */
.nb-me { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--line); background: #fff; border-radius: 30px; padding: 3px 10px 3px 3px; cursor: pointer; font-family: inherit; color: #111827; height: 40px; }
.nb-me:hover, .nb-me[aria-expanded="true"] { border-color: #c9cede; background: #f8f9fb; }
.nb-me .av, .nb-user-head .av { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.nb-me .av img, .nb-user-head .av img { width: 100%; height: 100%; object-fit: cover; }
.nb-me .nm { font-weight: 600; font-size: .88rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-me .caret { width: 14px; height: 14px; color: #6b7280; }
.nb-user { width: 270px; padding-bottom: 6px; }
.nb-user-head { display: flex; gap: .7rem; align-items: center; padding: 14px 16px; border-bottom: 1px solid #eef0f3; margin-bottom: 6px; }
.nb-user-head .av { width: 42px; height: 42px; font-size: .85rem; }
.nb-user-head strong { display: block; color: #111827; font-size: .92rem; line-height: 1.25; }
.nb-user-head small { display: block; color: #6b7280; font-size: .78rem; word-break: break-all; }
.nb-item { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem 16px; color: #374151; font-size: .88rem; font-weight: 500; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.nb-item .icon { width: 17px; height: 17px; color: #6b7280; }
.nb-item:hover { background: #f6f7f9; color: #111827; }
.nb-item b { margin-left: auto; background: var(--orange); color: #fff; font-size: .7rem; padding: .05rem .45rem; border-radius: 9px; }
.nb-out { border-top: 1px solid #eef0f3; margin-top: 6px; padding-top: 6px; }
.nb-out .nb-item, .nb-out .nb-item .icon { color: #b42318; }
.nb-guest { border: 1px solid var(--line) !important; }
.nb-login { width: 320px; }
.nb-login-form { padding: 14px 16px 6px; display: grid; gap: 6px; }
.nb-login-form label { font-size: .8rem; font-weight: 600; color: #374151; }
.nb-login-form .input { height: 42px; margin-bottom: 4px; }
.nb-login-row { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; margin: 2px 0 6px; }
.nb-login-row .check { font-size: .8rem; font-weight: 500; }
.nb-login-row a { color: var(--orange); font-weight: 600; }
.nb-error { background: #fdeeee; color: #9e1b1c; border-radius: 8px; padding: .5rem .7rem; font-size: .82rem; }
.nb-login-alt { padding: 10px 16px 16px; font-size: .86rem; color: #6b7280; text-align: center; }
.nb-login-alt a { color: var(--orange); font-weight: 700; }

/* mega menu with featured course */
.nb-mega { width: min(1060px, 94vw); }
.nb-mega-grid { display: grid; grid-template-columns: 1fr 230px; gap: 1.4rem; }
.nb-feature { display: flex; flex-direction: column; gap: .3rem; background: #f6f7f9; border-radius: 12px; padding: 10px; color: #111827; }
.nb-feature img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.nb-feature .t { font-size: .7rem; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.nb-feature strong { font-size: .9rem; line-height: 1.3; }
.nb-feature .p { font-weight: 800; color: var(--orange); font-size: .95rem; }
.nb-feature .p del { color: #9ca3af; font-weight: 500; font-size: .8rem; }
.nb-feature:hover strong { color: var(--orange); }

/* AJAX list loading state */
#list-region { transition: opacity .15s; }
#list-region.is-loading { opacity: .45; pointer-events: none; }

@media (max-width: 1180px) {
  .nb-mega-grid { grid-template-columns: 1fr; }
  .nb-feature { display: none; }
}
@media (max-width: 640px) {
  .nb-util-left { display: none; }
  .nb-util-inner { justify-content: center; }
  .nb .header-actions { gap: 4px; }
  .nb .icon-btn { width: 38px; height: 38px; }
  .nb-pop, .nb-search { position: fixed; left: 10px; right: 10px; top: 112px; width: auto; }
  .nb-me { padding-right: 3px; }
}
.nb .header-inner { position: relative; }
.nb .has-mega { position: static; }
.nb .main-nav { position: static; }
.nb .nb-mega { left: 50%; top: calc(100% - 6px); }
.nb .nav-link { white-space: nowrap; }
@media (max-width: 1360px) { .nb .main-nav .nav-link { padding: .5rem .55rem; font-size: .88rem; } }
@media (max-width: 1280px) { .nb .main-nav > a[href$="free-resources"] { display: none; } }
.nb-more-res { display: none !important; }
@media (max-width: 1280px) { .nb-more-res { display: flex !important; } }
