/* ==========================================================
   XMOKE header — mirrors xmoke.us
   grid: action-bar-left | logo | action-bar-right
   ========================================================== */
.xh{
  --xh-gap:24px;              /* desktop column gap  */
  --xh-gap-m:8px;             /* mobile column gap   */
  --xh-icon:28px;
  --xh-ink:#111111;
  --xh-muted:#666666;
  --xh-blue:#1668bb;
  --xh-line:#ededed;
  --xh-navy:#070f23;
  position:relative; z-index:120; background:#fff;
}

/* ---------- announcement ---------- */
.xh__ann{ background:var(--xh-navy); color:#fff; font-size:13px; letter-spacing:.02em; }
.xh__ann-track{
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding:10px clamp(16px,4vw,40px); text-align:center; flex-wrap:wrap;
}
.xh__dot{ opacity:.5; }

/* ---------- bar ---------- */
.xh__bar{
  display:grid;
  /* 左右等宽列 → logo 精确居中；导航在左列内靠左排列 */
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center; gap:var(--xh-gap);
  max-width:1420px; margin:0 auto;
  padding:12px clamp(16px,4vw,40px);
  border-bottom:1px solid var(--xh-line);
}
.xh__left{ justify-content:flex-start; }
.xh__right{ justify-content:flex-end; }
.xh__left{ display:flex; align-items:center; gap:14px; min-width:0; justify-self:start; }
.xh__right{ display:flex; align-items:center; gap:var(--xh-gap); min-width:0; justify-self:end; }

/* icons */
.xh__icon{
  display:inline-flex; align-items:center; justify-content:center;
  width:var(--xh-icon); height:var(--xh-icon); flex:0 0 auto;
  padding:0; border:0; background:none; color:var(--xh-ink);
  cursor:pointer; text-decoration:none; position:relative;
  transition:color .18s ease;
}
.xh__icon:hover{ color:var(--xh-blue); }
.xh__icon svg{ width:100%; height:100%; display:block; }
.xh__burger, .xh__search-mobile{ display:none; }

/* cart bubble */
.xh__cart{ position:relative; }
.xh__count{
  position:absolute; bottom:1px; left:13px; z-index:1;
  min-width:20px; max-width:60px; padding-inline:6px;
  line-height:20px; font-size:11px; font-style:normal;
  color:#fff; background:var(--xh-blue);
  border-radius:999px; text-align:center; white-space:nowrap; overflow:hidden;
}
.xh__count:empty, .xh__count[data-empty="1"]{ display:none; }

/* logo */
.xh__logo{
  font-family:"Baloo Bhaijaan 2",Montserrat,sans-serif;
  font-size:28px; font-weight:700; letter-spacing:-.01em;
  color:var(--xh-ink); text-decoration:none; line-height:1;
  justify-self:center; white-space:nowrap;
}

/* ---------- nav ---------- */
.xh__nav{ min-width:0; }
.xh__menu{ display:flex; align-items:center; flex-wrap:nowrap; list-style:none; margin:0; padding:0; }
.xh__item{ position:relative; margin-inline:16px; min-height:26px; box-sizing:content-box; }
.xh__item > a{
  display:inline-flex; align-items:center; height:100%;
  padding:12px 0; color:var(--xh-ink);
  font-size:14px; font-weight:600; text-decoration:none; white-space:nowrap;
  position:relative; z-index:2;
}
.xh__item > a:hover{ color:var(--xh-blue); }

/* underline indicator */
.xh__item > a::after{
  content:""; position:absolute; left:0; right:0; bottom:8px; height:2px;
  background:var(--xh-blue); transform:scaleX(0); transform-origin:center;
  transition:transform .22s ease;
}
.xh__item > a:hover::after{ transform:scaleX(1); }

/* ---------- dropdown ---------- */
.xh__drop{
  position:absolute; top:100%; left:50%; transform:translate(-50%,6px);
  min-width:240px; padding:10px 0;
  background:#fff; box-shadow:0 5px 20px 0 rgb(0 0 0 / 12%);
  border-radius:0 0 10px 10px;
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .2s ease, transform .2s ease, visibility .2s;
  z-index:130;
}
.xh__has-drop:hover > .xh__drop,
.xh__has-drop:focus-within > .xh__drop{
  opacity:1; visibility:visible; pointer-events:auto;
  transform:translate(-50%,0);
}
.xh__drop-menu{ list-style:none; margin:0; padding:0; }
.xh__drop-menu a{
  display:block; padding:10px 20px;
  font-size:13px; font-weight:500; letter-spacing:.02em;
  color:var(--xh-ink); text-decoration:none; white-space:nowrap;
  transition:color .15s ease, background .15s ease;
}
.xh__drop-menu a:hover{ color:var(--xh-blue); background:#f9f8f2; }

/* ---------- search panel ---------- */
.xh__search-panel{
  position:absolute; inset-inline:0; top:100%; z-index:140;
  background:#fff; border-bottom:1px solid var(--xh-line);
  box-shadow:0 8px 24px rgb(0 0 0 / 8%);
  max-height:0; overflow:hidden; opacity:0;
  transition:max-height .28s ease, opacity .2s ease;
}
.xh__search-panel.is-open{ max-height:140px; opacity:1; }
.xh__search-form{
  display:flex; align-items:center; gap:12px;
  max-width:1420px; margin:0 auto; padding:18px clamp(16px,4vw,40px);
}
.xh__search-form-icon{ width:22px; height:22px; flex:0 0 auto; color:var(--xh-muted); }
.xh__search-form input[type="search"]{
  flex:1; min-width:0; padding:12px 4px; font-size:16px; font-family:inherit;
  color:var(--xh-ink); border:0; border-bottom:1px solid var(--xh-line);
  background:transparent; outline:none;
}
.xh__search-form input[type="search"]:focus{ border-bottom-color:var(--xh-blue); }
.xh__search-close{
  width:32px; height:32px; border:0; background:none; cursor:pointer;
  font-size:24px; line-height:1; color:var(--xh-muted); flex:0 0 auto;
}
.xh__search-close:hover{ color:var(--xh-ink); }

/* ---------- drawer (mobile) ---------- */
.xh__drawer{
  position:fixed; top:0; bottom:0; left:0; z-index:160;
  width:min(86vw,340px); background:#fff;
  transform:translateX(-100%); transition:transform .28s ease;
  display:flex; flex-direction:column; overflow-y:auto;
  box-shadow:0 0 32px rgb(0 0 0 / 18%);
}
.xh__drawer.is-open{ transform:translateX(0); }
.xh__drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--xh-line);
  font-size:14px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
}
.xh__drawer-head button{
  width:32px; height:32px; border:0; background:none; cursor:pointer;
  font-size:26px; line-height:1; color:var(--xh-muted);
}
.xh__drawer-nav{ display:flex; flex-direction:column; padding:8px 0 40px; }
.xh__drawer-nav a, .xh__drawer-nav summary{
  padding:14px 20px; font-size:15px; font-weight:600; color:var(--xh-ink);
  text-decoration:none; cursor:pointer; list-style:none;
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid #f5f5f5;
}
.xh__drawer-nav summary::-webkit-details-marker{ display:none; }
.xh__drawer-nav summary::after{
  content:"+"; font-size:18px; color:var(--xh-muted); font-weight:400;
}
.xh__drawer-nav details[open] summary::after{ content:"−"; }
.xh__drawer-nav details a{
  padding-left:34px; font-size:14px; font-weight:500; color:var(--xh-muted);
  border-bottom:0;
}
.xh__drawer-nav details a:hover{ color:var(--xh-blue); }

.xh__scrim{
  position:fixed; inset:0; z-index:150; background:rgb(0 0 0 / 45%);
  opacity:0; visibility:hidden; transition:opacity .25s ease, visibility .25s;
}
.xh__scrim.is-open{ opacity:1; visibility:visible; }

/* ---------- responsive ---------- */
@media (max-width:1100px){
  .xh{ --xh-gap:14px; }
  .xh__item{ margin-inline:10px; }
  .xh__item > a{ font-size:13px; }
}
@media (max-width:959px){
  .xh{ --xh-gap:var(--xh-gap-m); }
  .xh__bar{ gap:10px; padding:10px 16px; }
  .xh__nav{ display:none; }
  .xh__burger{ display:inline-flex; }
  .xh__search-desktop{ display:none; }
  .xh__search-mobile{ display:inline-flex; }
  .xh__logo{ font-size:24px; }
  .xh__ann-track{ font-size:12px; padding:8px 12px; }
  .xh__left{ gap:6px; }
  .xh__right{ gap:10px; }
}
@media (max-width:479px){
  .xh__logo{ font-size:21px; }
  .xh__icon{ width:26px; height:26px; }
  .xh__count{ left:11px; min-width:18px; line-height:18px; font-size:10px; }
  .xh__ann-track{ flex-direction:column; gap:2px; }
  .xh__dot{ display:none; }
}

/* admin bar offset */
body.admin-bar .xh__drawer{ top:32px; }

/* sticky-friendly */
.xh__bar{ background:#fff; }

/* grid alignment final */
.xh__bar > .xh__left{ justify-self:start !important; justify-content:flex-start !important; }
.xh__bar > .xh__logo{ justify-self:center !important; }
.xh__bar > .xh__right{ justify-self:end !important; justify-content:flex-end !important; }

/* 小屏：压缩右列图标间距，保证三个图标完整可见 */
@media (max-width:479px){
  .xh__bar{ gap:6px !important; padding:10px 12px !important; }
  .xh__right{ gap:6px !important; }
  .xh__icon{ width:24px !important; height:24px !important; }
  .xh__logo{ font-size:20px !important; }
  .xh__count{ left:10px; min-width:16px; line-height:16px; font-size:9px; padding-inline:4px; }
}
@media (max-width:360px){
  .xh__right{ gap:4px !important; }
  .xh__icon{ width:22px !important; height:22px !important; }
  .xh__logo{ font-size:18px !important; }
}
