/* HCMC FOSTI — global header chrome (all frontend pages) */
:root {
  --fosti-navy: #0b3d91;
  --fosti-navy-deep: #062a66;
  --fosti-green: #2ea44f;
  --fosti-max: 1280px;
  --fosti-font: Arial, Helvetica, sans-serif;
}

.fosti-header,
.fosti-header * {
  box-sizing: border-box;
}

.fosti-header {
  font-family: var(--fosti-font);
  -webkit-font-smoothing: antialiased;
}

.fosti-header a {
  color: inherit;
  text-decoration: none;
}

.fosti-header img {
  max-width: 100%;
  height: auto;
  display: block;
}

.fosti-container {
  width: min(100% - 32px, var(--fosti-max));
  margin-inline: auto;
}

.fosti-topbar {
  background: var(--fosti-navy);
  color: #fff;
  font-size: 13px;
}

.fosti-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  gap: 16px;
}

.fosti-topbar__date {
  font-weight: 500;
  letter-spacing: 0.01em;
}

.fosti-topbar__social {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fosti-topbar__social a {
  color: #fff;
  font-size: 15px;
  line-height: 1;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.fosti-topbar__social a:hover {
  opacity: 0.7;
}

.fosti-brandbar {
  background: #fff;
  border-bottom: 1px solid #eceff3;
}

.fosti-brandbar__inner {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 28px;
  min-height: 92px;
  padding: 12px 0;
}

.fosti-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.fosti-brand__logo {
  width: auto;
  max-width: 240px;
  height: 56px;
  object-fit: contain;
  object-position: left center;
}

.fosti-brandbar__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
  color: var(--fosti-navy);
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.fosti-brandbar__title span,
.fosti-brandbar__title-line {
  display: block;
}

.fosti-brandbar__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.fosti-nav {
  background: #fff;
  border-bottom: 1px solid #e8ecf1;
  position: relative;
  z-index: 40;
}

.fosti-nav__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.fosti-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1;
}

.fosti-nav__list > li {
  position: relative;
  flex: 0 0 auto;
}

.fosti-nav__list > li > a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 15px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  line-height: 1.2;
}

.fosti-nav__home > a {
  padding-left: 4px;
  padding-right: 10px;
}

.fosti-nav__home .material-symbols-outlined {
  font-size: 22px;
  color: #222;
}

.fosti-nav__caret {
  font-size: 18px !important;
  color: #666;
  margin-left: 1px;
}

.fosti-nav__list > li.is-active > a,
.fosti-nav__list > li > a:hover {
  color: var(--fosti-navy);
}

.fosti-nav__dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 240px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e8ecf1;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 50;
}

.fosti-nav__list > li.has-children:hover > .fosti-nav__dropdown,
.fosti-nav__list > li.has-children:focus-within > .fosti-nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fosti-nav__dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: #374151;
  white-space: normal;
}

.fosti-nav__dropdown a:hover {
  background: #f3f6fb;
  color: var(--fosti-navy);
}

.fosti-nav__tools,
.fosti-brandbar__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.fosti-tool-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.fosti-tool-btn .material-symbols-outlined {
  font-size: 22px;
}

.fosti-tool-btn:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.fosti-tool-btn--search {
  background: var(--fosti-green);
}

.fosti-tool-btn--menu {
  background: #4b5563;
}

/* —— Search popup modal —— */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.fosti-search-open {
  overflow: hidden;
}

.fosti-search-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(12vh, 48px) 16px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.fosti-search-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.fosti-search-modal[hidden] {
  display: none !important;
}

.fosti-search-modal.is-open[hidden] {
  display: flex !important;
}

.fosti-search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 56, 0.55);
  backdrop-filter: blur(2px);
}

.fosti-search-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 28px 28px 24px;
  transform: translateY(-12px);
  transition: transform 0.22s ease;
}

.fosti-search-modal.is-open .fosti-search-modal__dialog {
  transform: translateY(0);
}

.fosti-search-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fosti-search-modal__close:hover {
  background: #f1f5f9;
  color: var(--fosti-navy);
}

.fosti-search-modal__title {
  margin: 0 40px 6px 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #111;
}

.fosti-search-modal__desc {
  margin: 0 0 18px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #64748b;
}

.fosti-search-modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fosti-search-modal__field {
  position: relative;
  display: flex;
  align-items: center;
}

.fosti-search-modal__icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 22px;
  pointer-events: none;
}

.fosti-search-modal__field input {
  width: 100%;
  height: 52px;
  border: 1px solid #d7dde5;
  border-radius: 2px;
  padding: 0 14px 0 44px;
  font-family: inherit;
  font-size: 16px;
  color: #152238;
  background: #fff;
}

.fosti-search-modal__field input:focus {
  border-color: var(--fosti-navy);
  outline: none;
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.14);
}

.fosti-search-modal__submit {
  height: 48px;
  border: 0;
  border-radius: 2px;
  background: var(--fosti-navy);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.fosti-search-modal__submit:hover {
  background: var(--fosti-navy-deep);
}

/* —— Right slide drawer —— */
body.fosti-drawer-open {
  overflow: hidden;
}

.fosti-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.fosti-drawer-overlay.is-open {
  opacity: 1;
}

.fosti-drawer-overlay[hidden] {
  display: none !important;
}

.fosti-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1210;
  width: min(420px, 92vw);
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: var(--fosti-font);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.fosti-drawer.is-open {
  transform: translateX(0);
}

.fosti-drawer__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fosti-drawer__close:hover {
  background: #f1f5f9;
}

.fosti-drawer__close .material-symbols-outlined {
  font-size: 22px;
}

.fosti-drawer__body {
  padding: 48px 28px 40px;
}

.fosti-drawer__title {
  margin: 0 0 18px;
  font-size: 1.35rem;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.01em;
}

.fosti-drawer__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fosti-drawer__menu > li {
  border-bottom: 1px solid #eef2f6;
}

.fosti-drawer__link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.fosti-drawer__link:hover {
  color: var(--fosti-navy);
}

.fosti-drawer__link--home {
  justify-content: flex-start;
  padding-block: 12px;
}

.fosti-drawer__link--home .material-symbols-outlined {
  font-size: 26px;
  color: #111;
}

.fosti-drawer__caret {
  font-size: 20px !important;
  color: #64748b;
  transition: transform 0.2s ease;
}

.fosti-drawer__menu > li.has-children.is-open > .fosti-drawer__toggle .fosti-drawer__caret {
  transform: rotate(180deg);
}

.fosti-drawer__submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 10px 8px;
  display: none;
}

.fosti-drawer__menu > li.has-children.is-open > .fosti-drawer__submenu {
  display: block;
}

.fosti-drawer__submenu a {
  display: block;
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
}

.fosti-drawer__submenu a:hover {
  color: var(--fosti-navy);
}

.fosti-drawer__connect {
  margin-top: 36px;
}

.fosti-drawer__connect-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.fosti-drawer__connect-head h3 {
  margin: 0;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111;
}

.fosti-drawer__connect-line {
  flex: 1 1 auto;
  height: 1px;
  background: #e5e7eb;
}

.fosti-drawer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fosti-drawer__social a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eef2f6;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.fosti-drawer__social a:hover {
  background: var(--fosti-navy);
  color: #fff;
}

@media (max-width: 1200px) {
  .fosti-nav__list > li > a {
    padding-inline: 9px;
    font-size: 13px;
  }

  .fosti-brandbar__title {
    font-size: clamp(18px, 2vw, 24px);
  }

  .fosti-brand__logo {
    height: 50px;
    max-width: 200px;
  }
}

@media (max-width: 992px) {
  /* Mobile / tablet: sticky compact bar kiểu trang báo */
  .fosti-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
  }

  .fosti-container {
    width: min(100% - 24px, var(--fosti-max));
  }

  .fosti-topbar {
    font-size: 12px;
  }

  .fosti-topbar__inner {
    min-height: 32px;
  }

  .fosti-brandbar {
    border-bottom: 1px solid #eceff3;
  }

  .fosti-brandbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 8px 0;
  }

  /* Ẩn tên dài — logo mang nhận diện; menu nằm trong drawer */
  .fosti-brandbar__title {
    display: none;
  }

  .fosti-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .fosti-brand__logo {
    height: auto;
    max-height: 42px;
    max-width: 145px;
  }

  .fosti-brandbar__tools {
    flex: 0 0 auto;
    gap: 8px;
    padding-right: env(safe-area-inset-right);
  }

  .fosti-nav {
    display: none;
  }

  .fosti-tool-btn {
    width: 40px;
    height: 40px;
  }

  .fosti-tool-btn:hover {
    transform: none;
  }

  .fosti-search-modal {
    padding: max(8vh, 20px) 14px 20px;
    align-items: center;
  }

  .fosti-search-modal__dialog {
    padding: 24px 18px 18px;
  }

  .fosti-search-modal__title {
    font-size: 1.2rem;
  }

  .fosti-search-modal__field input {
    font-size: 16px;
  }

  .fosti-drawer {
    width: min(100vw, 100%);
    max-width: 100%;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .fosti-drawer__close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
  }

  .fosti-drawer__body {
    padding: 52px 20px calc(28px + env(safe-area-inset-bottom));
  }

  .fosti-drawer__title {
    font-size: 1.2rem;
    margin-bottom: 12px;
    padding-right: 40px;
  }

  .fosti-drawer__link {
    min-height: 48px;
    padding: 12px 2px;
    font-size: 15px;
  }

  .fosti-drawer__connect {
    margin-top: 28px;
  }

  .fosti-drawer__social a {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .fosti-topbar__date {
    font-size: 11px;
  }

  .fosti-brand__logo {
    max-height: 38px;
    max-width: 145px;
  }

  .fosti-tool-btn {
    width: 38px;
    height: 38px;
  }

  .fosti-tool-btn .material-symbols-outlined {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fosti-drawer,
  .fosti-drawer-overlay,
  .fosti-search-modal,
  .fosti-search-modal__dialog,
  .fosti-tool-btn {
    transition: none;
  }
}
