/* ============================================================
   ALARM DISCOUNT — css/navbar.css
   Navigation universelle desktop + mobile premium v2
   ============================================================ */

/* Empêche le scroll horizontal quand le fly-out dépasse */
html, body { overflow-x: hidden; }

/* ── TOP BAR (annonce) ── */
.announcement-bar {
  background: var(--yellow);
  color: var(--dark);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  padding: 7px 16px;
  line-height: 1.4;
}
.announcement-bar a { color: var(--dark); font-weight: 800; text-decoration: underline; }

/* ── NAVBAR PRINCIPALE ── */
.navbar-main {
  background: var(--dark);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.navbar-inner {
  display: flex;
  align-items: stretch;
  height: 60px;
  gap: 0;
}

/* LOGO */
.brand-text    { font-size: 1.25rem; font-weight: 900; color: #fff; letter-spacing: -.02em; white-space: nowrap; }
.brand-text-sm { font-size: 1.1rem;  font-weight: 900; color: #fff; letter-spacing: -.02em; }
.brand-text span, .brand-text-sm span { color: var(--yellow); }
.navbar-brand { display: flex; align-items: center; padding: 0 20px 0 0; flex-shrink: 0; }

/* SEARCH */
.nb-search-wrap { position: relative; flex: 1; max-width: 340px; display: flex; align-items: center; margin: 0 12px; }
.nb-search-wrap .bi-search { position: absolute; left: 12px; color: rgba(255,255,255,.35); font-size: .85rem; pointer-events: none; }
.search-bar-nav {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: #fff;
  padding: 8px 14px 8px 34px;
  font-size: .85rem;
  font-family: inherit;
  transition: all .2s;
}
.search-bar-nav::placeholder { color: rgba(255,255,255,.35); }
.search-bar-nav:focus { background: rgba(255,255,255,.12); outline: none; border-color: var(--yellow); }

/* RIGHT ICONS */
.nb-right { display: flex; align-items: center; gap: 2px; margin-left: auto; padding: 0 8px; }
.nb-icon-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all .2s;
  position: relative;
  font-size: .68rem;
  gap: 3px;
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.nb-icon-btn i { font-size: 1.15rem; display: block; }
.nb-icon-btn:hover { color: var(--yellow); background: rgba(255,255,255,.06); }
.nb-icon-btn--active { color: var(--yellow); }
.nb-icon-label { font-size: .6rem; font-weight: 600; letter-spacing: .03em; }

.cart-badge {
  position: absolute;
  top: 4px; right: 6px;
  background: var(--yellow);
  color: var(--dark);
  font-size: .58rem;
  font-weight: 800;
  border-radius: 50%;
  width: 17px; height: 17px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--dark);
}

/* HAMBURGER (mobile) */
.nb-hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
}
.nb-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .3s;
}
.nb-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nb-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nb-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── NAVIGATION DESKTOP ── */
.nb-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
}

.nb-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nb-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.8);
  font-size: .84rem;
  font-weight: 600;
  padding: 0 14px;
  height: 100%;
  text-decoration: none;
  transition: color .2s;
  position: relative;
  white-space: nowrap;
}
.nb-link i { font-size: .95rem; transition: transform .2s; }
.nb-link .chevron { font-size: .65rem; margin-left: -2px; transition: transform .25s; }
.nb-link:hover { color: var(--yellow); }

/* Indicateur actif */
.nb-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 14px; right: 14px;
  height: 2px;
  background: var(--yellow);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform .25s;
}
.nb-link:hover::after,
.nb-item.active .nb-link::after { transform: scaleX(1); }
.nb-item.active .nb-link { color: var(--yellow); }

/* Dropdown au hover */
.nb-item:hover .nb-link .chevron { transform: rotate(180deg); }
.nb-item:hover > .nb-dropdown,
.nb-dropdown:hover { display: flex; }

/* ── DROPDOWN ── */
.nb-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  min-width: 220px;
  flex-direction: column;
  padding: 8px;
  padding-top: 10px;
  z-index: 2000;
  border: 1px solid rgba(0,0,0,.08);
  animation: dropIn .18s ease;
}
/* Bridge invisible pour relier le lien au dropdown */
.nb-dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
}
@keyframes dropIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* Sous-items */
.nb-dd-item--sub { padding: 6px 8px; gap: 8px; }
.nb-dd-item--sub .nb-dd-text strong { font-size: .78rem; }
.nb-dd-item--sub .nb-dd-text small { font-size: .65rem; }
.nb-sub-ico { font-size: .75rem; color: #adb5bd; width: 16px; text-align: center; flex-shrink: 0; transition: color .15s; }
.nb-dd-item--sub:hover .nb-sub-ico { color: var(--yellow); }

.nb-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--dark);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.nb-dd-item:hover { background: #fff8e1; color: var(--dark); }
.nb-dd-item:hover .nb-dd-icon { background: var(--yellow); color: var(--dark); }
.nb-dd-icon {
  width: 32px; height: 32px;
  background: #f5f6f8;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--gray);
  flex-shrink: 0;
  transition: all .15s;
}
.nb-dd-text { flex: 1; }
.nb-dd-text strong { display: block; font-size: .83rem; color: var(--dark); }
.nb-dd-text small { display: block; font-size: .7rem; color: var(--gray); margin-top: 1px; }
.nb-dd-arrow { font-size: .7rem; color: var(--gray); }
.nb-dd-divider { height: 1px; background: #f0f0f0; margin: 6px 4px; }

/* CTA dans dropdown */
.nb-dd-cta {
  display: flex; align-items: center; gap: 8px;
  background: var(--dark); color: var(--yellow) !important;
  border-radius: 8px; padding: 10px 12px;
  font-size: .82rem; font-weight: 800;
  text-decoration: none; transition: background .2s;
  margin: 4px 0 0;
}
.nb-dd-cta:hover { background: #111; }

/* ── FLY-OUT (sous-menu latéral) ── */
.nb-flyout-item {
  position: relative;
}
.nb-flyout {
  display: none;
  position: absolute;
  top: -6px;
  left: 100%;
  right: auto;
  background: #fff;
  border-radius: 0 12px 12px 12px;
  box-shadow: 8px 8px 32px rgba(0,0,0,.12);
  min-width: 320px;
  padding: 6px;
  padding-left: 10px;
  z-index: 2100;
  border: 1px solid rgba(0,0,0,.07);
  border-left: 2px solid var(--yellow);
  animation: dropIn .15s ease;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
/* Bridge invisible pour relier le parent au flyout */
.nb-flyout::before {
  content: '';
  position: absolute;
  top: 0;
  left: -12px;
  width: 12px;
  height: 100%;
}

.nb-flyout-item:hover > .nb-flyout,
.nb-flyout:hover { display: grid; }

.nb-flyout-item:hover > a.nb-dd-item { background: #fff8e1; }
.nb-flyout-item:hover > a.nb-dd-item .bi-chevron-right { color: var(--yellow); }

/* Mobile : fly-out ouvert via JS (classe .is-open) */
.nb-flyout.is-open { display: grid; }

/* ── SOUS-ACCORDÉON MOBILE (catégories parentes) ── */
.nbd-sub-accordion {
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.nbd-sub-acc-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 52px;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: .84rem;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all .15s;
}
.nbd-sub-acc-toggle i:first-child { font-size: .9rem; color: rgba(255,255,255,.35); flex-shrink: 0; }
.nbd-sub-acc-toggle span { flex: 1; }
.nbd-sub-acc-toggle .sub-chevron { font-size: .65rem; color: rgba(255,255,255,.25); transition: transform .2s; }
.nbd-sub-acc-toggle:hover { color: var(--yellow); background: rgba(255,255,255,.03); }
.nbd-sub-acc-toggle:hover i { color: var(--yellow); }

.nbd-sub-accordion.open .nbd-sub-acc-toggle { color: var(--yellow); }
.nbd-sub-accordion.open .nbd-sub-acc-toggle i { color: var(--yellow); }
.nbd-sub-accordion.open .sub-chevron { transform: rotate(90deg); }

.nbd-sub-acc-body {
  display: none;
  background: rgba(0,0,0,.1);
  padding: 2px 0;
}
.nbd-sub-accordion.open .nbd-sub-acc-body { display: block; }

/* Items dans sous-accordéon : indent +16px vs nbd-sub-link standard */
.nbd-sub-acc-body .nbd-sub-link {
  padding-left: 68px;
}


/* ── MOBILE DRAWER ── */
.nb-mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1040;
  backdrop-filter: blur(2px);
}
.nb-mobile-overlay.open { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0}to{opacity:1} }

.nb-mobile-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--dark);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nb-mobile-drawer.open { transform: translateX(0); }

.nbd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.nbd-close {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.08);
  border: none; border-radius: 8px;
  color: #fff; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.nbd-close:hover { background: rgba(255,255,255,.15); }

.nbd-user {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nbd-avatar {
  width: 40px; height: 40px;
  background: rgba(255,193,7,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--yellow);
}
.nbd-user-info strong { display: block; font-size: .84rem; color: #fff; font-weight: 700; }
.nbd-user-info span { font-size: .72rem; color: rgba(255,255,255,.4); }
.nbd-login-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--yellow); color: var(--dark);
  border: none; border-radius: 8px; padding: 8px 14px;
  font-size: .82rem; font-weight: 800; cursor: pointer;
  font-family: inherit; text-decoration: none; margin-left: auto;
  transition: background .2s;
}
.nbd-login-btn:hover { background: #e6ac00; color: var(--dark); }

.nbd-search { padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.nbd-search-wrap { position: relative; }
.nbd-search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.3); }
.nbd-search-input {
  width: 100%; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 9px 12px 9px 32px;
  color: #fff; font-size: .85rem; font-family: inherit;
}
.nbd-search-input::placeholder { color: rgba(255,255,255,.3); }
.nbd-search-input:focus { outline: none; border-color: var(--yellow); }

.nbd-body { flex: 1; padding: 8px 0; overflow-y: auto; }

.nbd-link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  color: rgba(255,255,255,.8);
  font-size: .88rem; font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nbd-link i { font-size: 1rem; width: 20px; text-align: center; color: rgba(255,255,255,.4); flex-shrink: 0; }
.nbd-link:hover { background: rgba(255,255,255,.04); color: var(--yellow); border-left-color: var(--yellow); }
.nbd-link:hover i { color: var(--yellow); }
.nbd-link.active { color: var(--yellow); border-left-color: var(--yellow); background: rgba(255,193,7,.05); }
.nbd-link.active i { color: var(--yellow); }
.nbd-link-count { margin-left: auto; background: rgba(255,255,255,.1); color: rgba(255,255,255,.5); font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.nbd-link--pro { background: rgba(255,193,7,.06); }
.nbd-link--pro i { color: var(--yellow); }

/* Accordéon (sous-menu mobile) */
.nbd-acc-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  color: rgba(255,255,255,.8);
  font-size: .88rem; font-weight: 600;
  cursor: pointer; width: 100%;
  background: none; border: none; border-left: 3px solid transparent;
  font-family: inherit; text-align: left;
  transition: all .15s;
}
.nbd-acc-toggle i.acc-icon { font-size: 1rem; width: 20px; text-align: center; color: rgba(255,255,255,.4); flex-shrink: 0; }
.nbd-acc-toggle .acc-chevron { margin-left: auto; font-size: .75rem; color: rgba(255,255,255,.3); transition: transform .25s; }
.nbd-acc-toggle:hover,
.nbd-accordion.open .nbd-acc-toggle { color: var(--yellow); border-left-color: var(--yellow); background: rgba(255,255,255,.04); }
.nbd-accordion.open .nbd-acc-toggle i { color: var(--yellow); }
.nbd-accordion.open .acc-chevron { transform: rotate(180deg); }

.nbd-acc-body {
  display: none;
  background: rgba(0,0,0,.15);
}
.nbd-accordion.open .nbd-acc-body { display: block; }

.nbd-sub-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 52px;
  color: rgba(255,255,255,.6);
  font-size: .82rem; font-weight: 500;
  text-decoration: none;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nbd-sub-link i { font-size: .85rem; color: rgba(255,255,255,.3); }
.nbd-sub-link:hover { color: var(--yellow); background: rgba(255,255,255,.04); border-left-color: var(--yellow); }
.nbd-sub-link:hover i { color: var(--yellow); }
.nbd-sub-link small { margin-left: auto; font-size: .68rem; color: rgba(255,255,255,.25); }

.nbd-sep { height: 1px; background: rgba(255,255,255,.06); margin: 6px 18px; }
.nbd-section-label { font-size: .62rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.25); padding: 12px 18px 4px; }

.nbd-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.nbd-footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.nbd-footer-links a { font-size: .72rem; color: rgba(255,255,255,.3); text-decoration: none; transition: color .2s; }
.nbd-footer-links a:hover { color: var(--yellow); }
.nbd-footer-trust { display: flex; align-items: center; gap: 6px; font-size: .7rem; color: rgba(255,255,255,.2); }
.nbd-footer-trust i { color: var(--yellow); }

/* ── RESPONSIVE ── */
@media (min-width: 992px) {
  .nb-hamburger { display: none !important; }
  .nb-mobile-overlay, .nb-mobile-drawer { display: none !important; }
  .nb-search-wrap { display: flex; }
}

@media (max-width: 991px) {
  .nb-nav { display: none; }
  .nb-search-wrap { display: none; }
  .nb-hamburger { display: flex; }
  .nb-right .nb-icon-btn .nb-icon-label { display: none; }
  .nb-right .nb-icon-btn { padding: 8px 9px; }
  .nb-flyout { display: none !important; }
}

@media (max-width: 479px) {
  .nb-right .nb-icon-btn:not(.nb-cart-btn):not(.nb-search-btn) { display: none; }
  .nb-icon-btn { padding: 8px 8px; }
}
