.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.lang-switch {
  position: relative;
}

.lang-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 124px;
  min-width: 124px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* Fixed-width label slot: keeps the globe icon and chevron at a stable
   position so 中/英/泰 switching doesn't make the button jump left/right. */
.lang-current .lang-current-label {
  display: inline-block;
  flex: 0 0 56px;
  width: 56px;
  text-align: center;
}

.lang-current .fa-globe {
  color: #000000;
  font-size: 24px;
}

.lang-current .lang-chevron {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  transition: transform 0.2s ease;
}

.lang-switch.open .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  display: block;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1001;
  min-width: 136px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #ffffff;
  border: 1px solid #e8e2d5;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.lang-dropdown li {
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
}

.lang-switch.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-btn {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #333333;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.lang-btn:hover {
  background: #f5f1e8;
}

.lang-btn.active {
  background: #faf6ee;
  color: #b8860b;
  font-weight: 600;
}

@media (max-width: 480px) {
  .header-actions {
    gap: 4px;
  }

  .lang-current {
    width: 116px;
    min-width: 116px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .lang-current .lang-current-label {
    flex-basis: 50px;
    width: 50px;
  }
}

/* ======================================================================
   Language-variant background images
   Rules only match after i18n.js adds a lang-* class to <html>.
   Two layers: variant on top, Chinese base below. A missing variant 404s and
   that layer paints transparent, so the Chinese image shows through — pure CSS
   fallback, and it also works for the footer ::after pseudo-element.
   NOTE: variant background files must be OPAQUE (the lower layer is hidden,
   not blended away) for the header blend fix below.
   ====================================================================== */

/* Page header banner (base rule carries background-blend-mode: overlay, so the
   variant layer must composite with `normal` and keep the base layer as the
   blend target — otherwise a missing variant degrades to a solid color block). */
html.lang-en .page-header .container {
  background-image: url('../images/bg-images/page-header-en.jpg'),
    url('../images/bg-images/page-header.jpg');
  background-blend-mode: normal, overlay;
}
html.lang-th .page-header .container {
  background-image: url('../images/bg-images/page-header-th.jpg'),
    url('../images/bg-images/page-header.jpg');
  background-blend-mode: normal, overlay;
}

/* Footer top banner (pseudo-element; no blend-mode in the base rule) */
html.lang-en .footer-section .container::after {
  background-image: url('../css/bg-image/footer-top-bg-02-en.png'),
    url('../css/bg-image/footer-top-bg-02.png');
}
html.lang-th .footer-section .container::after {
  background-image: url('../css/bg-image/footer-top-bg-02-th.png'),
    url('../css/bg-image/footer-top-bg-02.png');
}

/* Alipay page payment is embedded in the shared payment modal. */
.qr-payment-modal.is-alipay .modal-dialog {
  max-width: 960px;
}

.qr-payment-modal.is-alipay .modal-body {
  padding: 28px 24px 24px;
}

.payment-frame-shell {
  width: 100%;
  margin: 0 auto 20px;
  padding: 10px;
  border: 1px solid #e4e9f1;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(28, 45, 71, 0.08);
}

.payment-frame-shell[hidden] {
  display: none;
}

.payment-frame-shell iframe {
  display: block;
  width: 100%;
  height: min(58vh, 560px);
  min-height: 420px;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
}

@media (max-width: 767px) {
  .qr-payment-modal.is-alipay .modal-dialog {
    width: calc(100% - 16px);
    max-width: none;
    margin: 8px auto;
    min-height: calc(100% - 16px);
    align-items: flex-start;
  }

  .qr-payment-modal.is-alipay .modal-body {
    padding: 24px 12px 16px;
  }

  .payment-frame-shell {
    padding: 6px;
    border-radius: 14px;
  }

  .payment-frame-shell iframe {
    height: min(52vh, 460px);
    min-height: 340px;
    border-radius: 10px;
  }
}

/* Vue 未挂载前隐藏模板，避免 {{ }} 插值闪烁（FOUC）。 */
[v-cloak] {
  display: none;
}
