/* ============================================================================
   codex-header-2026.css — Thiết kế lại phần header (2026-11-26)
   ----------------------------------------------------------------------------
   KHÔNG sửa markup, KHÔNG sửa file CSS cũ. Lớp này nạp sau và đè lên.

   ĐỘ ƯU TIÊN — ĐỌC TRƯỚC KHI SỬA FILE NÀY:
   header.php có 2 khối <style> inline (#tcs-critical-header-layout,
   #tcs-critical-bottom-nav) nằm SAU wp_head(), tức sau mọi stylesheet enqueue,
   và dùng !important. Khi cả hai bên đều !important thì độ ưu tiên quyết định.
   Thêm mỗi `html` ở đầu là KHÔNG ĐỦ: `html body .tcs-site-header .tcs-header-search button`
   chỉ có 2 class nên vẫn THUA `body .tcs-site-header .tcs-mainbar .tcs-header-search button`
   (3 class). Vì vậy mọi rule dưới đây đều giữ nguyên chuỗi class của bản cũ
   (.tcs-mainbar / .tcs-header-actions / .tcs-navrow) rồi mới thêm `html`.

   CÁC LỖI ĐANG SỬA (đo bằng computed style, không phải phỏng đoán):
     1. Header cao 260px (34 + 149 + 72) -> chiếm trọn dải đầu màn hình.
     2. .tcs-shop-link bị `text-indent: -9999px` nên nhãn "Danh mục sản phẩm"
        bị đẩy ra ngoài -> chỉ còn ô icon, người dùng không biết là nút gì.
     3. Nút submit tìm kiếm border-radius:0 nằm trong ô bo 10px -> lệch góc.
     4. .tcs-primary-nav a cỡ 18px/900 -> quá nặng cho thanh điều hướng.
     5. Menu nằm trong "viên thuốc" trắng trên nền gần trắng -> viền thừa.
     6. Ô tìm kiếm không có trạng thái :focus.

   LƯU Ý KHI SỬA GẠCH CHÂN MENU:
   codex-uiux-live.css đặt `content: none` cho
   `.tcs-primary-nav .menu li.menu-item-has-children > a::after` để chỉ còn MỘT
   mũi tên caret. Nếu dùng ::after làm gạch chân thì các mục có submenu
   (Gợi ý sách, Blog, Tài liệu) sẽ mất gạch. Vì vậy ở đây dùng
   `box-shadow: inset 0 -2px` — không đụng tới ::after và caret.
   ========================================================================== */

:root {
  --tcsh-navy: #072f4d;
  --tcsh-navy-2: #0b4a76;
  --tcsh-blue: #1273bd;
  --tcsh-ink: #0f2439;
  --tcsh-muted: #6b8099;
  --tcsh-line: #e2ecf5;
  --tcsh-cta: #ef4b36;
  --tcsh-cta-2: #d9321d;
  --tcsh-focus: rgba(18, 115, 189, .18);
}

/* ============================================================================
   TOÀN BỘ phần dưới CHỈ áp dụng cho DESKTOP (>= 901px).
   Lý do: bản mobile đã VỠ SẴN TỪ TRƯỚC khi có file này — đo ở 375px thì
   .tcs-site-header cao 3571px vì toàn bộ dropdown danh mục (.tcs-navrow)
   bị đổ ra inline 3026px, ô tìm kiếm tràn khỏi khung, hotline lệch phải.
   Đó là lỗi riêng và nặng hơn nhiều phần thẩm mỹ desktop; sửa nó phải làm
   tách bạch. Khoanh vùng ở đây để mobile giữ NGUYÊN hiện trạng, không bị
   file này làm đổi thêm.
   ========================================================================== */
@media only screen and (min-width: 901px) {

/* ---------------------------------------------------------------- khung chung */
html body .tcs-site-header {
  background: #fff !important;
  border-bottom: 1px solid var(--tcsh-line) !important;
  box-shadow: 0 6px 18px rgba(8, 47, 77, .06) !important;
}

/* ------------------------------------------------------------------- top bar */
html body .tcs-site-header .tcs-topbar {
  min-height: 34px !important;
  background: var(--tcsh-navy) !important;
  border-bottom: 0 !important;
}

html body .tcs-site-header .tcs-topbar,
html body .tcs-site-header .tcs-topbar a {
  color: #dceaf6 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

html body .tcs-site-header .tcs-topbar-menu a {
  min-height: 24px !important;
  padding: 0 10px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  transition: background-color .16s ease, color .16s ease !important;
}

html body .tcs-site-header .tcs-topbar-menu a:hover {
  background: rgba(255, 255, 255, .14) !important;
  color: #fff !important;
}

/* ------------------------------------------------------------------ main bar */
/* 149px -> 96px: bản cũ có padding 16px 0 cộng với container cao 116px. */
html body .tcs-site-header .tcs-mainbar {
  padding: 10px 0 !important;
  background: #fff !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-container {
  min-height: 76px !important;
  grid-template-columns: 232px minmax(380px, 1fr) 248px !important;
  gap: 32px !important;
  align-items: center !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-brand {
  flex: 0 0 232px !important;
  width: 232px !important;
  max-width: 232px !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-brand img {
  max-height: 58px !important;
  width: auto !important;
  filter: none !important;
}

/* nhãn nổi phía trên ô tìm kiếm của bản cũ -> bỏ, gây rối */
html body .tcs-site-header .tcs-mainbar .tcs-header-search:before {
  content: none !important;
  display: none !important;
}

/* ---------------------------------------------------------------- tìm kiếm */
html body .tcs-site-header .tcs-mainbar .tcs-header-search {
  max-width: none !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-search form,
html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-search-form,
html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-sf-wrapp {
  height: 52px !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: none !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-sf-wrapp {
  display: flex !important;
  align-items: center !important;
  border: 1.5px solid #d7e4f0 !important;
  overflow: hidden !important;
  transition: border-color .18s ease, box-shadow .18s ease !important;
}

/* trạng thái focus — bản cũ không có */
html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-sf-wrapp:focus-within {
  border-color: var(--tcsh-blue) !important;
  box-shadow: 0 0 0 4px var(--tcsh-focus) !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-search input[type="search"],
html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-search-input {
  height: 48px !important;
  padding-left: 22px !important;
  padding-right: 12px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: var(--tcsh-ink) !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-search input::placeholder {
  color: #93a8bd !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-search button,
html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-search-submit {
  flex: 0 0 52px !important;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 44px !important;
  margin: 0 4px 0 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  /* CHỈ đổi background-color. Icon kính lúp là background-image data-URI SVG
     nằm trên chính nút này — dùng `background` hay `linear-gradient` (gradient
     cũng là một image) sẽ ghi đè và làm MẤT icon. */
  background-color: var(--tcsh-blue) !important;
  box-shadow: 0 2px 8px rgba(18, 115, 189, .28) !important;
  color: #fff !important;
  cursor: pointer !important;
  transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-search button:hover {
  background-color: var(--tcsh-navy-2) !important;
  box-shadow: 0 4px 14px rgba(18, 115, 189, .36) !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-search button:active {
  transform: translateY(1px) !important;
}

/* ----------------------------------------------------------------- hotline */
html body .tcs-site-header .tcs-mainbar .tcs-header-actions,
html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline {
  flex-basis: 248px !important;
  width: 248px !important;
  min-width: 248px !important;
  max-width: 248px !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline {
  height: 52px !important;
  gap: 11px !important;
  padding: 0 16px !important;
  border: 1px solid var(--tcsh-line) !important;
  border-radius: 999px !important;
  background: #f7fbfe !important;
  box-shadow: none !important;
  text-decoration: none !important;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline:hover {
  border-color: #bcd6ea !important;
  background: #fff !important;
  box-shadow: 0 4px 14px rgba(8, 47, 77, .10) !important;
}

/* Cùng lý do với nút tìm kiếm: icon điện thoại là background-image data-URI
   màu xanh đậm. Chỉ đổi background-color, và phải để nền SÁNG thì icon mới
   còn nhìn thấy. */
html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline::before {
  flex: 0 0 32px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background-color: #e4f0fa !important;
  background-size: 15px 15px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline span {
  color: var(--tcsh-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .07em !important;
  text-transform: uppercase !important;
}

html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline strong {
  color: var(--tcsh-cta-2) !important;
  font-size: 17px !important;
  font-weight: 800 !important;
}

/* ------------------------------------------------------------------ nav row */
html body .tcs-site-header .tcs-navrow {
  background: #fff !important;
  border-top: 1px solid var(--tcsh-line) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

/* dải gradient cam mờ bên trái của bản cũ -> bỏ */
html body .tcs-site-header .tcs-navrow::before {
  content: none !important;
  display: none !important;
}

html body .tcs-site-header .tcs-navrow > .tcs-header-container {
  min-height: 60px !important;
  grid-template-columns: 248px minmax(0, 1fr) !important;
  gap: 28px !important;
}

/* nút danh mục: gỡ text-indent để NHÃN CHỮ hiện trở lại */
html body .tcs-site-header .tcs-navrow .tcs-shop-link {
  height: 46px !important;
  min-width: 248px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, var(--tcsh-cta) 0%, var(--tcsh-cta-2) 100%) !important;
  box-shadow: 0 3px 10px rgba(217, 50, 29, .24) !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  text-indent: 0 !important;
  overflow: visible !important;
  white-space: nowrap !important;
  justify-content: flex-start !important;
  transition: filter .16s ease, box-shadow .16s ease, transform .16s ease !important;
}

html body .tcs-site-header .tcs-navrow .tcs-shop-link:hover {
  filter: brightness(1.06) !important;
  box-shadow: 0 6px 18px rgba(217, 50, 29, .32) !important;
}

html body .tcs-site-header .tcs-navrow .tcs-shop-link:active {
  transform: translateY(1px) !important;
}

/* background-color, KHÔNG dùng `background`: icon lưới ở đây cũng là
   background-image (xem ghi chú ở nút tìm kiếm). */
html body .tcs-site-header .tcs-navrow .tcs-shop-link::before {
  width: 22px !important;
  height: 22px !important;
  margin-right: 10px !important;
  border-radius: 5px !important;
  background-color: rgba(255, 255, 255, .22) !important;
  font-size: 12px !important;
  text-indent: 0 !important;
}

html body .tcs-site-header .tcs-navrow .tcs-shop-link::after {
  margin-left: auto !important;
  padding-left: 12px !important;
  font-size: 12px !important;
  text-indent: 0 !important;
  opacity: .85 !important;
}

/* menu chính: bỏ "viên thuốc" trắng */
html body .tcs-site-header .tcs-navrow .tcs-primary-nav {
  justify-self: start !important;
  justify-content: flex-start !important;
}

html body .tcs-site-header .tcs-navrow .tcs-primary-nav > ul,
html body .tcs-site-header .tcs-navrow .tcs-primary-nav > .menu {
  gap: 2px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  justify-content: flex-start !important;
}

html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li > a {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--tcsh-ink) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: color .16s ease, box-shadow .16s ease, background-color .16s ease !important;
}

/* gạch chân bằng box-shadow (xem ghi chú đầu file: KHÔNG dùng ::after) */
html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li > a:hover,
html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li.current-menu-item > a,
html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li.current-menu-ancestor > a {
  background: transparent !important;
  color: var(--tcsh-cta-2) !important;
  box-shadow: inset 0 -2px 0 var(--tcsh-cta) !important;
  transform: none !important;
}

/* "Gợi ý sách" được plugin tô đỏ có chủ đích -> giữ điểm nhấn nhưng làm
   thành chip có nền, thay vì chữ đỏ trơ trông như lỗi. */
html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li.tcs-recommender-menu-item > a {
  background: rgba(239, 75, 54, .09) !important;
  color: var(--tcsh-cta-2) !important;
  font-weight: 700 !important;
}

html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li.tcs-recommender-menu-item > a:hover {
  background: rgba(239, 75, 54, .16) !important;
  box-shadow: none !important;
}

/* JS chèn link "Xem tất cả sản phẩm" vào panel cho mobile; trên desktop
   dropdown hover đã có đủ lối đi nên ẩn nó đi. */
html body .tcs-site-header .tcs-vertical-dropdown .tcs-cat-all {
  display: none !important;
}

} /* ===== hết khối desktop >= 901px ===== */

/* ----------------------------------------------- màn hình vừa (901–1180px) */
@media only screen and (min-width: 901px) and (max-width: 1180px) {
  html body .tcs-site-header .tcs-mainbar .tcs-header-container {
    grid-template-columns: 196px minmax(280px, 1fr) 208px !important;
    gap: 20px !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-brand {
    flex-basis: 196px !important;
    width: 196px !important;
    max-width: 196px !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-brand img {
    max-height: 50px !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-actions,
  html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline {
    flex-basis: 208px !important;
    width: 208px !important;
    min-width: 208px !important;
    max-width: 208px !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline {
    padding: 0 12px !important;
    gap: 8px !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline strong {
    font-size: 15px !important;
  }

  /* hẹp hơn thì nút danh mục thu còn icon để không đè lên menu */
  html body .tcs-site-header .tcs-navrow > .tcs-header-container {
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 16px !important;
  }

  html body .tcs-site-header .tcs-navrow .tcs-shop-link {
    min-width: 54px !important;
    width: 54px !important;
    padding: 0 !important;
    justify-content: center !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
  }

  html body .tcs-site-header .tcs-navrow .tcs-shop-link::before {
    margin-right: 0 !important;
  }

  html body .tcs-site-header .tcs-navrow .tcs-shop-link::after {
    display: none !important;
  }

  html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li > a {
    padding: 0 10px !important;
    font-size: 15px !important;
  }
}

/* ============================================================================
   MOBILE / TABLET (<= 900px) — sửa phần vỡ sẵn, 2026-11-26
   ----------------------------------------------------------------------------
   Hiện trạng trước khi sửa, đo ở 375px: .tcs-site-header cao 3571px.
     - .tcs-vertical-dropdown: display:block, position:static, cao 2871px.
       Rule biến nó thành dropdown (absolute + ẩn) chỉ nằm trong media query
       desktop, nên ở mobile nó đổ thẳng ra trang -> 80% chiều cao header.
     - .tcs-topbar cao 123px vì khẩu hiệu dài tự xuống 3 dòng.
     - .tcs-mainbar .tcs-header-container là flex-wrap, mỗi con chiếm trọn
       chiều ngang -> logo / ô tìm kiếm / hotline xếp chồng, cao 390px.
     - .tcs-header-actions cao 198px dù chỉ chứa 1 nút hotline cao 56px.
     - 5 mục menu chính rộng tổng 533px > 375px -> tràn.

   QUYẾT ĐỊNH VỀ DROPDOWN DANH MỤC: ẩn hẳn ở mobile.
   Đã kiểm tra: .tcs-shop-link KHÔNG có JS đóng/mở, nó là link thường trỏ tới
   /shop. Vì vậy không có cơ chế bung/thu để giữ lại. Ẩn đi thì chạm vào nút
   sẽ sang thẳng trang /shop — đúng hành vi vốn có của link, và /shop có đủ
   danh mục. Muốn làm accordion thật thì phải thêm JS, là việc khác.
   ========================================================================== */
@media only screen and (max-width: 900px) {

  /* ---------------------------------------------------------------- topbar */
  html body .tcs-site-header .tcs-topbar {
    min-height: 0 !important;
  }

  html body .tcs-site-header .tcs-topbar .tcs-header-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 34px !important;
    height: 34px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    gap: 0 !important;
  }

  /* khẩu hiệu dài -> ẩn trên màn hình hẹp (chiếm 45px, 3 dòng) */
  html body .tcs-site-header .tcs-topbar .tcs-header-container > span {
    display: none !important;
  }

  html body .tcs-site-header .tcs-topbar-menu {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  html body .tcs-site-header .tcs-topbar-menu::-webkit-scrollbar {
    display: none !important;
  }

  html body .tcs-site-header .tcs-topbar-menu .menu {
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 2px !important;
  }

  html body .tcs-site-header .tcs-topbar-menu .menu > li {
    flex: 0 0 auto !important;
  }

  html body .tcs-site-header .tcs-topbar-menu a {
    padding: 0 9px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  /* submenu của topbar không được bung ra inline */
  html body .tcs-site-header .tcs-topbar-menu .sub-menu {
    display: none !important;
  }

  /* --------------------------------------------------------------- mainbar */
  /* Bố cục 2 hàng: [logo | hotline] rồi [ô tìm kiếm chiếm trọn chiều ngang] */
  html body .tcs-site-header .tcs-mainbar {
    padding: 8px 0 !important;
  }

  /* flex-direction: row là BẮT BUỘC — mặc định đang là column nên logo,
     hotline và ô tìm kiếm mỗi thứ chiếm trọn một hàng (mainbar cao 243px). */
  html body .tcs-site-header .tcs-mainbar .tcs-header-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px 10px !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-brand {
    order: 1 !important;
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 60% !important;
    /* khối logo cao cố định 72px dù ảnh chỉ 40px -> ép theo nội dung */
    height: auto !important;
    min-height: 0 !important;
    line-height: 0 !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-brand img {
    max-height: 40px !important;
    width: auto !important;
    display: block !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-actions {
    order: 2 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    gap: 7px !important;
    padding: 0 13px 0 5px !important;
    border: 1px solid #e2ecf5 !important;
    border-radius: 999px !important;
    background-color: #f7fbfe !important;
  }

  /* bỏ chữ "Hotline", giữ icon + số cho gọn */
  html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline span {
    display: none !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline::before {
    flex: 0 0 30px !important;
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background-color: #e4f0fa !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-actions .tcs-hotline strong {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #d9321d !important;
  }

  /* ô tìm kiếm: hàng riêng, chiếm trọn chiều ngang (trước bị cắt còn 253px) */
  html body .tcs-site-header .tcs-mainbar .tcs-header-search {
    order: 3 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    display: flex !important;
    height: 46px !important;
    margin: 0 !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-search:before {
    content: none !important;
    display: none !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-search form,
  html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-search-form,
  html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-sf-wrapp {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 46px !important;
    display: flex !important;
    align-items: center !important;
    border: 1.5px solid #d7e4f0 !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  html body .tcs-site-header .tcs-mainbar .tcs-header-search input[type="search"],
  html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-search-input {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 42px !important;
    padding-left: 18px !important;
    padding-right: 8px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 15px !important;
  }

  /* background-color thôi — icon kính lúp là background-image (xem đầu file) */
  html body .tcs-site-header .tcs-mainbar .tcs-header-search button,
  html body .tcs-site-header .tcs-mainbar .tcs-header-search .dgwt-wcas-search-submit {
    position: static !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 38px !important;
    margin: 0 4px 0 0 !important;
    transform: none !important;
    border: 0 !important;
    border-radius: 999px !important;
    background-color: #1273bd !important;
  }

  /* ---------------------------------------------------------------- navrow */
  html body .tcs-site-header .tcs-navrow {
    background: #fff !important;
    border-top: 1px solid #e2ecf5 !important;
  }

  html body .tcs-site-header .tcs-navrow::before {
    content: none !important;
    display: none !important;
  }

  html body .tcs-site-header .tcs-navrow > .tcs-header-container {
    display: flex !important;
    flex-direction: row !important;   /* cùng lý do với mainbar */
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 0 !important;
    padding: 7px 0 !important;
  }

  html body .tcs-site-header .tcs-shop-menu-wrap {
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
  }

  /* ĐÂY LÀ PHẦN CHÍNH: 2871px đổ ra trang -> ẩn mặc định.
     codex-header-accordion.js thêm class .tcs-mobile-open vào
     .tcs-shop-menu-wrap khi chạm vào nút, để bung panel bên dưới. */
  html body .tcs-site-header .tcs-vertical-dropdown {
    display: none !important;
  }

  /* navrow phải là mốc định vị cho panel bung ra */
  html body .tcs-site-header .tcs-navrow {
    position: relative !important;
    overflow: visible !important;
  }

  html body .tcs-site-header .tcs-shop-menu-wrap.tcs-mobile-open .tcs-vertical-dropdown {
    display: block !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
    /* 2871px nội dung -> giới hạn chiều cao và cho cuộn trong panel */
    max-height: 72vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 999 !important;
    margin: 0 !important;
    padding: 8px 12px 12px !important;
    border-top: 1px solid #e2ecf5 !important;
    border-radius: 0 0 14px 14px !important;
    background: #fff !important;
    box-shadow: 0 18px 34px rgba(8, 47, 77, .18) !important;
  }

  /* nút ở trạng thái đang mở */
  html body .tcs-site-header .tcs-shop-menu-wrap.tcs-mobile-open .tcs-shop-link {
    background-color: #0b4a76 !important;
    color: #fff !important;
  }

  /* CẤP 2 trong panel: thu gọn sẵn. Xổ hết thì panel dài 2871px, 15 danh mục
     cha bị lẫn trong 68 mục con -> rất khó quét trên điện thoại. */
  html body .tcs-site-header .tcs-vertical-dropdown .sub-menu {
    display: none !important;
  }

  html body .tcs-site-header .tcs-vertical-dropdown li.tcs-sub-open > .sub-menu {
    display: block !important;
  }

  /* nút mở cấp 2 — vùng chạm đủ lớn */
  html body .tcs-site-header .tcs-vertical-dropdown .toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: #5d6d7f !important;
    cursor: pointer !important;
  }

  html body .tcs-site-header .tcs-vertical-dropdown .toggle i {
    transition: transform .18s ease !important;
  }

  html body .tcs-site-header .tcs-vertical-dropdown li.tcs-sub-open > .toggle i {
    transform: rotate(180deg) !important;
  }

  /* link giữ lại đường vào /shop (JS chèn vào cuối panel) */
  html body .tcs-site-header .tcs-vertical-dropdown .tcs-cat-all {
    display: block !important;
    margin-top: 10px !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
    background-color: #f2f7fc !important;
    color: #0b4a76 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-decoration: none !important;
  }

  html body .tcs-site-header .tcs-shop-link {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 40px !important;
    min-height: 0 !important;   /* có rule khác ép 56px nếu không khoá min-height */
    max-height: 40px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 10px !important;
  }

  html body .tcs-site-header .tcs-shop-link::after {
    display: none !important;
  }

  /* menu chính: 1 hàng, vuốt ngang thay vì tràn */
  html body .tcs-site-header .tcs-navrow .tcs-primary-nav {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  /* thanh cuộn phải ẩn ở CẢ nav lẫn ul bên trong — phần tử cuộn thật có thể
     là ul, nên chỉ ẩn ở nav là vẫn lòi ra thanh xám */
  html body .tcs-site-header .tcs-navrow .tcs-primary-nav::-webkit-scrollbar,
  html body .tcs-site-header .tcs-navrow .tcs-primary-nav > ul::-webkit-scrollbar,
  html body .tcs-site-header .tcs-navrow .tcs-primary-nav > .menu::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  html body .tcs-site-header .tcs-navrow .tcs-primary-nav > ul,
  html body .tcs-site-header .tcs-navrow .tcs-primary-nav > .menu {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li {
    flex: 0 0 auto !important;
  }

  html body .tcs-site-header .tcs-navrow .tcs-primary-nav .menu > li > a {
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 11px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }

  /* submenu chỉ dành cho hover desktop — không được bung inline ở mobile */
  html body .tcs-site-header .tcs-navrow .tcs-primary-nav .sub-menu {
    display: none !important;
  }
}

/* --------------------------------------------------------- giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
  html body .tcs-site-header * {
    transition: none !important;
  }
}
