/* =================================================================
   BestLand — Popup Cá Nhân Hóa · styles
   ================================================================= */

/* ---- Tokens ------------------------------------------------------ */
#bl-personalize, .bl-overlay, .bl-fab {
  --paper:#f4f1ea; --surface:#ffffff; --surface-2:#faf8f3;
  --ink:#15241f; --ink-soft:#5c6660; --ink-faint:#8a938d;
  --line:#e4ded2; --line-strong:#d6cfbf;
  --brand:#0e6b51; --brand-strong:#0a5540; --brand-tint:#e7f1ec;
  --gold:#a9782a; --gold-tint:#f4ead4;
  --danger:#b23b2e;
  --shadow:0 24px 60px -20px rgba(20,35,30,.45), 0 8px 22px -12px rgba(20,35,30,.28);
  --r:16px; --r-sm:11px;
  --sans:"Be Vietnam Pro","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;
}
@media (prefers-color-scheme:dark){
  #bl-personalize, .bl-overlay, .bl-fab{
    --paper:#0e1512; --surface:#161f1b; --surface-2:#111a16;
    --ink:#eef3f0; --ink-soft:#9caaa3; --ink-faint:#6f7d76;
    --line:#26322c; --line-strong:#31403a;
    --brand:#39b78e; --brand-strong:#57cba3; --brand-tint:#12312a;
    --gold:#d8ab5b; --gold-tint:#2c2415;
    --shadow:0 26px 64px -20px rgba(0,0,0,.7), 0 8px 22px -12px rgba(0,0,0,.5);
  }
}

/* ---- Overlay + card --------------------------------------------- */
.bl-overlay{
  position:fixed; inset:0; z-index:2147483000;
  display:flex; align-items:center; justify-content:center;
  padding:20px;
  background:rgba(18,28,24,.52); backdrop-filter:blur(4px);
  font-family:var(--sans);
  opacity:0; visibility:hidden; transition:opacity .28s ease, visibility .28s ease;
}
.bl-overlay.bl-open{ opacity:1; visibility:visible; }
.bl-overlay *{ box-sizing:border-box; }

.bl-card{
  width:min(560px,100%); max-height:min(88vh,760px);
  display:flex; flex-direction:column;
  background:var(--surface); color:var(--ink);
  border:1px solid var(--line);
  border-radius:var(--r); box-shadow:var(--shadow);
  overflow:hidden;
  transform:translateY(14px) scale(.985); opacity:0;
  transition:transform .3s cubic-bezier(.22,1,.36,1), opacity .3s ease;
}
.bl-overlay.bl-open .bl-card{ transform:none; opacity:1; }
@media (prefers-reduced-motion:reduce){
  .bl-overlay,.bl-card{ transition:none; }
}

/* ---- Header ----------------------------------------------------- */
.bl-head{
  position:relative; padding:26px 26px 20px;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--brand-tint) 0%, transparent 58%),
    var(--surface);
  border-bottom:1px solid var(--line);
}
.bl-eyebrow{
  display:inline-flex; align-items:center; gap:7px;
  font-size:11px; font-weight:700; letter-spacing:.14em; text-transform:uppercase;
  color:var(--brand-strong); margin:0 0 10px;
}
.bl-eyebrow svg{ width:14px; height:14px; }
.bl-title{ margin:0; font-size:24px; line-height:1.15; font-weight:800; letter-spacing:-.01em; text-wrap:balance; }
.bl-sub{ margin:8px 0 0; font-size:14px; line-height:1.5; color:var(--ink-soft); max-width:44ch; }
.bl-x{
  position:absolute; top:16px; right:16px;
  width:34px; height:34px; display:grid; place-items:center;
  border:1px solid var(--line); border-radius:9px; background:var(--surface-2);
  color:var(--ink-soft); cursor:pointer; transition:.15s;
}
.bl-x:hover{ color:var(--ink); border-color:var(--line-strong); }
.bl-x svg{ width:16px; height:16px; }

/* ---- Body / sections -------------------------------------------- */
.bl-body{ padding:8px 26px 22px; overflow-y:auto; overscroll-behavior:contain; }
.bl-sec{ padding:18px 0; border-bottom:1px dashed var(--line); }
.bl-sec:last-child{ border-bottom:0; }
.bl-sec-head{ display:flex; align-items:baseline; gap:10px; margin-bottom:13px; }
.bl-num{
  font-size:11px; font-weight:700; color:var(--ink-faint);
  font-variant-numeric:tabular-nums; letter-spacing:.06em; min-width:20px;
}
.bl-label{ font-size:13.5px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; color:var(--ink); }
.bl-count{
  margin-left:auto; font-size:11.5px; font-weight:700; color:var(--ink-faint);
  font-variant-numeric:tabular-nums; padding:2px 9px; border-radius:20px;
  background:var(--surface-2); border:1px solid var(--line); transition:.18s; white-space:nowrap;
}
.bl-count.bl-full{ color:var(--gold); background:var(--gold-tint); border-color:transparent; }
.bl-count.bl-pulse{ animation:bl-pulse .4s ease; }
@keyframes bl-pulse{ 0%{transform:scale(1)} 40%{transform:scale(1.14)} 100%{transform:scale(1)} }

.bl-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.bl-chip{
  font:inherit; font-size:13.5px; font-weight:600; line-height:1;
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 14px; border-radius:999px; cursor:pointer;
  color:var(--ink); background:var(--surface); border:1.5px solid var(--line-strong);
  transition:background .15s, border-color .15s, color .15s, transform .08s;
}
.bl-chip:hover{ border-color:var(--brand); }
.bl-chip:active{ transform:scale(.97); }
.bl-chip .bl-tick{ width:0; height:14px; overflow:hidden; opacity:0; transition:.16s; margin-left:-6px; }
.bl-chip.bl-on{ color:var(--brand-strong); background:var(--brand-tint); border-color:var(--brand); }
.bl-chip.bl-on .bl-tick{ width:14px; opacity:1; margin-left:0; }
.bl-chip .bl-tick svg{ width:14px; height:14px; display:block; }
.bl-chip:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

/* ---- Region picker (04) ----------------------------------------- */
.bl-search{ position:relative; margin-bottom:12px; }
.bl-search svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--ink-faint); }
.bl-search input{
  width:100%; font:inherit; font-size:14px; color:var(--ink);
  padding:11px 14px 11px 36px; border-radius:var(--r-sm);
  background:var(--surface-2); border:1.5px solid var(--line);
}
.bl-search input::placeholder{ color:var(--ink-faint); }
.bl-search input:focus{ outline:none; border-color:var(--brand); background:var(--surface); }
.bl-region-selected{ display:flex; flex-wrap:wrap; gap:7px; margin-bottom:10px; }
.bl-region-selected:empty{ display:none; }
.bl-tag{
  font-size:12.5px; font-weight:600; display:inline-flex; align-items:center; gap:6px;
  padding:6px 8px 6px 11px; border-radius:8px;
  color:var(--brand-strong); background:var(--brand-tint); border:1px solid var(--brand);
}
.bl-tag button{ font:inherit; cursor:pointer; border:0; background:transparent; color:inherit; display:grid; place-items:center; padding:0; opacity:.7; }
.bl-tag button:hover{ opacity:1; }
.bl-tag button svg{ width:13px; height:13px; }
.bl-region-list{ display:flex; flex-wrap:wrap; gap:7px; max-height:150px; overflow-y:auto; padding:2px; }
.bl-region-list .bl-chip{ font-size:13px; padding:8px 12px; }
.bl-empty{ font-size:13px; color:var(--ink-faint); padding:8px 2px; }

/* ---- Footer ----------------------------------------------------- */
.bl-foot{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:16px 26px; border-top:1px solid var(--line);
  background:var(--surface-2);
}
.bl-btn{
  font:inherit; font-size:14px; font-weight:600; cursor:pointer;
  padding:11px 18px; border-radius:11px; border:1.5px solid transparent;
  transition:.15s; white-space:nowrap;
}
.bl-btn:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
.bl-btn-ghost{ color:var(--ink-soft); background:transparent; border-color:var(--line-strong); }
.bl-btn-ghost:hover{ color:var(--ink); border-color:var(--ink-faint); }
.bl-btn-quiet{ color:var(--ink-faint); background:transparent; border-color:transparent; padding-left:8px; padding-right:8px; }
.bl-btn-quiet:hover{ color:var(--ink); }
.bl-btn-primary{ color:#fff; background:var(--brand); border-color:var(--brand); box-shadow:0 6px 16px -8px var(--brand); }
.bl-btn-primary:hover{ background:var(--brand-strong); border-color:var(--brand-strong); }
@media (prefers-color-scheme:dark){ .bl-btn-primary{ color:#08130f; } }
.bl-spacer{ flex:1 1 auto; }

@media (max-width:520px){
  .bl-head{ padding:22px 20px 18px; }
  .bl-title{ font-size:21px; }
  .bl-body{ padding:6px 20px 18px; }
  .bl-foot{ padding:14px 18px; }
  .bl-spacer{ display:none; }
  .bl-btn-primary{ order:-1; flex:1 1 100%; text-align:center; }
  .bl-btn-quiet[data-act="reset"]{ margin-right:auto; }
}

/* ---- Floating re-open button (tùy chọn) ------------------------- */
.bl-fab{
  position:fixed; right:20px; bottom:20px; z-index:2147482000;
  font-family:var(--sans); font-size:13px; font-weight:600;
  display:inline-flex; align-items:center; gap:8px;
  padding:11px 15px; border-radius:999px; cursor:pointer;
  color:#fff; background:var(--brand); border:0; box-shadow:var(--shadow);
  transition:transform .15s;
}
@media (prefers-color-scheme:dark){ .bl-fab{ color:#08130f; } }
.bl-fab:hover{ transform:translateY(-2px); }
.bl-fab svg{ width:16px; height:16px; }
