/* =======================================================
   CLOUDX FLIC UI - HEADER v1.8.4
   Chỉ đổi khung Header từ 2 tầng -> 1 tầng.
   Mega Menu/Dropdown "Khóa ôn luyện" được giữ nguyên ở file riêng.
======================================================= */

/* Ẩn Header Astra gốc khi Header CloudX đang hoạt động. */
.cloudx-flic-ui-active .site-header:not(.cflic-header),
.cloudx-flic-ui-active #masthead:not(.cflic-header),
.cloudx-flic-ui-active .ast-mobile-header-wrap {
  display: none !important;
}

.cflic-header {
  position: relative;
  z-index: 99990;
  background: #fff;
  color: #172033;
  font-family: var(--cflic-font, "Be Vietnam Pro", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ================= SINGLE HEADER BAR ================= */
.cflic-navbar-single {
  background: #ffffff;
  border-top: 1px solid #eef2f5;
  border-bottom: 1px solid #e5e9ef;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .045);
}

.cflic-header .cflic-container {
  width: min(1620px, calc(100% - 64px));
  max-width: 1620px;
  margin: 0 auto;
}

.cflic-navbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 20px;
  position: relative;
}

/* Logo giữ nguyên file/logo do WordPress cung cấp, không filter/recolor. */
.cflic-brand {
  flex: 0 0 auto;
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
}

.cflic-brand .custom-logo-link,
.cflic-brand > a {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.cflic-brand img,
.cflic-brand .custom-logo {
  display: block;
  width: auto;
  max-width: 190px;
  max-height: 58px;
  object-fit: contain;
  filter: none !important;
}

.cflic-brand-text {
  color: #1558a6;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  text-decoration: none !important;
}

/* Trang chủ nằm cùng hàng với menu thay cho ô Home ở tầng menu cũ. */
.cflic-home-text {
  flex: 0 0 auto;
  min-height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  margin: 0;
  background: transparent !important;
  color: #151b24 !important;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color .16s ease;
}

.cflic-home-text:hover {
  color: #4b6687 !important;
}

.cflic-home-text,
.cflic-nav-menu > li > a,
.cflic-nav-menu > li > .menu-link,
.cflic-search-top input,
.cflic-account {
  letter-spacing: -0.01em;
}

.cflic-navigation {
  flex: 1 1 auto;
  min-width: 0;
}

.cflic-nav-menu,
.cflic-nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cflic-nav-menu {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap !important;
  gap: 4px;
  min-width: 0;
}

.cflic-nav-menu > li {
  position: relative;
  flex: 0 0 auto;
}

.cflic-nav-menu > li > a,
.cflic-nav-menu > li > .menu-link {
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  color: #151b24 !important;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none !important;
  white-space: nowrap !important;
  background: transparent !important;
  transition: color .16s ease, box-shadow .16s ease;
}

.cflic-nav-menu > li:hover > a,
.cflic-nav-menu > li.current-menu-item > a,
.cflic-nav-menu > li.current-menu-ancestor > a,
.cflic-nav-menu > li.flic-mega:focus-within > a {
  color: #4c6686 !important;
  background: transparent !important;
  box-shadow: inset 0 -2px 0 #58779a;
}

/* Sub-menu WordPress thông thường; không áp dụng cho Mega Menu riêng. */
.cflic-nav-menu .sub-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 230px;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 0 !important;
  box-shadow: 0 14px 30px rgba(31, 45, 61, .13);
  z-index: 99999;
}

.cflic-nav-menu li:hover > .sub-menu,
.cflic-nav-menu li:focus-within > .sub-menu {
  display: block;
}

.cflic-nav-menu .sub-menu a {
  display: block;
  padding: 11px 15px;
  color: #252b33 !important;
  text-decoration: none !important;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid #eef1f4;
}

.cflic-nav-menu .sub-menu a:hover {
  background: #f5f7fa;
  color: #4c6686 !important;
}

/* ================= SEARCH ================= */
.cflic-top-search-wrap,
.cflic-header-search-wrap {
  flex: 0 1 390px;
  width: 390px;
  margin-left: auto;
}

.cflic-search-top {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #cfd6df;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: none;
}

.cflic-search-top:focus-within {
  border-color: #91a0b2;
  box-shadow: 0 0 0 3px rgba(76, 102, 134, .08);
}

.cflic-search-top input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  padding: 0 14px !important;
  background: transparent !important;
  color: #202832;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
}

.cflic-search-top input::placeholder {
  color: #8b95a2;
  opacity: 1;
}

.cflic-search-top button {
  flex: 0 0 46px;
  width: 46px;
  height: 100%;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-left: 1px solid #4f6c8d !important;
  border-radius: 0 !important;
  background: #526f92 !important;
  color: #fff;
  line-height: 1 !important;
  cursor: pointer;
  transition: background .16s ease;
}

.cflic-search-top button:hover {
  background: #456382 !important;
  color: #fff;
}

.cflic-search-top button svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* ================= CART + ACCOUNT ================= */
.cflic-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: 4px;
}

.cflic-cart,
.cflic-account {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #243246 !important;
  text-decoration: none !important;
  border: 1px solid #d9dee5;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(30, 43, 57, .055);
  transition: box-shadow .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.cflic-cart:hover,
.cflic-account:hover {
  color: #4c6686 !important;
  border-color: #c5cdd7;
  box-shadow: 0 5px 14px rgba(30, 43, 57, .09);
  transform: translateY(-1px);
}

.cflic-cart {
  position: relative;
  width: 46px;
  padding: 0;
}

.cflic-cart-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cflic-cart-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.cflic-cart-count {
  position: absolute;
  top: -8px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #526f92;
  color: #fff;
  border: 2px solid #fff;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cflic-account-wrap {
  display: inline-flex;
  align-items: center;
}

.cflic-account {
  gap: 7px;
  min-width: 122px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.cflic-account-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cflic-account-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* Không còn cấu trúc Topbar + Navbar 2 tầng. */
.cflic-topbar,
.cflic-top-links {
  display: none !important;
}

/* Mobile-only */
.cflic-mobile-toggle,
.cflic-mobile-quick-actions,
.cflic-mobile-panel {
  display: none;
}

.cflic-mobile-search-details {
  position: relative;
}

.cflic-mobile-search-details > summary {
  list-style: none;
}

.cflic-mobile-search-details > summary::-webkit-details-marker {
  display: none;
}

/* Tablet desktop: ưu tiên giữ 1 hàng, thu nhẹ search/menu. */
@media (max-width: 1320px) and (min-width: 922px) {
  .cflic-header .cflic-container {
    width: calc(100% - 36px);
  }

  .cflic-navbar-inner {
    gap: 12px;
  }

  .cflic-brand {
    min-width: 155px;
  }

  .cflic-brand img,
  .cflic-brand .custom-logo {
    max-width: 160px;
    max-height: 52px;
  }

  .cflic-home-text,
  .cflic-nav-menu > li > a,
  .cflic-nav-menu > li > .menu-link {
    font-size: 13.5px;
  }

  .cflic-nav-menu > li > a,
  .cflic-nav-menu > li > .menu-link {
    padding-left: 8px;
    padding-right: 8px;
  }

  .cflic-top-search-wrap,
  .cflic-header-search-wrap {
    flex-basis: 300px;
    width: 300px;
  }
}


/* =======================================================
   v1.8.8 - Header typography refinement
   Inter 400/500, kích thước cân đối hơn và không dùng chữ đậm.
======================================================= */
.cflic-header-single,
.cflic-header-single input,
.cflic-header-single button,
.cflic-header-single a {
  font-family: var(--cflic-font, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 922px) {
  .cflic-header-single .cflic-home-text,
  .cflic-header-single .cflic-nav-menu > li > a,
  .cflic-header-single .cflic-nav-menu > li > .menu-link {
    font-size: 16px !important;
    font-weight: 500 !important;
    letter-spacing: -0.012em !important;
  }

  .cflic-header-single .cflic-nav-menu .sub-menu a,
  .cflic-header-single .flic-mega-panel a {
    font-size: 15px !important;
    font-weight: 400 !important;
    letter-spacing: -0.008em !important;
  }

  .cflic-header-single .cflic-search-top input {
    font-size: 15px !important;
    font-weight: 400 !important;
  }

  .cflic-header-single .cflic-account {
    font-size: 15px !important;
    font-weight: 500 !important;
  }

  .cflic-header-single .cflic-cart-count {
    font-weight: 500 !important;
  }
}

@media (max-width: 921px) {
  .cflic-header-single .cflic-mobile-panel .cflic-nav-menu > li > a,
  .cflic-header-single .cflic-mobile-panel .cflic-nav-menu > li > .menu-link {
    font-size: 15.5px !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
  }

  .cflic-header-single .cflic-mobile-panel .sub-menu a,
  .cflic-header-single .cflic-mobile-panel .flic-mega-panel a,
  .cflic-header-single .cflic-mobile-actions a {
    font-size: 15px !important;
    font-weight: 400 !important;
  }

  .cflic-header-single .cflic-mobile-search-inline input,
  .cflic-header-single .cflic-mobile-search-inline button {
    font-size: 14.5px !important;
    font-weight: 400 !important;
  }
}
