.global-search-open { overflow: hidden; }
.global-search-dialog { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: clamp(76px, 11vh, 118px) 22px 28px; visibility: hidden; transition: visibility .18s ease; }
.global-search-dialog[hidden] { display: none; }
.global-search-dialog.open { visibility: visible; }
.global-search-backdrop { position: absolute; inset: 0; opacity: 0; background: rgba(20,31,43,.44); backdrop-filter: blur(5px); transition: opacity .18s ease; }
.global-search-dialog.open .global-search-backdrop { opacity: 1; }
.global-search-panel { position: relative; z-index: 1; width: min(920px, 100%); overflow: hidden; padding: 28px 30px 23px; border: 1px solid rgba(255,255,255,.72); border-top: 4px solid #f79009; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(18,30,43,.24); transform: translateY(-12px) scale(.985); transition: transform .2s ease; }
.global-search-dialog.open .global-search-panel { transform: translateY(0) scale(1); }
.global-search-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.global-search-kicker { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 5px; color: #fff; background: #203044; font: 800 10px 'DM Sans', sans-serif; }
.global-search-head h2 { margin: 12px 0 5px; color: #152437; font-size: 27px; line-height: 1.2; }
.global-search-head p { margin: 0; color: #41505f; font-size: 12px; }
.global-search-close { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: #203044; font-size: 15px; transition: color .18s, background .18s, transform .18s; }
.global-search-close:hover { color: #ffd59b; background: #172536; transform: rotate(3deg); }
.global-search-close:focus-visible, .global-search-popular button:focus-visible { outline: 2px solid #f79009; outline-offset: 2px; }
.global-search-form input:focus, .global-search-form input:focus-visible { outline: 0; box-shadow: none; }
.global-search-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; margin-top: 18px; }
.global-search-form label { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 2px solid #f3a34c; border-radius: 8px; color: #41505f; background: #fff; box-shadow: 0 0 0 3px rgba(247,144,9,.1); }
.global-search-form label:focus-within { border-color: #eb7f00; box-shadow: 0 0 0 4px rgba(247,144,9,.14); }
.global-search-form input { flex: 1; min-width: 0; border: 0; outline: 0; color: #17263a; background: transparent; font-size: 15px; font-weight: 600; }
.global-search-form input::placeholder { color: #41505f; font-weight: 500; }
.global-search-form > button { height: 56px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 24px; border-radius: 8px; color: var(--tro-btn-ink); background: linear-gradient(135deg,#ff7a2f,#ff9e2f); font-size: 14px; font-weight: 800; box-shadow: 0 7px 16px rgba(255,112,32,.3); transition: transform .18s, box-shadow .18s; }
.global-search-form > button:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(255,112,32,.38); }
.global-search-popular { display: flex; align-items: center; gap: 14px; margin-top: 20px; color: #41505f; font-size: 11px; }
.global-search-popular > span { flex: 0 0 auto; font-weight: 700; }
.global-search-popular > div { display: flex; flex-wrap: wrap; gap: 8px; }
.global-search-popular button { min-height: 30px; padding: 0 11px; border: 1px solid #dbe3eb; border-radius: 5px; color: #40667f; background: #f8fafc; font-size: 11px; font-weight: 700; transition: color .18s, border-color .18s, background .18s; }
.global-search-popular button:hover { color: #a05300; border-color: #efb366; background: #fff8ed; }
@media (max-width: 620px) {
  .global-search-dialog { place-items: start stretch; padding: 66px 10px 18px; }
  .global-search-panel { padding: 20px 16px 18px; }
  .global-search-head h2 { font-size: 23px; }
  .global-search-head p { max-width: 255px; line-height: 1.6; }
  .global-search-close { width: 36px; height: 36px; }
  .global-search-form { grid-template-columns: minmax(0,1fr) 54px; gap: 7px; }
  .global-search-form label { height: 50px; padding: 0 12px; }
  .global-search-form input { font-size: 13px; }
  .global-search-form > button { width: 54px; height: 50px; padding: 0; }
  .global-search-form > button span { display: none; }
  .global-search-popular { align-items: flex-start; flex-direction: column; gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .global-search-dialog, .global-search-panel, .global-search-close, .global-search-form > button { transition: none; }
}

/* ---- Reusable global search module ----
   Markup lives in components/global-search.html and is mounted by common.js into
   every [data-global-search] host, so the top bar and any future slot share one
   definition. Gaps mirror .top-actions so the module keeps the same rhythm. */
.global-search-module { display: flex; align-items: center; gap: 17px; }

@media (max-width: 760px) {
  .global-search-module { gap: 8px; }
}

/* Refined top-bar trigger and focused search dialog. */
.global-search-module .global-search {
  width: clamp(190px, 18vw, 260px);
  height: 38px;
  border: 1px solid #d8e1ea;
  border-radius: 9px;
  color: #526579;
  background: #f7f9fb;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.global-search-module .global-search:hover,
.global-search-module .global-search:focus-within {
  border-color: #efad55;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 153, 0, .1);
}

.global-search-module .site-search-button {
  min-width: 112px;
  height: var(--poa-button-height, 44px);
  padding: 0 16px;
  border: 1px solid #ff8a21;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #ff7a2f 0%, #ff9e2f 100%);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(133, 55, 0, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 5px 13px rgba(255, 112, 32, .3);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.global-search-module .site-search-button::before { display: none; }
.global-search-module .site-search-button:hover {
  color: #fff;
  border-color: #f8791e;
  background: linear-gradient(135deg, #ff7126 0%, #ff9824 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), 0 9px 18px rgba(255, 112, 32, .38);
  transform: translateY(-1px);
  filter: none;
}
.global-search-module .site-search-button:active { transform: translateY(0); }
.global-search-module .site-search-button:focus-visible {
  outline: 3px solid var(--poa-button-focus, rgba(255, 153, 0, .3));
  outline-offset: 2px;
}

.global-search-dialog {
  z-index: 120;
  place-items: start center;
  padding: clamp(74px, 10vh, 104px) 22px 28px;
}

.global-search-backdrop {
  background: rgba(9, 20, 33, .62);
  backdrop-filter: blur(7px);
}

.global-search-panel {
  width: min(760px, 100%);
  padding: 32px;
  border: 1px solid #dce5ee;
  border-top: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(5, 17, 30, .3);
}

.global-search-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #ff9900 0 34%, #20364f 34% 100%);
}

.global-search-head { gap: 28px; }
.global-search-kicker {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #ffd99e;
  border-radius: 999px;
  color: #8f5400;
  background: #fff6e8;
  font: 800 10px 'DM Sans', sans-serif;
  letter-spacing: .08em;
}
.global-search-head h2 {
  margin: 14px 0 7px;
  color: #17283c;
  font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
}
.global-search-head p { color: #526579; font-size: 13px; line-height: 1.7; }
.global-search-close {
  width: 42px;
  height: 42px;
  border: 1px solid #dce5ee;
  border-radius: 50%;
  color: #40546a;
  background: #f4f7fa;
}
.global-search-close:hover {
  color: #17283c;
  border-color: #efad55;
  background: #fff5e5;
  transform: rotate(0);
}
.global-search-close:focus-visible,
.global-search-popular button:focus-visible,
.global-search-form > button:focus-visible {
  outline: 3px solid rgba(255, 153, 0, .28);
  outline-offset: 2px;
}

.global-search-form { gap: 10px; margin-top: 24px; }
.global-search-form label {
  height: 54px;
  padding: 0 16px;
  border: 1px solid #cbd7e2;
  border-radius: 11px;
  color: #526579;
  background: #f9fbfc;
  box-shadow: none;
}
.global-search-form label:focus-within {
  border-color: #ed9309;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 153, 0, .11);
}
.global-search-form input { color: #17283c; font-size: 14px; font-weight: 600; }
.global-search-form input::placeholder { color: #7a8997; font-weight: 400; }
.global-search-form > button {
  height: 54px;
  padding: 0 22px;
  border: 1px solid var(--poa-button-accent-hover, #ed8900);
  border-radius: var(--poa-button-radius, 9px);
  color: var(--poa-button-ink, #fff);
  background: linear-gradient(135deg, #ffb13b 0%, var(--poa-button-accent, #ff9900) 100%);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 9px 18px -12px rgba(154, 82, 0, .78);
}
.global-search-form > button:hover {
  color: var(--poa-button-ink, #fff);
  background: linear-gradient(135deg, #ffc15f 0%, #ffa31a 100%);
  box-shadow: 0 12px 22px -13px rgba(154, 82, 0, .84);
  transform: translateY(-1px);
}

.global-search-popular {
  align-items: flex-start;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e8edf2;
  color: #526579;
  font-size: 12px;
}
.global-search-popular > span { padding-top: 3px; color: #32465b; }
.global-search-popular > div { gap: 8px; }
.global-search-popular button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #dce5ee;
  border-radius: var(--poa-button-compact-radius, 8px);
  color: #40566d;
  background: #f6f8fa;
  font-size: 12px;
  font-weight: 700;
}
.global-search-popular button:hover {
  color: #8f5400;
  border-color: #efb366;
  background: #fff6e8;
}

@media (max-width: 760px) {
  .global-search-module .global-search { display: none; }
  .global-search-module .site-search-button {
    min-width: 44px;
    width: auto;
    height: 44px;
    gap: 6px;
    padding: 0 12px;
  }
  .global-search-module .site-search-button span { display: inline; white-space: nowrap; }
  .shared-topbar .top-actions { gap: 0; }
  .shared-topbar .crumbs { min-width: 0; }
  .shared-topbar .crumbs > span,
  .shared-topbar .crumbs > i { display: none; }
  .shared-topbar .crumbs strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .global-search-dialog {
    place-items: start stretch;
    padding: 68px 10px 10px;
  }
  .global-search-panel {
    max-height: calc(100dvh - 78px);
    overflow-y: auto;
    padding: 24px 18px 20px;
    border-radius: 16px;
  }
  .global-search-head { gap: 16px; }
  .global-search-head h2 { margin-top: 12px; font-size: 24px; }
  .global-search-head p { max-width: 255px; font-size: 12px; }
  .global-search-close { width: 38px; height: 38px; }
  .global-search-form { grid-template-columns: minmax(0, 1fr) 50px; margin-top: 20px; }
  .global-search-form label { height: 50px; padding: 0 13px; }
  .global-search-form input { font-size: 13px; }
  .global-search-form > button { width: 50px; height: 50px; padding: 0; }
  .global-search-form > button span { display: none; }
  .global-search-popular { gap: 10px; margin-top: 18px; padding-top: 16px; }
  .global-search-popular > span { padding-top: 0; }
}

@media (max-width: 420px) {
  .global-search-dialog { padding-inline: 7px; }
  .global-search-panel { padding-inline: 16px; border-radius: 14px; }
  .global-search-kicker { min-height: 24px; font-size: 9px; }
  .global-search-head h2 { font-size: 22px; }
  .global-search-popular button { min-height: 34px; padding-inline: 10px; font-size: 10px; }
}

/* Homepage-aligned dialog: reuse the homepage search module's visual language. */
body[data-page="home"] .topbar [data-global-search] { display: none !important; }

.global-search-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.global-search-panel.global-search-panel-home {
  width: min(1080px, 100%);
  padding: 20px 28px 24px;
  border: 1px solid #dce5ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 86px rgba(5, 17, 30, .34);
}
.global-search-panel.global-search-panel-home::before { display: none; }

.global-search-panel-home .global-search-head {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(240px, 1fr) 44px;
  align-items: center;
  gap: 22px;
  min-height: 98px;
  padding: 0 0 14px;
  border-bottom: 1px solid #e7edf3;
}
.global-search-experience {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-self: start;
  color: #f08b00;
  text-align: center;
}
.global-search-experience strong {
  font-family: 'DM Sans', sans-serif;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.05;
}
.global-search-experience span {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.global-search-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: min(350px, 52vw);
  min-height: 88px;
}
.global-search-brand img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: contain;
}
.global-search-brand:focus-visible { outline: 2px solid #e98600; outline-offset: 3px; border-radius: 5px; }
.global-search-panel-home .global-search-close {
  align-self: start;
  width: 38px;
  height: 38px;
  margin-top: 2px;
  border: 1px solid #ed971f;
  color: #e98600;
  background: #fff;
}
.global-search-panel-home .global-search-close:hover {
  color: #bd6800;
  border-color: #d97b00;
  background: #fff4e3;
}
.global-search-panel-home .global-search-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}
.global-search-panel-home .global-search-form label {
  height: 50px;
  padding: 0 14px;
  border: 1px solid #f2aa45;
  border-radius: 10px;
  color: #9aa7b6;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(245, 154, 35, .08);
}
.global-search-panel-home .global-search-form label:focus-within {
  border-color: #e98600;
  box-shadow: 0 0 0 3px rgba(245, 154, 35, .16);
}
.global-search-panel-home .global-search-form input { font-size: 13px; font-weight: 400; }
.global-search-panel-home .global-search-form > button {
  min-width: 96px;
  height: 50px;
  padding: 0 18px;
  border-radius: 9px;
  background: #ff9f1a;
  box-shadow: 0 6px 16px rgba(224, 124, 0, .24);
}
.global-search-panel-home .global-search-popular {
  align-items: baseline;
  gap: 8px;
  margin-top: 13px;
  padding-top: 0;
  border-top: 0;
  font-size: 11px;
}
.global-search-panel-home .global-search-popular > span {
  padding-top: 0;
  color: #2b3d52;
  font-weight: 800;
  white-space: nowrap;
}
.global-search-panel-home .global-search-popular > div {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  align-content: flex-start;
  gap: 4px;
}
.global-search-panel-home .global-search-popular > div.search-suggestion-list.is-pending {
  min-height: 64px;
  align-items: center;
  justify-content: center;
}
.global-search-panel-home .search-suggestion-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #748292;
  font-size: 11px;
  font-weight: 500;
}
.global-search-panel-home .search-suggestion-loading i { color: #e28b18; }
.global-search-panel-home .global-search-popular button {
  min-height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  color: #748292;
  background: #eef2f5;
  font-size: 10px;
  font-weight: 600;
}
.global-search-panel-home .global-search-popular button:hover { color: #8b5200; background: #fff4e3; }
.global-search-panel-home .global-search-popular .poa-state {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 760px) {
  .global-search-panel.global-search-panel-home { padding: 15px 14px 18px; border-radius: 13px; }
  .global-search-panel-home .global-search-head {
    display: flex;
    justify-content: center;
    min-height: 104px;
    padding: 28px 0 10px;
  }
  .global-search-experience { position: absolute; top: 0; left: 0; }
  .global-search-experience strong { font-size: 21px; }
  .global-search-brand { width: min(280px, 72vw); min-height: 76px; }
  .global-search-brand img { height: 76px; }
  .global-search-panel-home .global-search-close { position: absolute; top: 0; right: 0; margin: 0; }
  .global-search-panel-home .global-search-form { grid-template-columns: minmax(0, 1fr) 82px; gap: 8px; margin-top: 14px; }
  .global-search-panel-home .global-search-form label { height: 52px; padding: 0 12px; }
  .global-search-panel-home .global-search-form > button { width: 82px; min-width: 82px; height: 52px; padding: 0 12px; }
  .global-search-panel-home .global-search-form > button span { display: inline; }
  .global-search-panel-home .global-search-popular { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 12px; }
  .global-search-panel-home .global-search-popular > div {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .global-search-panel-home .global-search-head { min-height: 92px; }
  .global-search-brand { width: min(230px, 66vw); min-height: 66px; }
  .global-search-brand img { height: 66px; }
  .global-search-panel-home .global-search-close { width: 34px; height: 34px; }
  .global-search-panel-home .global-search-form { grid-template-columns: minmax(0, 1fr) 72px; gap: 7px; }
  .global-search-panel-home .global-search-form > button { width: 72px; min-width: 72px; }
}
