/* =============================
   Cafe Bống - Header Member Button + Notifications (B1_v8)
   Works on desktop header + mobile bar.
   ============================= */

:root{
  --cbh-accent:#e11d2e;
  --cbh-accent-soft:#ffe8eb;
  --cbh-text:#111827;
  --cbh-muted:#6b7280;
  --cbh-border:rgba(17,24,39,.12);
  --cbh-shadow:0 18px 44px rgba(0,0,0,.16);
  --cbh-radius:16px;
}

/* Button */
.cbh-user-wrap{display:inline-flex;align-items:center;}
.cbh-user-btn{
  font-family:Roboto,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:12px;
  /* thinner brown outline (per request) */
  border:1px solid rgba(111,78,55,.85);
  background:#fff;
  color:var(--cbh-text);
  cursor:pointer;
  user-select:none;
  line-height:1;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
}
.cbh-user-btn:hover{box-shadow:0 10px 22px rgba(0,0,0,.10);}
.cbh-user-btn:focus{outline:none;box-shadow:0 0 0 4px rgba(225,29,46,.14), 0 10px 22px rgba(0,0,0,.10);} 

.cbh-avatar{
  width:28px;height:28px;border-radius:999px;object-fit:cover;
  border:1px solid rgba(17,24,39,.12);
  background:#f3f4f6;
}

/* Fallback: if theme/plugin injects WP avatar classes or overrides border radius */
.cbh-user-btn img,
.cbh-user-btn .avatar,
.cbh-access-link img,
.cbh-access-link .avatar{
  width:28px;
  height:28px;
  border-radius:999px !important;
  object-fit:cover;
  display:block;
}
.cbh-name{font-weight:600;font-size:14px;max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.cbh-badge{
  min-width:18px;height:18px;border-radius:999px;
  background:var(--cbh-accent);
  color:#fff;
  font-weight:700;
  font-size:12px;
  display:inline-flex;align-items:center;justify-content:center;
  padding:0 6px;
}
.cbh-badge.is-hide{display:none;}
.cbh-caret{width:14px;height:14px;opacity:.8;}

/* Popup */
.cbh-overlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,.28);
  opacity:0;pointer-events:none;
  transition:opacity .18s ease;
  z-index:999998;
}
.cbh-overlay.is-open{opacity:1;pointer-events:auto;}

.cbh-pop{
  position:fixed;
  width:min(420px, calc(100vw - 28px));
  max-height:min(620px, calc(100vh - 90px));
  background:#fff;
  border:1px solid var(--cbh-border);
  border-radius:18px;
  box-shadow:var(--cbh-shadow);
  z-index:999999;
  opacity:0;
  transform:translateY(-6px);
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  overflow:hidden;
  font-family:Roboto,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
}
.cbh-pop.is-open{opacity:1;transform:translateY(0);pointer-events:auto;}

.cbh-pop:before{
  content:"";
  position:absolute;
  top:-8px;
  /* pointer aligned by JS via CSS var; fallback near right */
  left:var(--cbh-pointer-left, calc(100% - 44px));
  width:16px;height:16px;
  background:#fff;
  border-left:1px solid var(--cbh-border);
  border-top:1px solid var(--cbh-border);
  transform:rotate(45deg);
}

/* Quick access link (top row) */
.cbh-access{padding:12px 14px 0;}
.cbh-access-link{
  display:flex;align-items:center;gap:12px;
  border:1px solid var(--cbh-accent);
  border-radius:14px;
  padding:10px 12px;
  text-decoration:none;
  color:var(--cbh-accent);
  font-weight:600;
  background:#fff;
}
.cbh-access-link:hover{background:#fff7f8;}
.cbh-access-avatar{
  width:30px;height:30px;border-radius:999px;
  object-fit:cover;
  border:1px solid rgba(17,24,39,.12);
  background:#f3f4f6;
  flex:0 0 auto;
}
.cbh-access-text{font-size:14px;}
.cbh-access-spacer{flex:1 1 auto;}
.cbh-access-arrow svg{width:18px;height:18px;}

.cbh-head{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;
  padding:12px 14px 10px;
  border-bottom:1px solid rgba(17,24,39,.08);
}
.cbh-title{font-weight:700;font-size:16px;color:var(--cbh-text);}
.cbh-head-actions{display:flex;align-items:center;gap:10px;}
.cbh-link{
  background:transparent;border:0;padding:0;
  color:#2563eb;
  font-weight:600;
  font-size:13px;
  cursor:pointer;
}
.cbh-link:hover{text-decoration:underline;}
.cbh-x{
  width:34px;height:34px;border-radius:12px;
  border:1px solid rgba(17,24,39,.10);
  background:#fff;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.cbh-x:hover{background:#f9fafb;}

.cbh-tabs{display:flex;gap:10px;padding:10px 14px;border-bottom:1px solid rgba(17,24,39,.08);} 
.cbh-tab{
  border:1px solid rgba(17,24,39,.16);
  background:#fff;
  padding:7px 12px;
  border-radius:999px;
  font-weight:600;
  font-size:13px;
  cursor:pointer;
}
.cbh-tab.is-active{border-color:var(--cbh-accent);color:var(--cbh-accent);background:var(--cbh-accent-soft);} 

.cbh-list{padding:10px 0;overflow:auto;max-height:420px;}
.cbh-item{
  display:flex;gap:12px;
  padding:12px 14px;
  border-top:1px solid rgba(17,24,39,.06);
  text-decoration:none;
  color:inherit;
}
.cbh-item:first-child{border-top:0;}
.cbh-item:hover{background:#f9fafb;}

.cbh-ico{
  width:34px;height:34px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid rgba(17,24,39,.10);
  background:#fff;
  flex:0 0 auto;
}
.cbh-ico svg{width:18px;height:18px;}

.cbh-body{min-width:0;flex:1 1 auto;}
.cbh-msg{font-size:14px;line-height:1.35;color:var(--cbh-text);}
.cbh-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:6px;}
.cbh-time{font-size:12px;color:var(--cbh-muted);}
.cbh-detail{font-size:12px;color:#2563eb;font-weight:600;}

.cbh-dot{
  width:8px;height:8px;border-radius:999px;
  background:var(--cbh-accent);
  margin-top:4px;
}
.cbh-dot.is-hide{display:none;}

.cbh-foot{padding:12px 14px;border-top:1px solid rgba(17,24,39,.08);text-align:center;}
.cbh-closebtn{
  border:0;background:transparent;
  color:#2563eb;
  font-weight:700;
  font-size:16px;
  cursor:pointer;
}

/* Small screens: keep pointer centered */
@media (max-width:520px){
  .cbh-pop:before{left:var(--cbh-pointer-left, calc(100% - 46px));}
  .cbh-name{max-width:92px;}
}
