/* =====================================================================
 * SLEEPRIA 语言切换器样式
 * 挂载点：<div id="lang-switch"></div>
 * 白色胶囊按钮 + 下拉菜单，复用导航的字体/配色，桌面与移动端自适应
 * ===================================================================== */

.lang-switch{position:relative;flex:0 0 auto}
.lang-switch__btn{
  display:inline-flex;align-items:center;gap:7px;
  height:38px;padding:0 14px;
  background:rgba(255,255,255,.92);color:var(--ink,#202020);
  border:1px solid rgba(0,0,0,.09);border-radius:999px;
  font-size:12px;font-weight:700;letter-spacing:.04em;line-height:1;
  cursor:pointer;transition:background .2s,border-color .2s,color .2s;
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
}
.lang-switch__btn:hover{background:#fff;border-color:rgba(0,0,0,.2);color:#97793b}
.lang-switch__btn svg{flex:0 0 auto;opacity:.85}
.lang-switch__caret{font-size:10px;opacity:.6;transition:transform .2s;line-height:1}
.lang-switch.is-open .lang-switch__caret{transform:rotate(180deg)}

.lang-switch__menu{
  position:absolute;right:0;top:calc(100% + 8px);z-index:60;
  width:186px;padding:6px;
  background:#fff;border-radius:12px;
  box-shadow:0 14px 40px rgba(0,0,0,.14),0 2px 8px rgba(0,0,0,.06);
  list-style:none;margin:0;
}
.lang-switch__menu[hidden]{display:none}
.lang-switch__opt{
  display:flex;align-items:center;justify-content:space-between;width:100%;
  padding:10px 12px;border:0;border-radius:8px;background:transparent;
  color:var(--ink,#202020);font-size:13px;text-align:left;cursor:pointer;
  transition:background .15s,color .15s;
}
.lang-switch__opt:hover{background:#f3f5f7;color:#97793b}
.lang-switch__opt.is-active{background:#f0ece3;color:#97793b;font-weight:700}
.lang-switch__opt.is-active:after{content:'✓';font-size:12px}

/* 首页 header：确保语言切换器排在导航链接之后、品牌 logo 保持在中间 */
header nav .lang-switch{margin-left:clamp(10px,1.6vw,26px)}

/* 结算 / 订单页 header：logo 在左，语言切换器 + 返回链接在右 */
.co-header,.or-header{display:flex;align-items:center;justify-content:space-between;gap:16px}
.co-header #lang-switch,.or-header #lang-switch{order:2;margin-left:auto}
.co-header .co-back,.or-header .or-back{order:3;margin-left:2px}
.co-header .co-brand,.or-header .or-brand{order:1}

@media(max-width:600px){
  .lang-switch__btn{height:34px;padding:0 10px;gap:5px;font-size:11px}
  .lang-switch__btn svg{width:13px;height:13px}
  .lang-switch__menu{width:164px;right:-6px}
  header nav .lang-switch{margin-left:8px}
  /* 移动端导航较挤：三个链接 + 品牌 + 切换器，给链接再压一点间距 */
  header nav .nav-links{gap:10px}
}
