/* Compact shared header; secondary actions live in the overflow menu. */
body.compact-header-ready header { width: 100%; }

header .header-guide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  color: #b44109;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  border-radius: 10px;
  white-space: nowrap;
}

header .header-guide:hover { background: rgba(234, 88, 12, 0.07); }
header .header-guide svg { flex-shrink: 0; }
header .header-guide:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

body.compact-header-ready header .header-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 10px;
  width: auto;
  min-width: 0;
  margin-left: auto;
}

body.compact-header-ready header .country-control {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
}

body.compact-header-ready header .country-control select {
  min-width: 0;
  max-width: 190px;
  min-height: 32px;
}

.language-suggestion {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: calc(100% - 48px);
  max-width: 1152px;
  margin: 12px auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
}

.language-suggestion p { flex: 1 1 240px; margin: 0; line-height: 1.5; }
.language-suggestion .button { min-height: 44px; white-space: normal; }

body.compact-header-ready header .city-nav-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 900px) {
  body.compact-header-ready header .header-controls { width: 100%; margin-left: 0; flex-wrap: wrap; }
  body.compact-header-ready header .city-nav-back { margin-right: auto; }
}

@media (max-width: 600px) {
  .language-suggestion { width: calc(100% - 28px); padding: 14px; }
  .language-suggestion .button { flex: 1 1 180px; }
}

@media (max-width: 400px) {
  body.compact-header-ready header .header-controls { gap: 6px; }
  body.compact-header-ready header .city-nav-back { padding-inline: 10px; font-size: 12px; white-space: normal; line-height: 1.3; }
  header .header-guide { padding-inline: 4px; gap: 5px; font-size: 13px; }
}

/* Pre-sign-in support link lives in the header while the overflow menu is hidden. */
body.compact-header-ready header .header-support-link {
  flex: 0 0 auto;
  width: auto;
  min-height: 44px;
}

body.compact-header-ready header .mode-switch-trigger::before { content: none; }
.mode-switch-trigger::after {
  content: '';
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5a50' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.compact-header-ready header .mode-switch-trigger[hidden] { display: none; }
.mode-switch-trigger[aria-expanded='true'] { background: #fff0df; }

.mode-switch-menu {
  position: fixed;
  z-index: 1950;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(31, 42, 36, 0.18);
}
.mode-switch-menu[hidden] { display: none; }
.mode-switch-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 68px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.mode-switch-option strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.4; }
.mode-switch-option strong + span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.mode-switch-option[aria-checked='true'] { background: #fff0df; }
.mode-switch-option:hover { background: rgba(234, 88, 12, 0.07); }
.mode-switch-check { flex: 0 0 20px; color: #9a3412; font-size: 21px; }
.mode-switch-option:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Country and mode share one slot, keeping the guide in place across screens. */
body.compact-header-ready header:has(#countryControl) .header-controls {
  display: grid;
  grid-template-columns: 208px max-content 44px;
  align-items: center;
  width: auto;
  gap: 10px;
}

body.compact-header-ready header:has(#countryControl) :is(.country-control, .city-nav-back) {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin: 0;
}

body.compact-header-ready header:has(#countryControl) .country-control {
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

body.compact-header-ready header:has(#countryControl) :is(.country-control select, .city-nav-back) {
  min-height: 44px;
  max-width: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--card);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 38px 8px 14px;
  box-shadow: 0 1px 4px rgba(31, 42, 36, 0.07);
}

body.compact-header-ready header:has(#countryControl) .city-nav-back {
  position: relative;
  justify-content: flex-start;
}

body.compact-header-ready header:has(#countryControl) .city-nav-back::after {
  position: absolute;
  right: 12px;
  top: calc(50% - 8px);
  margin: 0;
}

body.compact-header-ready header:has(#countryControl) .country-control select {
  width: 100%;
  padding: 8px 38px 8px 14px;
}

body.compact-header-ready header:has(#countryControl) .header-guide {
  grid-column: 2;
  grid-row: 1;
}

body.compact-header-ready header:has(#countryControl) .mobile-header-toggle {
  grid-column: 3;
  grid-row: 1;
}

body.compact-header-ready header:has(#countryControl) .header-support-link {
  grid-column: 1 / -1;
  justify-self: end;
}

@media (max-width: 900px) {
  body.compact-header-ready header:has(#countryControl) .header-controls {
    width: 100%;
    grid-template-columns: 208px 1fr 44px;
  }
  body.compact-header-ready header:has(#countryControl) .header-guide {
    justify-self: end;
  }
}

@media (max-width: 600px) {
  body.compact-header-ready header:has(#countryControl) .header-controls {
    grid-template-columns: minmax(0, 208px) 1fr 44px;
    gap: 8px;
  }
  body.compact-header-ready header:has(#countryControl) .header-guide {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-inline: 0;
  }
}
