/* ============================================================================
 * ONE HOME BUILD — 国家选择器样式（REBUILD 版 · 2026-10-26 移植）
 * ----------------------------------------------------------------------------
 * 定位：右下角浮标组的一部分。现有浮标 .float 在 bottom:26px right:26px，
 * WhatsApp 绿钮在 right:92px。国家选择器放在 WhatsApp 钮左侧 right:150px，
 * 三者同排，互不遮挡。
 * 视觉沿用主站：纸色底、细边框、衬线标题，不引入新配色。
 * ==========================================================================*/

.ohb-mkt-trigger {
  position: fixed;
  right: 150px;
  bottom: 26px;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid #e2ddd6;
  border-radius: 50%;
  background: #faf8f5;
  color: #4a423a;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 41;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(23, 19, 15, .10), 0 1px 4px rgba(23, 19, 15, .06);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.ohb-mkt-trigger:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(23, 19, 15, .14), 0 2px 6px rgba(23, 19, 15, .08);
}
.ohb-mkt-trigger:active { transform: translateY(0); }
.ohb-mkt-trigger svg { width: 21px; height: 21px; }

.ohb-mkt-flag {
  font-size: 22px;
  line-height: 1;
  /* 国旗 emoji 在不同系统字形大小差异大，锁一下行高避免偏移 */
  display: block;
  transform: translateY(1px);
}

/* ------------------------------------------------------------------ 面板 */
.ohb-mkt-panel {
  position: fixed;
  right: 150px;
  bottom: 88px;
  width: 232px;
  max-height: min(420px, calc(100svh - 170px));
  overflow-y: auto;
  background: #faf8f5;
  border: 1px solid rgba(138, 106, 59, .34);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(23, 19, 15, .18), 0 2px 8px rgba(23, 19, 15, .08);
  z-index: 46;
  padding: 6px;

  /* 关闭态用 visibility + pointer-events，不用 opacity：
     某些 WebView / 后台标签不推进动画时间轴会让面板永远 opacity:0 —— 
     内容全在、用户却看不见。失败方向必须安全。 */
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(.98);
  transform-origin: bottom right;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), visibility .2s;
}
.ohb-mkt-panel.is-open {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ohb-mkt-title {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8a7f73;
  padding: 8px 10px 10px;
  border-bottom: 1px solid #efeae4;
  margin-bottom: 4px;
}

.ohb-mkt-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: #232323;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .13s ease;
}
.ohb-mkt-row:hover { background: #f1e9de; }
.ohb-mkt-row.is-active {
  background: #f1e9de;
  box-shadow: inset 2px 0 0 #8a6a3b;
}

.ohb-mkt-r-flag { font-size: 17px; line-height: 1; flex: 0 0 auto; }
.ohb-mkt-r-name { flex: 1; min-width: 0; }
.ohb-mkt-r-dial {
  font-size: 11px;
  color: #8a7f73;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

/* RTL（阿语）时面板靠右对齐，行内容镜像 */
html[dir="rtl"] .ohb-mkt-row { text-align: right; }
html[dir="rtl"] .ohb-mkt-row.is-active { box-shadow: inset -2px 0 0 #8a6a3b; }

/* ------------------------------------------------------------- 移动端 */
@media (max-width: 767px) {
  .ohb-mkt-trigger {
    right: 136px;
    bottom: 20px;
    width: 46px;
    height: 46px;
  }
  .ohb-mkt-flag { font-size: 20px; }
  .ohb-mkt-panel {
    right: 16px;
    bottom: 76px;
    width: calc(100vw - 32px);
    max-width: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ohb-mkt-trigger,
  .ohb-mkt-panel { transition: none; }
}
