/* ==========================
   HEADER
========================== */
.site-header { position: sticky; top: 0; z-index: 60; }

.header-bar {
  position: relative;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(18, 20, 38, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 180ms ease;
}

.site-header.is-scrolled .header-bar { background: rgba(18, 20, 38, 0.58); }

.header-wrap {
  width: min(var(--wrap), calc(100% - (var(--pad-x) * 2)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.header-left{
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
}

.nav-left { display: flex; gap: 18px; align-items: center; }

.nav-link {
  font-family: "Cinzel", serif;
  font-size: 18px;
  opacity: 0.95;
  letter-spacing: 2px;
  color: var(--nav);
}
.nav-link:hover { color: var(--accent); }

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.logo img {
  display: block;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35));
}

.header-right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.nav-right { display: flex; gap: 12px; align-items: center; }

.header-balance { display: none; width: 44px; height: 44px; }

/* ==========================
   SORTED/STAFF HEADER UI
========================== */
/* Dropdown behavior — flush + hover bridge */
.nav-left .nav-item{
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: -12px;
}

.nav-left .nav-site{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-left .caret{ width: 10px; height: 10px; opacity: .9; }

.nav-dropdown{
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(22, 26, 40, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  display: none;
  z-index: 9999;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown,
.nav-item.is-open .nav-dropdown{ display: block; }

.nav-dropdown a{
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  opacity: .95;
  font-family: "Cinzel", serif;
  letter-spacing: 1.4px;
  color: var(--nav);
}
.nav-dropdown a:hover{
  background: rgba(255,255,255,0.08);
  color: var(--accent);
  opacity: 1;
}

/* Center logo + search */
.brand-center{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* Owl Search */
.owl-search{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.owl-search input{
  width: 260px;
  max-width: 34vw;
  background: transparent;
  border: 0;
  outline: none;
  color: inherit;
  font: inherit;
}
.owl-search input::placeholder{ opacity: .7; }
.owl-search .owl-search-btn{
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  opacity: .9;
}
.owl-search .owl-search-btn:hover{ opacity: 1; }
.owl-search svg{ width: 18px; height: 18px; }

/* Icon bar */
.hix-iconbar{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: 10px;
}
.hix-iconbtn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
  color: inherit;
  padding: 0;
  opacity: .95;
}
.hix-iconbtn:hover{ opacity: 1; background: rgba(255,255,255,0.06); }
.hix-iconbtn svg{ width: 18px; height: 18px; }

.hix-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255,255,255,0.20);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Popover panels */
.hix-popwrap{ position: relative; display: inline-flex; }
.hix-pop{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-width: 80vw;
  max-height: 320px;
  overflow: auto;
  border-radius: 16px;
  background: rgba(22, 26, 40, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  padding: 10px;
  display: none;
  z-index: 9999;
}
.hix-popwrap.is-open .hix-pop{ display: block; }
.hix-pop h4{
  margin: 6px 10px 10px;
  font-size: 14px;
  opacity: .9;
  font-family: "Cinzel", serif;
  letter-spacing: 1px;
}
.hix-pop .hix-pop-item{
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  opacity: .95;
  color: inherit;
}
.hix-pop .hix-pop-item:hover{ background: rgba(255,255,255,0.08); opacity: 1; }
.hix-pop .meta{ font-size: 12px; opacity: .75; margin-top: 2px; }

/* ==========================
   MOBILE NAV BUTTONS
========================== */
.nav-toggle, .mega-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
  transition: transform 0.12s ease, background 180ms ease;
}

.mega-toggle{ color: rgba(255,255,255,0.82); }
.mega-toggle:hover{ color: rgba(255,255,255,0.98); }
.mega-toggle svg{ opacity: 1; }

.nav-toggle:hover, .mega-toggle:hover { transform: translateY(-1px); }

.nav-toggle .bars { width: 18px; height: 12px; position: relative; }
.nav-toggle .bars span{
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
}
.nav-toggle .bars span:nth-child(1){ top: 0; }
.nav-toggle .bars span:nth-child(2){ top: 5px; opacity: 0.9; }
.nav-toggle .bars span:nth-child(3){ top: 10px; opacity: 0.82; }

.mega-toggle svg{ width: 18px; height: 18px; opacity: .9; }

/* ==========================
   OVERLAY + DRAWERS (TOOLS + MEGA)
========================== */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 80;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(420px, 92vw);
  transform: translateX(110%);
  transition: transform 220ms ease;
  background: rgba(18, 20, 38, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255,255,255,0.12);
  z-index: 90;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer.is-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.drawer-title{
  font-family: "Cinzel", serif;
  letter-spacing: 1.6px;
  color: var(--accent);
  font-size: 16px;
  opacity: 0.95;
}

.drawer-close {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drawer-close::before{
  content: "✕";
  font-size: 16px;
  opacity: 0.85;
  color: #fff;
}

/* Drawer search */
.drawer-search{
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.drawer-search input{
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: inherit;
}
.drawer-search button{ background: none; border: 0; cursor: pointer; color: inherit; opacity: .9; }
.drawer-search button:hover{ opacity: 1; }
.drawer-search svg{ width: 18px; height: 18px; }

/* Mega sections */
.drawer-mega{ overflow: auto; padding-right: 2px; }

.drawer-mega .mega-section{
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.drawer-mega .mega-title{
  padding: 12px 12px;
  font-family: "Cinzel", serif;
  letter-spacing: 1.4px;
  opacity: .95;
  display:flex;
  justify-content: space-between;
  align-items:center;
}

.drawer-mega .mega-links{
  border-top: 1px solid rgba(255,255,255,0.08);
  display: grid;
}
.drawer-mega .mega-links a{
  padding: 12px 12px;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0;
  color: rgba(255,255,255,0.88);
}
.drawer-mega .mega-links a:hover{ background: rgba(255,255,255,0.08); color: #fff; }

/* Tools drawer content */
.drawer-iconrow{ display:flex; gap: 10px; justify-content: center; }
.drawer-iconrow .hix-iconbtn{ width: 44px; height: 44px; }

.drawer-actions{
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.drawer-actions .btn{ width: 100%; justify-content: center; }

body.overlay-open .nav-overlay { display: block; }

/* ==========================
   RESPONSIVE (HEADER)
========================== */
/* Earlier “mobile header” breakpoint to eliminate ~1045px overflow */
@media (max-width: 1100px) {
  .header-wrap{
    width: calc(100% - (var(--pad-x) * 2));
    grid-template-columns: auto 1fr auto;
  }
  .nav-left{ display: none; }
  .nav-right{ display: none; }
  .owl-search{ display: none; }
  .nav-toggle{ display: inline-flex; }
  .mega-toggle{ display: inline-flex; }
  .header-balance{ display: block; }
}

@media (max-width: 860px) {
  .nav-link { font-size: 16px; letter-spacing: 1.6px; }
  .logo img { max-height: 52px; }
}

@media (max-width: 720px) {
  .header-bar{ min-height: var(--header-h); padding: 8px 0; }
  .logo img{ max-height: 40px; }
}
