:root {
  --market-ink: #0a2342;
  --market-muted: #65758b;
  --market-line: #e4e9ef;
  --market-green: #10a77a;
  --market-gradient: linear-gradient(90deg, #008f72 0%, #42c96f 100%);
  --market-panel-top: 86px;
}

.market-switcher { display: flex; align-items: center; margin-inline-start: 8px; }
.market-switcher__trigger {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding-inline: 10px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--market-ink); font: 600 14px/1.2 inherit;
  cursor: pointer; white-space: nowrap;
}
.market-switcher__globe {
  display: grid; place-items: center; width: 22px; height: 22px;
  border: 1.6px solid currentColor; border-radius: 50%; font-size: 0;
}
.market-switcher__globe svg, .market-choice__global-icon svg {
  width: 18px; height: 18px; display: block; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; transform: none !important;
}
.market-switcher__chevron {
  width: 8px; height: 8px; margin-inline-start: 2px;
  border-inline-end: 1.5px solid currentColor; border-block-end: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .2s ease;
}
.market-switcher--desktop > summary { list-style: none; }
.market-switcher--desktop > summary::-webkit-details-marker { display: none; }
.market-switcher--desktop:not([open]) .market-mega-panel { display: none; }
.market-switcher--desktop[open] .market-switcher__chevron { transform: rotate(225deg); }

.market-mega-panel {
  position: fixed; z-index: 9998; inset-inline: 28px; top: var(--market-panel-top);
  max-height: calc(100vh - var(--market-panel-top) - 18px); overflow: auto;
  background: #fff; border: 1px solid #edf0f3; border-radius: 0 0 14px 14px;
  box-shadow: 0 18px 48px rgba(18,35,55,.12);
}
.market-mega-panel[hidden] { display: none; }
.market-mega-panel__inner { max-width: 1720px; margin-inline: auto; padding: 30px 42px 36px; text-align: start; }
.market-mega-panel__heading { margin-block-end: 20px; color: var(--market-ink); text-align: center; font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.market-global-choice {
  display: grid; grid-template-columns: auto auto auto auto; align-items: center; justify-content: center;
  gap: 13px; width: max-content; min-width: 300px; margin: 0 auto 32px; padding: 13px 22px;
  border: 1px solid #dce9e5; border-radius: 999px; background: #f6fbf9;
  color: var(--market-ink); text-decoration: none;
}
.market-global-choice > span:nth-of-type(2) { color: var(--market-muted); }
.market-global-choice:hover, .market-global-choice.is-active { border-color: #8dd5c0; background: #eef9f5; }
.market-choice__global-icon { width: 30px; height: 22px; display: grid; place-items: center; flex: 0 0 30px; color: #078b6b; direction: ltr; transform: none !important; }
.market-choice__arrow { color: #8795a7; font-size: 24px; }
.market-region-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); border-block-start: 1px solid #f0f2f5; }
.market-region { min-width: 0; padding: 20px 24px 4px; border-inline-start: 1px solid var(--market-line); }
.market-region:first-child { border-inline-start: 0; }
.market-region h3 { margin: 0 0 14px; padding-block-end: 10px; border-block-end: 1px solid var(--market-line); color: var(--market-ink); font-size: 17px; font-weight: 700; white-space: normal; }
.market-region__list { display: grid; gap: 5px; }
.market-choice {
  display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; color: var(--market-ink); font-size: 14px;
  line-height: 1.35; text-decoration: none; text-align: start;
}
.market-choice:hover, .market-choice.is-active { background: #eef9f5; }
.market-choice__flag { width: 30px; height: 20px; display: block; flex: 0 0 30px; overflow: hidden; border-radius: 1px; box-shadow: 0 0 0 1px rgba(10,35,66,.08); direction: ltr; transform: none !important; }
.market-choice__flag img { width: 100%; height: 100%; display: block; object-fit: cover; transform: none !important; }
.market-choice strong { font-weight: 650; }
.market-choice__language { color: var(--market-muted); font-weight: 400; }
.market-choice.is-active strong, .market-choice.is-active .market-choice__language,
.market-global-choice.is-active strong, .market-global-choice.is-active > span:nth-of-type(2) {
  background: var(--market-gradient); background-clip: text; -webkit-background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

/* China shares one country row with two independent language links. */
.market-china-choice { display: flex; align-items: center; gap: 5px; padding: 8px 4px; min-height: 38px; color: var(--market-ink); font-size: 12px; white-space: nowrap; }
.market-china-choice .market-choice__flag { width: 24px; height: 16px; flex-basis: 24px; margin-inline-end: 2px; }
.market-china-choice strong { font-size: 13px; font-weight: 650; }
.market-china-choice a { padding-block: 5px; color: var(--market-muted); text-decoration: none; }
.market-china-choice a:hover, .market-china-choice a.is-active { color: var(--market-green); }
.market-china-choice a:focus-visible { outline: 2px solid var(--market-green); outline-offset: 3px; }
.market-mobile-region__list > .market-china-choice { grid-column: 1 / -1; gap: 8px; padding: 9px 7px; font-size: 13px; }

.market-switcher__mobile-trigger { display: none; }
.market-mobile-sheet[hidden] { display: none; }
.market-mobile-sheet { position: fixed; z-index: 10020; inset: 0; }
.locale-recommendation {
  position: fixed; z-index: 10015; inset-inline-start: 50%; bottom: 24px;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 12px 14px; border: 1px solid #dfe9e6; border-radius: 12px;
  background: rgba(255,255,255,.98); box-shadow: 0 12px 36px rgba(10,35,66,.16);
  color: var(--market-ink); transform: translateX(-50%); white-space: nowrap;
}
.locale-recommendation__icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #eef9f5; color: var(--market-green); font-size: 13px; font-weight: 750; }
.locale-recommendation strong { font-size: 14px; font-weight: 650; }
.locale-recommendation a { border-radius: 8px; padding: 8px 11px; font-size: 13px; font-weight: 650; text-decoration: none; }
.locale-recommendation__switch { background: var(--market-gradient); color: #fff; }
.locale-recommendation__stay { color: var(--market-muted); }
.locale-recommendation__stay:hover { background: #f3f6f8; color: var(--market-ink); }
.market-mobile-sheet__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(3,18,35,.42); }
.market-mobile-sheet__panel { position: absolute; inset-inline: 0; bottom: 0; max-height: min(86vh,760px); display: flex; flex-direction: column; background: #fff; border-radius: 20px 20px 0 0; padding-block-end: env(safe-area-inset-bottom); box-shadow: 0 -16px 45px rgba(5,22,39,.18); }
.market-mobile-sheet__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-block-end: 1px solid var(--market-line); }
.market-mobile-sheet__header span { color: var(--market-green); font-size: 12px; font-weight: 700; }
.market-mobile-sheet__header h2 { margin: 3px 0 0; color: var(--market-ink); font-size: 20px; }
.market-mobile-sheet__header button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f2f5f7; color: var(--market-ink); font-size: 25px; cursor: pointer; }
.market-mobile-sheet__body { overflow: auto; padding: 10px 18px 28px; text-align: start; }
.market-mobile-region { padding-block: 10px; }
.market-mobile-region h3 { margin: 0 0 5px; padding-block-end: 7px; border-block-end: 1px solid var(--market-line); color: var(--market-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.market-mobile-choice { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 9px; color: var(--market-ink); text-decoration: none; }
.market-mobile-choice:hover, .market-mobile-choice.is-active { background: #eef9f5; color: #087c5c; }
.market-mobile-choice strong, .market-mobile-choice small { display: block; }
.market-mobile-choice strong { font-size: 15px; }
.market-mobile-choice small { margin-block-start: 2px; color: var(--market-muted); font-size: 12px; }

[dir=rtl] .market-mega-panel, [dir=rtl] .market-mobile-sheet { text-align: start; }
[dir=rtl] .site-logo, [dir=rtl] .bluesun-logo, [dir=rtl] img, [dir=rtl] picture,
[dir=rtl] svg, [dir=rtl] canvas, [dir=rtl] video { transform: none; }

@media (min-width: 992px) {
  .market-mobile-sheet { display: none !important; }
  .market-switcher--desktop[open] .market-mega-panel { display: block; }
  .market-switcher--desktop:hover .market-switcher__chevron { transform: rotate(225deg); }

  /* Closed over the home hero: every trigger element is white. */
  .bluesun-site-header.is-home:not(.is-scrolled) .market-switcher--desktop:not([open]) .market-switcher__trigger {
    color: #fff; background: transparent; border-bottom-color: transparent;
  }

  /* Hover before opening: brand green gradient. */
  .market-switcher--desktop:not([open]):hover .market-switcher__trigger {
    color: var(--market-green); border-bottom-color: transparent;
    background-image: linear-gradient(90deg,#00a878 0%,#48cf72 100%);
    background-repeat: no-repeat; background-position: left bottom; background-size: 100% 2px;
  }
  .market-switcher--desktop:not([open]):hover .market-switcher__current-market,
  .market-switcher--desktop:not([open]):hover .market-switcher__divider,
  .market-switcher--desktop:not([open]):hover .market-switcher__current-language {
    background: var(--market-gradient); background-clip: text; -webkit-background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
  }
  .market-switcher--desktop:not([open]):hover .market-switcher__globe { color: #00a878; }

  /* Open menu: restore a clear black trigger on the light panel. */
  .market-switcher--desktop[open] .market-switcher__trigger {
    color: var(--market-ink); border-bottom-color: transparent; background: transparent;
  }
  .market-switcher--desktop[open] .market-switcher__current-market,
  .market-switcher--desktop[open] .market-switcher__divider,
  .market-switcher--desktop[open] .market-switcher__current-language {
    background: none; color: var(--market-ink); -webkit-text-fill-color: currentColor;
  }
  .market-switcher--desktop[open] .market-switcher__globe { color: var(--market-ink); }

  .market-switcher--desktop[open] .market-mega-panel {
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-12px);
    transition: opacity .32s ease, transform .4s cubic-bezier(.22,.61,.36,1), visibility 0s linear .4s;
  }
  .market-switcher--desktop[open].is-visible .market-mega-panel {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s;
  }
  .market-switcher--desktop[open].is-closing .market-mega-panel { pointer-events: auto; }
}

@media (min-width: 992px) and (max-width: 1360px) {
  .market-switcher--desktop { position: fixed; z-index: 10002; top: 12px; inset-inline-end: 12px; margin: 0; }
  .market-switcher__trigger { height: 48px; gap: 6px; padding-inline: 8px; border-radius: 8px; font-size: 13px; }
  .bluesun-search-toggle { position: fixed !important; z-index: 10003; top: 19px; inset-inline-end: 230px; margin: 0 !important; }
  .bluesun-site-header:not(.is-home), .bluesun-site-header.is-scrolled { --compact-header-icon: #0a2342; }
}

@media (max-width: 1050px) and (min-width: 992px) {
  .market-region-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .market-region:nth-child(4) { border-inline-start: 0; }
}

@media (max-width: 991px) {
  .market-switcher--desktop { display: none; }
  .market-switcher__mobile-trigger { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 1px solid var(--market-line); border-radius: 10px; background: #fff; color: var(--market-ink); text-align: start; font: 500 14px/1.2 inherit; }
  .market-switcher__mobile-trigger strong { color: var(--market-muted); font-size: 12px; font-weight: 500; }
  .market-mega-panel { display: none !important; }
  .locale-recommendation { inset-inline: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto 1fr auto; gap: 8px; transform: none; white-space: normal; }
  .locale-recommendation__stay { grid-column: 2 / -1; padding-block: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-switcher--desktop[open] .market-mega-panel { transition: none; transform: none; }
}

@media(max-width:900px){
  .market-mobile-region h3{margin:0}
  .market-mobile-region__toggle{width:100%;min-height:46px;padding:0;display:flex;align-items:center;justify-content:space-between;border:0;border-bottom:1px solid var(--bs-border);background:transparent;color:var(--bs-text-muted);font-size:12px;font-weight:700;letter-spacing:.04em;text-align:left;text-transform:uppercase;cursor:pointer}
  .market-mobile-region__toggle span{width:8px;height:8px;margin-right:4px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);transition:transform .2s ease}
  .market-mobile-region__toggle[aria-expanded="true"]{color:var(--bs-green)}
  .market-mobile-region__toggle[aria-expanded="true"] span{transform:rotate(225deg)}
  .market-mobile-region__list[hidden]{display:none}
  .market-mobile-region__list{display:grid;grid-template-columns:1fr 1fr;gap:6px 10px;padding:8px 0 12px}
  .market-mobile-choice{min-width:0;padding:9px 7px}
  .market-mobile-choice strong,.market-mobile-choice small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
