/* =====================================================================
   Barre de navigation Bookeez (templates/partials/_navbar.html.twig)
   ===================================================================== */
:root { --bk-nav-h: 72px; }

.bkn {
  --ink: #1c2033; --muted: #66708a; --line: #e6e9f0; --teal: #1f7a8c; --red: #e02424;
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: 15px; color: var(--ink);
}
.bkn *, .bkn *::before, .bkn *::after { box-sizing: border-box; }
.bkn a { text-decoration: none; }
.bkn-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: var(--bk-nav-h); display: flex; align-items: center; gap: 24px; }

.bkn-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 20px; letter-spacing: -.01em; flex-shrink: 0; }
.bkn-brand img { width: 40px; height: 40px; object-fit: contain; }

.bkn-links { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.bkn-link { position: relative; padding: 8px 14px; border-radius: 10px; font-weight: 600; color: #4a5168; transition: color .15s ease, background-color .15s ease; white-space: nowrap; }
.bkn-link:hover { color: var(--ink); background: #f3f5f9; }
.bkn-link.is-active { color: var(--ink); }
.bkn-link.is-active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -2px; height: 3px; border-radius: 3px; background: var(--red); }
.bkn-link.is-disabled { opacity: .4; cursor: not-allowed; }
.bkn-link:focus-visible, .bkn-btn:focus-visible, .bkn-account summary:focus-visible, .bkn-burger:focus-visible, .bkn-keez:focus-visible { outline: 3px solid rgba(103, 186, 202, .55); outline-offset: 2px; }

.bkn-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.bkn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; font-weight: 700; font-size: 14px; white-space: nowrap; border: 1px solid transparent; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.bkn-btn-primary { background: var(--red); color: #fff; }
.bkn-btn-primary:hover { background: #c81e1e; color: #fff; }
.bkn-btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.bkn-btn-ghost:hover { border-color: #67baca; color: var(--teal); }

.bkn-keez { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 999px; background: #fff8e8; border: 1px solid #f4e2b8; color: #6b4600; font-size: 14px; white-space: nowrap; }
.bkn-keez strong { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.bkn-keez:hover { border-color: #f0c766; }

/* Menu du compte */
.bkn-account { position: relative; }
.bkn-account > summary { list-style: none; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); font-weight: 600; }
.bkn-account > summary::-webkit-details-marker { display: none; }
.bkn-account > summary:hover, .bkn-account[open] > summary { border-color: #67baca; }
.bkn-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; flex-shrink: 0; }
.bkn-account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bkn-caret { color: var(--muted); transition: transform .2s ease; }
.bkn-account[open] .bkn-caret { transform: rotate(180deg); }
.bkn-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgba(28, 32, 51, .18); padding: 8px; z-index: 1001; }
.bkn-menu-head { padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.bkn-menu-head strong { display: block; font-size: 15px; }
.bkn-menu-head span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bkn-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 500; }
.bkn-menu a:hover { background: #f3f5f9; }
.bkn-menu .bkn-menu-admin { color: var(--teal); font-weight: 600; }
.bkn-menu .bkn-menu-logout { color: var(--red); margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }

/* Bouton menu mobile */
.bkn-burger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; }
.bkn-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.bkn-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.bkn-burger.is-open span:nth-child(2) { opacity: 0; }
.bkn-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Menu mobile */
.bkn-mobile { border-top: 1px solid var(--line); background: #fff; padding: 12px 20px 20px; max-height: calc(100vh - var(--bk-nav-h)); overflow-y: auto; }
.bkn-mobile[hidden] { display: none; }
.bkn-mobile-user { display: flex; align-items: center; gap: 12px; padding: 8px 4px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.bkn-mobile-user strong { display: block; }
.bkn-mobile-user span { font-size: 13px; color: var(--muted); }
.bkn-mobile nav { display: grid; }
.bkn-mobile-link { padding: 13px 4px; font-size: 16px; font-weight: 600; color: var(--ink); border-bottom: 1px solid #f1f3f7; }
.bkn-mobile-link.is-active { color: var(--red); }
.bkn-mobile-link.is-disabled { opacity: .4; }
.bkn-mobile-actions { display: grid; gap: 10px; margin-top: 16px; }
.bkn-mobile-actions .bkn-btn { width: 100%; height: 46px; }
.bkn-mobile-logout { text-align: center; padding: 10px; color: var(--red); font-weight: 600; }

/* Écrans moyens : on masque le prénom, puis les liens passent dans le menu mobile */
@media (max-width: 1180px) { .bkn-account-name { display: none; } .bkn-link { padding: 8px 10px; } }
@media (max-width: 1023px) {
  .bkn-links { display: none; }
  .bkn-burger { display: inline-flex; }
}
@media (max-width: 640px) {
  .bkn-inner { padding: 0 14px; gap: 10px; }
  .bkn-brand span { display: none; }
  .bkn-actions > .bkn-btn, .bkn-hide-sm, .bkn-account { display: none; }
  .bkn-keez { height: 38px; padding: 0 12px; }
  .bkn-keez span { display: none; }
}
