
/* v1.8.7 Header Flow Lock — logo + menu + icon-only actions */

:root {
  --ncr-h187-bg: rgba(24, 13, 8, .94);
  --ncr-h187-bg-light: rgba(255, 247, 237, .94);
  --ncr-h187-border: rgba(245, 170, 61, .18);
  --ncr-h187-text: #fff4e5;
  --ncr-h187-muted: rgba(255,244,229,.72);
  --ncr-h187-accent: #ed7a1e;
  --ncr-h187-rust: #a8321b;
}

.ncr-v187-header {
  position: sticky;
  top: 0;
  z-index: 9990;
  width: 100%;
  background: var(--ncr-h187-bg);
  border-bottom: 1px solid var(--ncr-h187-border);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

body.admin-bar .ncr-v187-header {
  top: 32px;
}

.ncr-v187-header-inner {
  width: min(1440px, calc(100% - 1.5rem));
  min-height: 78px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 330px) minmax(0, 1fr) auto;
  gap: clamp(.75rem, 1.4vw, 1.25rem);
  align-items: center;
  position: relative;
}

.ncr-v187-logo-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
}

.ncr-v187-logo-wrap .brand-lockup {
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) !important;
  gap: .72rem !important;
  align-items: center !important;
  text-decoration: none !important;
  color: var(--ncr-h187-text) !important;
  max-width: 100% !important;
}

.ncr-v187-logo-wrap .brand-icon-wrap {
  width: 52px !important;
  height: 52px !important;
  border-radius: 17px !important;
  display: grid !important;
  place-items: center !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  overflow: hidden !important;
  flex: 0 0 52px !important;
}

.ncr-v187-logo-wrap .brand-icon {
  width: 44px !important;
  height: 44px !important;
  object-fit: contain !important;
  display: block !important;
}

.ncr-v187-logo-wrap .brand-copy {
  min-width: 0 !important;
  display: grid !important;
  gap: .08rem !important;
}

.ncr-v187-logo-wrap .brand-title {
  color: var(--ncr-h187-text) !important;
  font-size: clamp(1rem, .95rem + .28vw, 1.22rem) !important;
  font-weight: 950 !important;
  letter-spacing: -.035em !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.ncr-v187-logo-wrap .brand-subtitle {
  color: var(--ncr-h187-muted) !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: .02em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.ncr-v187-menu {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-width: 0;
  padding: .35rem;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
}

.ncr-v187-menu a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .56rem .82rem;
  border-radius: 999px;
  color: rgba(255,244,229,.82) !important;
  text-decoration: none !important;
  font-weight: 850;
  font-size: clamp(.78rem, .72rem + .22vw, .92rem);
  line-height: 1;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.ncr-v187-menu a:hover,
.ncr-v187-menu a:focus-visible {
  color: #fff !important;
  background: rgba(237,122,30,.22);
  transform: translateY(-1px);
}

.ncr-v187-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .42rem;
  min-width: max-content;
}

.ncr-v187-icon-btn,
.ncr-v187-avatar-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 999px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: rgba(255,255,255,.075) !important;
  color: var(--ncr-h187-text) !important;
  text-decoration: none !important;
  padding: 0 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  line-height: 1 !important;
  transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}

.ncr-v187-icon-btn svg {
  width: 20px !important;
  height: 20px !important;
  display: block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.25 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.ncr-v187-icon-btn:hover,
.ncr-v187-icon-btn:focus-visible,
.ncr-v187-avatar-btn:hover,
.ncr-v187-avatar-btn:focus-visible {
  background: linear-gradient(135deg, var(--ncr-h187-rust), var(--ncr-h187-accent)) !important;
  border-color: rgba(255,255,255,.22) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.ncr-v187-avatar-btn img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 999px !important;
  object-fit: cover !important;
  display: block !important;
  border: 2px solid rgba(255,255,255,.7);
}

.ncr-v187-menu-toggle {
  display: none !important;
}

/* Mobile navigation */
.ncr-v187-mobile-nav {
  position: absolute;
  top: calc(100% + .65rem);
  right: 0;
  width: min(360px, calc(100vw - 1.5rem));
  padding: .75rem;
  border-radius: 24px;
  border: 1px solid rgba(245,170,61,.22);
  background: rgba(24, 13, 8, .98);
  box-shadow: 0 24px 70px rgba(0,0,0,.34);
  display: none;
  grid-template-columns: 1fr;
  gap: .35rem;
}

.ncr-v187-mobile-nav.open {
  display: grid !important;
}

.ncr-v187-mobile-nav a {
  min-height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: .75rem .9rem;
  color: rgba(255,244,229,.88) !important;
  text-decoration: none !important;
  font-weight: 900;
  background: rgba(255,255,255,.045);
}

.ncr-v187-mobile-nav a:hover,
.ncr-v187-mobile-nav a:focus-visible {
  color: #fff !important;
  background: rgba(237,122,30,.22);
}

/* Dark/light compatibility */
html[data-theme="light"] .ncr-v187-header {
  background: var(--ncr-h187-bg-light);
  border-bottom-color: rgba(168,50,27,.16);
  box-shadow: 0 12px 30px rgba(69,32,12,.10);
}

html[data-theme="light"] .ncr-v187-logo-wrap .brand-title,
html[data-theme="light"] .ncr-v187-icon-btn,
html[data-theme="light"] .ncr-v187-avatar-btn {
  color: #21150f !important;
}

html[data-theme="light"] .ncr-v187-logo-wrap .brand-subtitle,
html[data-theme="light"] .ncr-v187-menu a {
  color: rgba(33,21,15,.72) !important;
}

html[data-theme="light"] .ncr-v187-logo-wrap .brand-icon-wrap,
html[data-theme="light"] .ncr-v187-menu,
html[data-theme="light"] .ncr-v187-icon-btn,
html[data-theme="light"] .ncr-v187-avatar-btn {
  background: rgba(168,50,27,.06) !important;
  border-color: rgba(168,50,27,.13) !important;
}

html[data-theme="light"] .ncr-v187-menu a:hover,
html[data-theme="light"] .ncr-v187-menu a:focus-visible {
  color: #a8321b !important;
  background: rgba(237,122,30,.13);
}

html[data-theme="light"] .ncr-v187-mobile-nav {
  background: rgba(255,247,237,.98);
  border-color: rgba(168,50,27,.15);
}

html[data-theme="light"] .ncr-v187-mobile-nav a {
  color: rgba(33,21,15,.78) !important;
  background: rgba(168,50,27,.06);
}

/* Admin bar safe */
@media (max-width: 782px) {
  body.admin-bar .ncr-v187-header {
    top: 46px;
  }
}

/* Breakpoints */
@media (max-width: 1180px) {
  .ncr-v187-header-inner {
    grid-template-columns: minmax(210px, 310px) 1fr auto;
  }

  .ncr-v187-menu a {
    padding-inline: .62rem;
  }
}

@media (max-width: 1060px) {
  .ncr-v187-menu {
    display: none;
  }

  .ncr-v187-menu-toggle {
    display: inline-grid !important;
  }

  .ncr-v187-header-inner {
    grid-template-columns: minmax(190px, 1fr) auto;
  }
}

@media (max-width: 620px) {
  .ncr-v187-header-inner {
    width: min(100% - .8rem, 1440px);
    min-height: 68px;
    gap: .5rem;
  }

  .ncr-v187-logo-wrap .brand-lockup {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: .52rem !important;
  }

  .ncr-v187-logo-wrap .brand-icon-wrap {
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
  }

  .ncr-v187-logo-wrap .brand-icon {
    width: 38px !important;
    height: 38px !important;
  }

  .ncr-v187-logo-wrap .brand-subtitle {
    display: none !important;
  }

  .ncr-v187-icon-btn,
  .ncr-v187-avatar-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  .ncr-v187-actions {
    gap: .28rem;
  }

  .ncr-v187-actions > .ncr-v187-icon-btn:nth-child(2),
  .ncr-v187-actions > .ncr-v187-icon-btn:nth-child(3) {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .ncr-v187-logo-wrap .brand-title {
    max-width: 145px;
  }

  .ncr-v187-actions {
    gap: .22rem;
  }
}
