/* ============================================================
   CreditArena — Canonical navigation + mobile menu
   Synced across every page. Loaded last in <head> so it wins
   over any page-level inline nav CSS.
   `.nav` position/top is intentionally NOT set here — each page
   keeps its own (fixed on the homepage, sticky on inner pages).
   ============================================================ */

.nav {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(229, 231, 235, .8);
  transition: background .3s, box-shadow .3s;
}
.nav.scrolled {
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 12px rgba(15, 23, 42, .06);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.logo { display: flex; align-items: center; }
.logo img { height: 30px; width: auto; display: block; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.nav-link {
  display: inline-flex; align-items: center;
  padding: 8px 16px; border-radius: 10px;
  font-size: .875rem; font-weight: 600; line-height: 1.65;
  color: var(--text-mid); text-decoration: none;
  transition: color .3s, background .3s;
}
.nav-link:hover { color: var(--accent); background: var(--accent-light); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-phone {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; color: var(--text-mid);
}
.nav-phone svg { width: 17px; height: 17px; }
.nav-cta-btn {
  background: var(--accent); color: #fff;
  padding: 9px 20px; border-radius: 50px;
  font-size: .84rem; font-weight: 700; text-decoration: none;
  transition: background .3s, transform .15s; white-space: nowrap;
}
.nav-cta-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.hamburger {
  display: none; width: 36px; height: 36px;
  align-items: center; justify-content: center;
  color: var(--text-mid); border-radius: 8px;
  background: none; border: none; cursor: pointer;
}
.hamburger:hover { background: var(--bg-warm); }

/* ---- Desktop dropdown ("За кого е") ---- */
/* display:flex + align-items:center keeps the toggle button vertically
   centred despite the 8px hover-bridge padding below it. */
.nav-item-dd { position: relative; display: flex; align-items: center; padding: 0; }
/* invisible hover bridge — keeps the menu open while the cursor
   crosses the gap between toggle and dropdown */
.nav-item-dd::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%;
  height: 10px;
}
.nav-dd-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; background: none; border: none; font-family: inherit;
  padding: 8px 16px; border-radius: 10px;
  font-size: .875rem; font-weight: 600; line-height: 1.65; color: var(--text-mid);
  transition: color .3s, background .3s;
}
.nav-dd-toggle:hover { color: var(--accent); background: var(--accent-light); }
.nav-dd-toggle svg { transition: transform .2s; opacity: .65; }
.nav-item-dd.open .nav-dd-toggle svg { transform: rotate(180deg); }
.nav-dd-menu {
  position: absolute; top: calc(100% + 6px); left: -8px;
  min-width: 260px; background: #fff;
  border: 1px solid var(--border); border-radius: 14px; padding: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .04);
  list-style: none; margin: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 200;
}
.nav-item-dd:hover .nav-dd-menu,
.nav-item-dd:focus-within .nav-dd-menu,
.nav-item-dd.open .nav-dd-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0);
}
.nav-dd-menu li a {
  display: block; padding: 10px 14px;
  font-size: .86rem; font-weight: 600;
  color: var(--text); border-radius: 8px; text-decoration: none;
  transition: background .3s, color .3s;
}
.nav-dd-menu li a:hover { background: var(--accent-light); color: var(--accent); }

/* ---- Многоколонно меню ("За кого е") ---- */
.nav-dd-mega { display: flex; gap: 4px; min-width: 440px; }
.nav-dd-col { flex: 1; min-width: 196px; }
.nav-dd-col ul { list-style: none; margin: 0; padding: 0; }
.nav-dd-label {
  padding: 7px 14px 4px;
  font-size: .67rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-light);
}
/* дясно подравнено меню (последна точка) */
.nav-dd-menu--right { left: auto; right: -8px; }

/* ---- Mobile drawer ---- */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 2000;
  pointer-events: none; visibility: hidden;
}
.mobile-drawer.open { pointer-events: all; visibility: visible; }
.mobile-overlay {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .45);
  opacity: 0; transition: opacity .3s;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.mobile-drawer.open .mobile-overlay { opacity: 1; }
.mobile-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(312px, 85vw); background: var(--card);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 48px rgba(15, 23, 42, .18);
}
.mobile-drawer.open .mobile-panel { transform: translateX(0); }
.mobile-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mobile-panel-head img { height: 30px; width: auto; }
.mobile-close-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-warm); color: var(--text-mid);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; font-family: inherit; flex-shrink: 0;
}
.mobile-nav-items {
  padding: 10px; flex: 1;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.mobile-nav-item {
  display: block; padding: 11px 14px;
  font-size: .95rem; font-weight: 600; color: var(--text);
  border-radius: 10px; text-decoration: none;
  transition: background .2s, color .2s;
}
.mobile-nav-item:hover { background: var(--bg-warm); color: var(--accent); }
.mobile-sub-item {
  padding-left: 26px; font-weight: 500;
  font-size: .89rem; color: var(--text-mid);
}
.mobile-sub-item:hover { color: var(--accent); }
.mobile-nav-label {
  padding: 13px 14px 4px;
  font-size: .69rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-light);
}
.mobile-acc-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 11px 14px;
  font-size: .95rem; font-weight: 600; color: var(--text);
  font-family: inherit; border-radius: 10px; cursor: pointer;
  background: none; border: none;
  transition: background .2s, color .2s;
}
.mobile-acc-btn:hover { background: var(--bg-warm); color: var(--accent); }
.mobile-acc-chevron { transition: transform .25s; flex-shrink: 0; }
.mobile-acc.open > .mobile-acc-btn { color: var(--accent); }
.mobile-acc.open .mobile-acc-chevron { transform: rotate(180deg); }
.mobile-acc-panel {
  max-height: 0; overflow: hidden; visibility: hidden;
  transition: max-height .3s cubic-bezier(.4, 0, .2, 1), visibility .3s;
}
.mobile-acc.open .mobile-acc-panel { max-height: 720px; visibility: visible; }
.mobile-panel-footer {
  padding: 13px 16px; border-top: 1px solid var(--border);
  flex-shrink: 0; display: flex; flex-direction: column; gap: 9px;
}
.mobile-phone {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; font-size: .9rem; font-weight: 700; color: var(--text-mid);
  border: 1px solid var(--border); border-radius: 11px; text-decoration: none;
  transition: color .2s, border-color .2s;
}
.mobile-phone:hover { color: var(--accent); border-color: var(--accent); }
.mobile-cta {
  display: block; width: 100%; padding: 14px;
  background: var(--accent); color: #fff;
  font-size: .95rem; font-weight: 700; text-align: center;
  border-radius: 12px; text-decoration: none;
  transition: background .25s;
}
.mobile-cta:hover { background: var(--accent-dark); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .nav-links, .nav-cta-btn, .nav-item-dd { display: none; }
  .nav-phone { display: flex; }
  .hamburger { display: flex; }
  .nav-inner { height: 60px; }
  .logo img { height: 28px; }
}

/* ---- A11y: 44px tap targets + keyboard focus ----
   Tap-area is grown via a transparent absolutely-positioned ::before so the
   visible icon/button stays 36px — no layout shift, invisible on touch.
   :focus-visible adds an accent outline only for keyboard navigation
   (never on mouse/touch). Inputs keep their own glow focus style. */
.nav-phone, .hamburger, .mobile-close-btn { position: relative; }
.nav-phone::before, .hamburger::before, .mobile-close-btn::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px;
}
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* a11y skip-link (hidden until focus) */
.skip-link{position:absolute;left:-9999px;top:0;background:var(--accent,#EA580C);color:#fff;padding:10px 16px;z-index:100001;border-radius:0 0 8px 0;font-weight:700}
.skip-link:focus{left:0}
