/* ===== ThemeB language and delivery country picker ===== */
.top-bar #controlsList.controls-list,
.top-bar .controls-list,
.top-bar .top-container,
.top-bar .row.headrow {
  overflow: visible !important;
}

.theme-locale-picker {
  position: relative;
  vertical-align: middle !important;
}

/* Slim trigger: match other topbar links (not oversized GGM-huge) */
.theme-locale-trigger {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  font-size: inherit !important;
  font-weight: inherit;
  line-height: 1.2;
  max-width: min(48vw, 22rem);
  white-space: nowrap;
  padding: 0.5rem .8rem;
}

.theme-locale-trigger .flag-icon {
  flex: 0 0 auto;
  font-size: 1em;
}

.theme-locale-trigger-text {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.3rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-locale-lang,
.theme-locale-country {
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-locale-sep {
  opacity: 0.7;
}

.theme-locale-chevron {
  flex: 0 0 auto;
  font-size: 0.7em;
  transition: transform 0.15s ease;
}

.theme-locale-picker.is-open .theme-locale-chevron {
  transform: rotate(180deg);
}

/* Scoped selectors keep the header link styles out of the picker. */
#countrySettings.theme-locale-panel {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  width: 620px !important;
  max-width: calc(100vw - 2rem) !important;
  max-height: 76vh;
  overflow: auto;
  z-index: 1080;
  margin: 8px 0 0;
  padding: 0;
  background: #fff;
  color: #292524;
  border: 1px solid #e7e2df;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(45, 24, 20, .18), 0 4px 12px rgba(45, 24, 20, .06);
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  column-count: auto;
}
#countrySettings.theme-locale-panel[hidden] { display: none !important; }
.theme-locale-picker.is-open > #countrySettings:not([hidden]) { display: block; }
.theme-locale-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid #eee9e6;
}
.theme-locale-panel-heading > strong { font-size: 16px; font-weight: 600; }
.theme-locale-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f5f3f2;
  color: #625853;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.theme-locale-close:hover { background: #ece6e3; }
.theme-locale-panel-inner { display: grid; grid-template-columns: 1fr 1.15fr; }
.theme-locale-section { min-width: 0; padding: 22px 16px 18px; }
.theme-locale-section + .theme-locale-section { border-left: 1px solid #eee9e6; }
.theme-locale-section .list-title { margin: 0 8px 14px; color: #706762; font-size: 12px; }
.theme-locale-section .list-title strong { font-weight: 600; }
.theme-locale-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d5cbc6 transparent;
  list-style: none;
  margin: 0;
  padding: 3px;
  column-count: auto;
}
.theme-locale-list > li { list-style: none; margin: 0; padding: 0; min-width: 0; }
.theme-locale-list > li::before { content: none !important; }
#themeLocalePicker .theme-locale-list > li > .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #332c29;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  transition: background-color .15s ease, border-color .15s ease;
}
.theme-locale-option-label { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.theme-locale-option-label small { margin-top: 3px; color: #807570; font-size: 12px; font-weight: 400; }
.theme-locale-list .flag-icon { flex: 0 0 auto; font-size: 18px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
#themeLocalePicker .theme-locale-list > li > .nav-link:hover { background: #f7f4f2; }
#themeLocalePicker .theme-locale-list > li.active > .nav-link { background: #fbefec; border-color: #e9c9c2; color: #962d22; }
.theme-locale-check { flex: 0 0 auto; color: #962d22; font-size: 16px; font-weight: 700; }
#themeLocalePicker a:focus-visible, #themeLocalePicker button:focus-visible { outline: 2px solid #962d22; outline-offset: 2px; }
#themeLocalePicker .theme-locale-trigger:focus-visible { outline-color: white; outline-offset: -3px; }
#themeLocalePicker .theme-locale-list > li.is-disabled > .nav-link { opacity: .5; cursor: not-allowed; }
.theme-locale-hint { margin: 14px 8px 0; color: #706762; font-size: 12px; }
.top-bar .controls-list .theme-locale-trigger { color: #fff !important; }
@media (max-width: 700px) {
  #countrySettings.theme-locale-panel {
    position: fixed !important;
    top: 12vh !important;
    right: 16px !important;
    left: 16px !important;
    width: auto !important;
    max-height: 76vh;
    max-height: 76dvh;
    margin: 0;
  }
  .theme-locale-panel-heading { padding: 14px 18px; }
  .theme-locale-panel-inner { grid-template-columns: minmax(0, 1fr); }
  .theme-locale-section { padding: 16px; }
  .theme-locale-section + .theme-locale-section { border-left: 0; border-top: 1px solid #eee9e6; }
  .theme-locale-list { max-height: none; overflow: visible; }
  .theme-locale-country, .theme-locale-sep { display: none; }
  .theme-locale-trigger { max-width: 52vw; }
}
@media (prefers-reduced-motion: reduce) {
  #themeLocalePicker .nav-link, .theme-locale-chevron { transition: none; }
}

/* Keep filtering and scroll affordances independent of global header styles. */
#themeLocalePicker [hidden] { display: none !important; }
.theme-locale-search-label { display: block; margin: 0 8px 6px; font-size: 12px; color: #706762; }
.theme-locale-search { box-sizing: border-box; width: 100%; min-height: 42px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #d5cbc6; border-radius: 8px; background: #fff; color: #292524; font: inherit; }
#themeLocalePicker .theme-locale-search:focus-visible { outline: 2px solid #962d22; outline-offset: 2px; }
.theme-locale-more, .theme-locale-mobile-more { width: 100%; padding: 12px; border: 0; border-top: 1px solid #eee9e6; background: #fbf5f3; color: #962d22; font-size: 13px; font-weight: 600; cursor: pointer; }
.theme-locale-more:hover, .theme-locale-mobile-more:hover { background: #f4e5df; }
.theme-locale-empty { margin: 12px 8px; font-size: 13px; color: #706762; }
.theme-locale-mobile-more { display: none; }
@media (max-width: 700px) {
  .theme-locale-panel-heading { position: sticky; top: 0; z-index: 2; background: #fff; }
  .theme-locale-mobile-more { display: block; position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -8px 16px rgba(255,255,255,.9); }
  .theme-locale-more { display: none; }
  #countrySettings.theme-locale-panel { overscroll-behavior: contain; }
}
