/* ============================================================
   Aurora Glass — Header + Footer (global)
   ============================================================ */

/* ---------- Header ---------- */
.au-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--au-header-bg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--au-glass-brd);
}
.au-header__bar {
  display: flex; align-items: center; gap: var(--au-s3);
  min-height: var(--au-header-h);
}

/* Brand */
.au-header__brand { flex: none; }
.au-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; white-space: nowrap; }
.au-logo__text { white-space: nowrap; }
.au-logo__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  color: #fff; background: var(--au-grad); box-shadow: var(--au-glow-teal);
}
.au-logo__text { background: var(--au-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.au-header .custom-logo-link { display: inline-flex; align-items: center; }
.au-header .custom-logo { max-height: 42px; width: auto; }

/* Loc chip (GPS) — compact, 1 dòng, ngay sau logo */
.au-header__loc {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 12px; border-radius: var(--au-r-pill); max-width: 220px;
  background: var(--au-glass-bg); border: 1px solid var(--au-glass-brd);
  font-size: var(--au-fs-sm); font-weight: 600; color: var(--au-text-soft);
  white-space: nowrap;
}
.au-header__loc svg { color: var(--au-accent); flex: none; }
.au-header__loc span { overflow: hidden; text-overflow: ellipsis; }
.au-header__loc:hover { color: var(--au-text); border-color: var(--au-glass-brd-2); }

/* Nav wrapper — desktop: menu ở giữa-trái, search + tiện ích dồn phải */
.au-nav { display: flex; align-items: center; gap: var(--au-s4); flex: 1; margin-left: var(--au-s5); }
@media (min-width: 1081px) {
  .au-menu-nav { order: 1; }            /* menu về trái */
  .au-search { order: 2; margin-left: auto; }  /* search dồn sang phải */
}

/* Search */
.au-search { position: relative; display: flex; align-items: center; width: min(210px, 22vw); }
.au-search__icon { position: absolute; left: 12px; color: var(--au-text-dim); pointer-events: none; display: grid; place-items: center; }
.au-search__input {
  width: 100%; padding: 9px 40px 9px 38px; border-radius: var(--au-r-pill);
  background: var(--au-glass-bg); border: 1px solid var(--au-glass-brd);
  color: var(--au-text); font-family: inherit; font-size: var(--au-fs-sm); outline: none;
  transition: border-color .2s, background .2s;
}
.au-search__input::placeholder { color: var(--au-text-faint); }
.au-search__input:focus { border-color: var(--au-accent); background: var(--au-glass-bg-2); }
.au-search__gps {
  position: absolute; right: 6px; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  background: transparent; border: none; color: var(--au-text-dim); transition: color .2s, background .2s;
}
.au-search__gps:hover { color: var(--au-accent); background: var(--au-glass-bg-2); }
.au-search__gps.is-loading { animation: au-spin .8s linear infinite; }
@keyframes au-spin { to { transform: rotate(360deg); } }

/* Search results dropdown */
.au-search__results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 1100;
  list-style: none; margin: 0; padding: 6px;
  background: var(--au-panel-solid);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--au-glass-brd-2); border-radius: var(--au-r);
  box-shadow: var(--au-shadow); max-height: 340px; overflow-y: auto;
}
.au-search__results li a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  font-size: var(--au-fs-sm); color: var(--au-text-soft);
}
.au-search__results li a:hover { background: var(--au-glass-bg-2); color: var(--au-text); }
.au-search__results .ww-sr-ico, .au-search__results .au-sr-ico { font-size: 1rem; }

/* Menu */
.au-menu-nav { display: flex; }
.au-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.au-menu a {
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: var(--au-r-pill);
  font-size: var(--au-fs-sm); font-weight: 600; color: var(--au-text-soft); white-space: nowrap;
  transition: color .18s, background .18s;
}
.au-menu a:hover { color: var(--au-text); background: var(--au-glass-bg); }
.au-menu a.is-active { color: var(--au-text); background: var(--au-glass-bg-2); }
.au-caret { font-size: .7em; opacity: .7; }

/* Mega-menu */
.au-has-mega { position: relative; }
.au-mega {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 1100;
  width: min(680px, 78vw); padding: 18px;
  background: var(--au-panel-solid);
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.au-has-mega:hover .au-mega, .au-has-mega:focus-within .au-mega { opacity: 1; visibility: visible; transform: translateY(0); }
.au-mega__regions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.au-mega__region { display: flex; flex-direction: column; gap: 3px; }
.au-mega__title { font-size: var(--au-fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--au-accent); margin-bottom: 4px; }
.au-mega__item { padding: 5px 8px; border-radius: 8px; font-size: var(--au-fs-sm); font-weight: 500; color: var(--au-text-soft); }
.au-mega__item:hover { background: var(--au-glass-bg-2); color: var(--au-text); }

/* Burger */
.au-burger { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px; border-radius: 12px; background: var(--au-glass-bg); border: 1px solid var(--au-glass-brd); cursor: pointer; padding: 0; align-items: center; justify-content: center; }
.au-burger span { width: 20px; height: 2px; background: var(--au-text); border-radius: 2px; transition: transform .25s, opacity .2s; }
.au-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.au-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.au-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav backdrop (mobile) */
.au-nav-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(3,7,20,.6); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.au-nav-backdrop.is-open { opacity: 1; visibility: visible; }
body.au-noscroll { overflow: hidden; }

/* ---------- Responsive header ---------- */
/* Chip GPS: chỉ hiện ở desktop rộng (tránh chèn header khi chật) */
@media (max-width: 1280px) { .au-header__loc { display: none; } }

@media (max-width: 1080px) {
  .au-burger { display: flex; }
  .au-nav {
    position: fixed; top: 0; right: 0; z-index: 1001;
    width: min(360px, 86vw); height: 100dvh; margin: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: var(--au-s4);
    padding: calc(var(--au-header-h) + 16px) 20px 24px;
    background: var(--au-panel-solid);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    border-left: 1px solid var(--au-glass-brd-2);
    transform: translateX(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
  }
  .au-nav.is-open { transform: translateX(0); }
  .au-search { width: 100%; }
  .au-menu-nav { width: 100%; }
  .au-menu { flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
  .au-menu a { padding: 12px 14px; border-radius: 12px; font-size: 1rem; justify-content: space-between; }
  .au-mega {
    position: static; width: 100%; opacity: 1; visibility: visible; transform: none;
    padding: 8px 0 4px; background: transparent; border: none; box-shadow: none; backdrop-filter: none;
  }
  .au-mega::before { display: none; }
  .au-mega__regions { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
  .au-logo__text { font-size: 1rem; }
  .au-mega__regions { grid-template-columns: 1fr; }
}

/* ============================================================
   Footer
   ============================================================ */
.au-footer {
  position: relative; overflow: hidden; isolation: isolate;
  margin-top: var(--au-s8);
  border-top: 1px solid var(--au-glass-brd);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--au-bg-2) 60%, transparent));
  padding-block: var(--au-s7) 96px;
}
/* Vệt sáng accent phía trên footer */
.au-footer__glow {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: min(680px, 80%); height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--au-accent), var(--au-indigo), transparent);
  opacity: .7;
}
.au-footer > .au-container { position: relative; z-index: 1; }

.au-footer__cols {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: var(--au-s6);
}
.au-footer__brand { font-size: 1.35rem; margin: 0 0 10px; }
.au-footer__title {
  position: relative; font-size: var(--au-fs-h5); color: var(--au-text);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; padding-left: 12px;
}
.au-footer__title::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 2px;
  background: var(--au-grad); box-shadow: var(--au-glow-teal);
}
.au-footer__info, .au-footer__html { color: var(--au-text-dim); font-size: var(--au-fs-sm); line-height: 1.7; }
.au-footer__col ul { list-style: none; margin: 0; padding: 0; }
.au-footer__html li, .au-footer__col li { margin-bottom: 10px; font-size: var(--au-fs-sm); color: var(--au-text-dim); }
.au-footer__info a, .au-footer__html a, .au-footer__contact a, .au-footer__col li a {
  color: var(--au-text-soft); position: relative; transition: color .18s, padding-left .18s;
}
.au-footer__col li a { display: inline-flex; align-items: center; }
.au-footer__col li a::before {
  content: "›"; margin-right: 0; width: 0; overflow: hidden; opacity: 0; color: var(--au-accent);
  transition: width .18s, margin-right .18s, opacity .18s;
}
.au-footer__col li a:hover { color: var(--au-accent); }
.au-footer__col li a:hover::before { width: 10px; margin-right: 5px; opacity: 1; }
.au-footer__info a:hover, .au-footer__html a:hover, .au-footer__contact a:hover { color: var(--au-accent); }
.au-footer__contact { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.au-footer__contact li { display: flex; align-items: flex-start; gap: 9px; font-size: var(--au-fs-sm); color: var(--au-text-soft); }
.au-footer__ci { color: var(--au-accent); flex: none; margin-top: 2px; }

.au-footer__social { display: flex; gap: 10px; margin-top: 16px; }
.au-footer__social-link {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 1px solid var(--au-glass-brd-2); color: var(--au-text-soft);
  transition: transform .18s, background .2s, border-color .2s, box-shadow .2s;
}
.au-footer__social-link:hover { transform: translateY(-2px); background: var(--au-grad); border-color: transparent; color: #fff; box-shadow: var(--au-glow); }

/* Hàng thành phố lớn — 1 hàng, cuộn ngang (không rớt hàng) */
.au-footer__cities {
  margin-top: var(--au-s6); padding-top: var(--au-s5); border-top: 1px solid var(--au-glass-brd);
  display: flex; align-items: center; gap: 14px; flex-wrap: nowrap;
}
.au-footer__cities-k { font-size: var(--au-fs-sm); font-weight: 700; color: var(--au-text); flex: none; }
.au-footer__cities-list {
  display: flex; flex-wrap: nowrap; gap: 8px; flex: 1; min-width: 0;
  overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.au-footer__cities-list::-webkit-scrollbar { height: 5px; }
.au-footer__cities-list::-webkit-scrollbar-thumb { background: var(--au-glass-brd-2); border-radius: 999px; }
.au-footer__cities-list a {
  flex: none; white-space: nowrap; scroll-snap-align: start;
  padding: 6px 13px; border-radius: var(--au-r-pill); font-size: var(--au-fs-sm); color: var(--au-text-soft);
  background: var(--au-glass-bg); border: 1px solid var(--au-glass-brd); transition: all .16s;
}
.au-footer__cities-list a:hover { color: #fff; background: var(--au-grad); border-color: transparent; transform: translateY(-2px); box-shadow: var(--au-glow); }

/* Thanh đáy: copyright · nguồn · lên đầu */
.au-footer__bottom {
  margin-top: var(--au-s5); padding-top: var(--au-s4);
  border-top: 1px solid var(--au-glass-brd);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: var(--au-fs-sm); color: var(--au-text-faint);
}
.au-footer__source { display: inline-flex; align-items: center; gap: 6px; color: var(--au-text-dim); }
.au-footer__source svg { color: var(--au-accent); }
.au-footer__top {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
  background: var(--au-glass-bg); border: 1px solid var(--au-glass-brd); color: var(--au-text-soft);
  transition: all .18s;
}
.au-footer__top:hover { color: #fff; background: var(--au-grad); border-color: transparent; transform: translateY(-2px); box-shadow: var(--au-glow); }

/* FAB back-to-top (floating góc phải dưới) */
.au-fab-top {
  position: fixed; right: clamp(14px, 3vw, 24px); bottom: clamp(14px, 3vw, 24px); z-index: 900;
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: var(--au-grad); border: none;
  box-shadow: var(--au-shadow), var(--au-glow);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.au-fab-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.au-fab-top:hover { transform: translateY(-3px); box-shadow: var(--au-shadow), var(--au-glow), 0 10px 24px -6px rgba(99,102,241,.6); }
.au-fab-top:active { transform: translateY(0) scale(.95); }
@media (prefers-reduced-motion: reduce) { .au-fab-top { transition: opacity .2s; } }

/* Skyline trang trí */
.au-footer__skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 96px; z-index: 0; pointer-events: none; }
.au-footer__skyline svg { width: 100%; height: 100%; display: block; fill: var(--au-indigo); opacity: .13; }
:root[data-theme="light"] .au-footer__skyline svg { fill: #4560b8; opacity: .12; }

@media (max-width: 900px) {
  .au-footer__cols { grid-template-columns: 1fr 1fr; gap: var(--au-s5); }
  .au-footer__col--info { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .au-footer__bottom { flex-direction: column; text-align: center; }
  .au-footer__cities { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .au-footer__cols { grid-template-columns: 1fr; }
}
