/* DN Studio — language switcher dùng chung cho mọi mẫu HTML.
   Mỗi template được restyle bằng .dn-lang { --dn-lang-*: … } hoặc CSS riêng. */

html.dn-i18n-wait body { visibility: hidden; }

.dn-lang {
  --dn-lang-fg: currentColor;
  --dn-lang-muted: rgba(0, 0, 0, .55);
  --dn-lang-bg: rgba(255, 255, 255, .72);
  --dn-lang-border: rgba(0, 0, 0, .16);
  --dn-lang-menu-bg: #fff;
  --dn-lang-radius: 999px;
  --dn-lang-font: inherit;
  position: relative;
  display: none;
  flex: none;
  font-family: var(--dn-lang-font);
  z-index: 40;
}
.dn-lang.is-ready { display: inline-flex; }
.dn-lang.is-open { z-index: 60; }

.dn-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px 12px 8px 10px;
  border: 1px solid var(--dn-lang-border);
  border-radius: var(--dn-lang-radius);
  background: var(--dn-lang-bg);
  color: var(--dn-lang-fg);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}
.dn-lang__btn:hover,
.dn-lang.is-open .dn-lang__btn {
  border-color: currentColor;
}

.dn-lang__ico {
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dn-lang__code { font-variant-numeric: tabular-nums; }

.dn-lang__caret {
  width: 8px;
  height: 8px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: .55;
  transition: transform .2s ease;
}
.dn-lang.is-open .dn-lang__caret { transform: rotate(225deg) translate(-1px, -1px); }

.dn-lang__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--dn-lang-menu-bg);
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .12);
  display: none;
}
.dn-lang.is-open .dn-lang__list { display: block; }

[dir="rtl"] .dn-lang__list { right: auto; left: 0; }

.dn-lang__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-align: start;
  cursor: pointer;
  white-space: nowrap;
}
.dn-lang__opt:hover,
.dn-lang__opt:focus-visible { background: rgba(0, 0, 0, .06); outline: none; }
.dn-lang__opt[aria-current="true"] { font-weight: 600; }

.dn-lang__opt-code {
  width: 2.2em;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .45;
}

/* Nút nổi khi template không đặt [data-i18n-switcher] */
.dn-lang--float {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 80;
}
[dir="rtl"] .dn-lang--float { right: auto; left: 14px; }
