/* assets/css/header.css */

/* ============ Vars ============ */
:root {
  --lc-text: #0f172a;
  --lc-muted: #475569;

  --lc-pill-bg-top: rgba(255, 255, 255, .92);
  --lc-pill-bg-bot: rgba(236, 239, 244, .92);
  --lc-pill-border: rgba(255, 255, 255, .75);

  --lc-shadow: 0 14px 30px rgba(0, 0, 0, .18);
  --lc-shadow-soft: 0 8px 18px rgba(0, 0, 0, .12);

  --lc-active-bg: #5e6166;
  /* pill "Home" */
  --lc-hover-bg: rgba(15, 23, 42, .06);
}

/* Prevent body scroll when mobile menu is open */
.lock-scroll {
  overflow: hidden !important;
  height: 100vh !important;
}

/* ============ Header wrapper ============ */
.lc-header {
  position: fixed;
  /* floating như design */
  left: 0;
  right: 0;
  top: 0;
  z-index: 9999;
  padding: 10px 30px;
  pointer-events: none;
  /* chỉ cho pill nhận click */
}

/* WP admin bar */
.admin-bar .lc-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .lc-header {
    top: 46px;
  }
}

.lc-header .lc-header__row {
  pointer-events: auto;
}

/* Container */
.lc-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 10px;
}

/* ============ The pill bar ============ */
.lc-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 10px 30px;
  border-radius: 999px;

  background: linear-gradient(180deg, var(--lc-pill-bg-top) 0%, var(--lc-pill-bg-bot) 100%);
  border: 1px solid var(--lc-pill-border);
  box-shadow: var(--lc-shadow);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ============ Brand / Logo ============ */
.lc-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--lc-text);
  min-width: 210px;
  /* giữ layout giống design */
  padding-left: 30px;
}

.lc-brand img,
.lc-brand .custom-logo {
  height: 34px;
  width: auto;
  display: block;
}

.lc-brand .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.lc-brand__text {
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 18px;
}

/* ============ Nav ============ */
.lc-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.lc-menu {
  list-style: none;
  margin: 0;
  padding: 0;

  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
}

.lc-menu>li {
  margin: 0;
  padding: 0;
}

.lc-menu>li>a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 38px;
  padding: 10px 14px;
  border-radius: 999px;

  color: var(--lc-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;

  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

/* .lc-menu > li > a:hover{
  background: var(--lc-hover-bg);
  height: 38px;
  padding: 0 16px;
} */

/* Active menu pill (Home) */
.lc-menu>li.current-menu-item>a,
.lc-menu>li.current_page_item>a {
  background: var(--lc-active-bg);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  height: 38px;
  padding: 0 16px;
}

/* default: không nền */
.lc-menu>li>a {
  background: transparent;
  padding: 0 16px;
}

/* active do JS gán */
.lc-menu>li.is-active:not(.menu-item-has-children)>a {
  background: #5e6166;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  height: 38px;
  padding: 0 16px;
}


/* Dropdown caret (Resources ▼) */
.lc-menu>li.menu-item-has-children>a::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
  opacity: .75;
}

/* ============ Actions right ============ */
.lc-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lc-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 14px 20px;
  border-radius: 999px;

  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;

  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}

.lc-action:active {
  transform: translateY(1px);
}

/* Partner Login (white pill) */
.lc-action--light {
  color: var(--lc-text);
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: var(--lc-shadow-soft);
}

.lc-action--light:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(15, 23, 42, .14);
}

/* Become a Dealer (grey pill) */
/* ===== Become a Dealer (ghost) - padding theo TEXT ===== */
a.lc-action.lc-action--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 42px;
  min-width: 60px;

  padding: 0;
  /* quan trọng: bỏ padding ở container */
  gap: 4px;
  /* gap giữa label và icon */
  border-radius: 120px;

  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(15, 23, 42, .08);
  color: var(--lc-text);

  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}

/* Padding theo TEXT (đúng như Figma) */
.lc-action--ghost .lc-action__label {
  display: inline-flex;
  align-items: center;

  padding: 12px 0 12px 16px;
  /* top right bottom left (đo theo text) */
  font-size: 14px;
  line-height: 18px;
  /* để 42 - 24 = 18 khớp Figma */
  font-weight: 700;
}

.lc-action--ghost .lc-action__label strong {
  font-weight: 800;
}

/* Icon box: giữ size cố định, và đảm bảo right padding = 4px */
.lc-action--ghost .lc-action__icon {
  width: 34px;
  height: 34px;
  margin: 4px 4px 4px 0;
  /* top right bottom left -> right=4px đúng Figma */

  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(15, 23, 42, .12);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .10);

  /* icon svg/png dạng background (đổi path theo icon thật) */
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;

  transform: rotate(0deg);
  transition: transform .22s ease;
}

a.lc-action.lc-action--ghost:hover {
  background: #0A0A09;
  border-color: rgba(15, 23, 42, .14);
  color: #FFFFFF;
}

/* Hover: icon rotate -90deg */
/* .lc-action--ghost:hover .lc-action__icon,
.js-dealer-btn.is-hover .lc-action__icon,
.lc-action--ghost:focus-visible .lc-action__icon{
  transform: rotate(-90deg);
} */


/* Burger (hidden desktop) */
.lc-burger {
  display: none;
  flex-direction: column;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: rgba(32, 42, 77, 1);
  box-shadow: var(--lc-shadow-soft);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
}

.lc-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 2px;
  transform-origin: center;
  transition: transform .22s ease, opacity .18s ease;
}

.lc-burger.is-active span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.lc-burger.is-active {
  background: rgba(114, 64, 49, 1);
  border: 3px solid rgba(114, 64, 49, 1);
}

.lc-burger.is-active span:nth-child(2) {
  opacity: 0;
}

.lc-burger.is-active span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* ============ Mobile drawer ============ */
.lc-mobile {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10000;
  display: none !important;
  /* HI FIX: hide by default */
  flex-direction: column;
  margin-top: 15px;
  padding: 24px;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);

  /* Reset potentially conflicting styles */
  width: auto;
  min-width: unset;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.lc-mobile__inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.lc-menu--mobile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: auto;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin-bottom: 24px;
}

.lc-menu--mobile>li>a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--lc-text);
  text-decoration: none;
  background: rgba(32, 42, 77, 1);
}

.lc-menu--mobile>li.is-active>a {
  background: rgba(32, 42, 77, 1);
  color: #fff;
}

/* Submenu indentation */
.lc-menu--mobile .sub-menu {
  position: static !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: auto !important;
  min-width: unset !important;
  padding: 8px 0 8px 24px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  box-shadow: none !important;
  background: transparent !important;
  border: none !important;
}

.lc-menu--mobile .sub-menu a {
  font-size: 15px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
}

.lc-mobile__actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding-top: 24px !important;
  margin-top: auto !important;
  /* Push actions to the bottom if there is space */
}

.lc-mobile__actions .lc-action {
  display: flex !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  font-size: 15px !important;
  margin: 0 !important;
  position: static !important;
  justify-content: center !important;
  align-items: center !important;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .lc-brand {
    min-width: unset;
  }

  .lc-nav {
    display: none !important;
  }

  .lc-burger {
    display: inline-flex !important;
  }

  .lc-actions .lc-action--light,
  .lc-actions .lc-action--ghost {
    display: none !important;
  }

  .lc-actions {
    gap: 0 !important;
  }
}


.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.custom-logo {
  height: 34px;
  width: auto;
  display: block;
}


/* ===== Align header like design: logo-left, nav-center, actions-right ===== */
.lc-headerbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* logo left fixed */
.lc-headerbar .wp-block-site-logo {
  flex: 0 0 auto;
  margin: 0 !important;
}

.lc-headerbar .wp-block-site-logo img {
  max-height: 34px;
  width: auto;
  display: block;
}

/* nav center takes remaining space */
.lc-headerbar .wp-block-navigation {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

/* buttons right fixed */
.lc-headerbar .wp-block-buttons {
  flex: 0 0 auto;
}

/* ===== Menu default (không có background) ===== */
.lc-menu>li>a {
  background: transparent;
  color: var(--lc-text);
  border-radius: 999px;
  padding: 10px 14px;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

/* Hover*/
.lc-menu>li>a:hover {
  background: var(--Primary, #202A4D);
  color: #FFFFFE;
  padding: 0 16px;
}

/* ===== Active/current page -> mới có pill background ===== */
/* WP gắn các class này tùy trường hợp */
.lc-menu>li.current-menu-item>a,
.lc-menu>li.current_page_item>a,
.lc-menu>li.current-menu-ancestor>a,
.lc-menu>li.current-menu-parent>a {
  background: var(--Primary, #202A4D);
  color: #FFFFFE;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  padding: 0 16px;
}

/* ===== Dropdown base ===== */
.lc-menu li {
  position: relative;
}

/* submenu box */
.lc-menu .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;

  min-width: 190px;
  padding: 10px;
  margin: 0;
  list-style: none;

  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);

  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;

  z-index: 9999;
}

/* show level-2 on hover */
.lc-menu>li:hover>.sub-menu,
.lc-menu>li:focus-within>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* submenu item links */
.lc-menu .sub-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 12px;
  border-radius: 10px;

  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.1;

  background: transparent;
}

.lc-menu .sub-menu a:hover {
  background: #202A4D;
  color: #fff;
}

/* ===== Level-3 (submenu of submenu) open to the right ===== */
.lc-menu .sub-menu .sub-menu {
  top: 0;
  left: calc(100% + 10px);
  transform: translateY(0) translateX(-6px);
}

/* show level-3 when hover the parent inside submenu */
.lc-menu .sub-menu>li:hover>.sub-menu,
.lc-menu .sub-menu>li:focus-within>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* caret for items that have children (Policy ►) */
.lc-menu .sub-menu>li.menu-item-has-children>a::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: .6;
}

.lc-action--ghost strong {
  margin-left: .28em;
  /* tuỳ chỉnh 0.2–0.35em */
}

/* Hover/click states (JS toggles) */
.js-dealer-btn.is-hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

.js-dealer-btn.is-clicked {
  transform: translateY(1px) scale(.99);
}

/* Icon wrapper (vòng tròn như design) */
.lc-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 34px;
  height: 34px;
  margin-left: 10px;

  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(15, 23, 42, .12);
}

/* Icon image */
.lc-action__icon img {
  width: 18px;
  height: 18px;
  display: block;

  transform: rotate(0deg);
  transition: transform .28s cubic-bezier(.2, .9, .2, 1.2);
  /* tốc độ xoay */
  transform-origin: center center;
}

/* Hover (mouse) + Focus (keyboard) + Touch class */
/* .js-dealer-btn:hover .lc-action__icon img,
.js-dealer-btn:focus-visible .lc-action__icon img,
.js-dealer-btn.is-hover .lc-action__icon img{
  transform: rotate(-90deg);
} */


/* ===== Override .lc-container ONLY inside header ===== */
.lc-header .lc-container {
  width: 100% !important;
  max-width: none !important;
  /* bỏ giới hạn 1240/var(--lc-container) */
  padding: 0 !important;
  /* tránh cộng padding ngoài ý muốn */
  margin: 0 !important;
}

/* Nếu header row của bạn đang là: <div class="lc-container lc-header__row"> */
.lc-header .lc-container.lc-header__row {
  height: 60px;
  /* Figma */
  gap: 10px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(236, 239, 244, .92) 100%);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Canh 3 vùng */
.lc-header .lc-header__row .lc-brand {
  flex: 0 0 auto;
}

.lc-header .lc-header__row .lc-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.lc-header .lc-header__row .lc-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}


/* =========================================================
   DROPDOWN MENU – match Design (image 2)
   Paste at END of header.css
 ========================================================= */

/* Submenu container (both levels) */
.lc-menu .sub-menu {
  padding: 0;
  /* no inner padding like design */
  margin: 0;
  min-width: 176px;
  overflow: hidden;
  /* make separators + hover flush */
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);

  /* keep your existing animation behavior */
  opacity: 0;
  visibility: hidden;
  z-index: 9999;
}

/* Level 2 placement (Resources dropdown) – align under parent like design */
.lc-menu>li>.sub-menu {
  top: calc(100% + 8px);
  left: 0;
  /* giống hình 2: bám theo item */
  transform: translateY(6px);
}

/* Show level-2 on hover/focus */
.lc-menu>li:hover>.sub-menu,
.lc-menu>li:focus-within>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Submenu links – full width rows */
.lc-menu .sub-menu>li>a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* keeps arrow on "Policy" */
  gap: 12px;

  padding: 10px 14px;
  border-radius: 0;
  /* flush, no inset */
  background: transparent;

  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.15;
}

/* Separator lines between items (like design) */
.lc-menu .sub-menu>li+li>a {
  border-top: 1px solid rgba(15, 23, 42, .06);
}

/* Hover/active state (navy highlight) */
.lc-menu .sub-menu>li:hover>a,
.lc-menu .sub-menu>li:focus-within>a,
.lc-menu .sub-menu>li.current-menu-item>a,
.lc-menu .sub-menu>li.current_page_item>a {
  background: #202A4D;
  color: #fff;
}

/* Level 3 (submenu of submenu) open to the right */
.lc-menu .sub-menu .sub-menu {
  top: 0;
  left: calc(100% + 6px);
  /* small gap like design */
  transform: translateX(6px);
}

/* Show level-3 when hover the parent inside submenu */
.lc-menu .sub-menu>li:hover>.sub-menu,
.lc-menu .sub-menu>li:focus-within>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Caret for items that have children (Policy ►) */
.lc-menu .sub-menu>li.menu-item-has-children>a::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: .7;
}

/* Top-level caret (Resources ▼) rotate UP when open */
.lc-menu>li.menu-item-has-children:hover>a::after,
.lc-menu>li.menu-item-has-children:focus-within>a::after {
  transform: rotate(-135deg);
  /* up caret like design */
  opacity: .9;
}

/* Mobile: keep it simple (avoid absolute dropdown on drawer) */
@media (max-width: 1024px) {
  .lc-menu--mobile .sub-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
    margin-top: 6px;
  }

  .lc-menu--mobile .sub-menu>li+li>a {
    border-top: 0 !important;
  }

  .lc-menu--mobile .sub-menu>li>a {
    padding: 8px 12px !important;
  }
}


/* FIX: không cắt submenu cấp 3 */
.lc-menu .sub-menu {
  overflow: visible !important;
  /* QUAN TRỌNG */
}

/* đảm bảo submenu cấp 3 nổi lên trên */
.lc-menu .sub-menu .sub-menu {
  z-index: 10000 !important;
}


/* =========================================
   FIX: menu level-1 không bị "nhảy" khi hover
 ========================================= */
.lc-menu>li>a {
  box-sizing: border-box;
  height: 38px;
  padding: 0 16px;
  /* dùng 1 giá trị cố định */
  line-height: 38px;
  /* chữ luôn giữa */
}

/* hover/focus chỉ đổi màu, KHÔNG đổi padding/height */
.lc-menu>li>a:hover,
.lc-menu>li>a:focus {
  height: 38px;
  padding: 0 16px;
}

/* active/current cũng không đổi padding/height */
.lc-menu>li.current-menu-item>a,
.lc-menu>li.current_page_item>a,
.lc-menu>li.current-menu-ancestor>a,
.lc-menu>li.current-menu-parent>a {
  height: 38px;
  padding: 0 16px;
}


/* =========================================================
   FIX: Parent giữ "active" khi đang hover submenu (dropdown open)
 ========================================================= */

/* 1) Khi li đang hover (vì con trỏ đang ở submenu) thì vẫn highlight parent */
.lc-menu>li.menu-item-has-children:hover>a,
.lc-menu>li.menu-item-has-children:focus-within>a {
  background: var(--Primary, #202A4D);
  color: #FFFFFE;
}

/* 2) Nếu parent đang là current (đang ở trang con), luôn giữ active */
.lc-menu>li.current-menu-item>a,
.lc-menu>li.current_page_item>a,
.lc-menu>li.current-menu-parent>a,
.lc-menu>li.current-menu-ancestor>a {
  background: var(--Primary, #202A4D);
  color: #FFFFFE;
}

/* 3) Khi vừa current vừa mở dropdown (hover/focus-within), vẫn giữ active */
.lc-menu>li.current-menu-parent:hover>a,
.lc-menu>li.current-menu-ancestor:hover>a,
.lc-menu>li.current-menu-parent:focus-within>a,
.lc-menu>li.current-menu-ancestor:focus-within>a {
  background: var(--Primary, #202A4D);
  color: #FFFFFE;
}


/* =========================================================
   FIX: Click toggle dropdown (không dùng :focus-within)
 ========================================================= */

/* SHOW level-2 */
.lc-menu>li:hover>.sub-menu,
.lc-menu>li.is-open>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Parent giữ active khi dropdown đang mở (hover hoặc click-open) */
.lc-menu>li.menu-item-has-children:hover>a,
.lc-menu>li.menu-item-has-children.is-open>a {
  background: var(--Primary, #202A4D);
  color: #FFFFFE;
}

/* SHOW level-3 */
.lc-menu .sub-menu>li:hover>.sub-menu,
.lc-menu .sub-menu>li.is-open>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* FIX: tắt hiệu ứng focus-within cũ nếu còn tồn tại ở file */
.lc-menu>li:focus-within>.sub-menu {
  opacity: 0;
  visibility: hidden;
}

.lc-menu .sub-menu>li:focus-within>.sub-menu {
  opacity: 0;
  visibility: hidden;
}


/* show dropdown bằng class is-open */
.lc-menu>li.is-open>.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* giữ active cho parent khi đang mở */
.lc-menu>li.menu-item-has-children.is-open>a {
  background: var(--Primary, #202A4D);
  color: #FFFFFE;
}


/* ===== SHOW submenu theo .is-open (cả level 2 & level 3) ===== */
.lc-menu li.is-open>.sub-menu,
.lc-menu li.is-open:focus-within>.sub-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Level 2 */
.lc-menu>li>.sub-menu {
  transform: translateY(6px);
}

.lc-menu>li.is-open>.sub-menu,
.lc-menu>li.is-open:focus-within>.sub-menu {
  transform: translateY(0) !important;
}

/* Level 3 (bay sang phải) */
.lc-menu .sub-menu .sub-menu {
  left: calc(100% + 6px);
  top: 0;
  transform: translateX(6px);
}

.lc-menu .sub-menu>li.is-open>.sub-menu,
.lc-menu .sub-menu>li.is-open:focus-within>.sub-menu {
  transform: translateX(0) !important;
  z-index: 10000 !important;
}


/* caret cấp 1 đổi theo is-open (không chỉ hover) */
.lc-menu>li.menu-item-has-children.is-open>a::after {
  transform: rotate(-135deg) !important;
  /* caret hướng lên */
  opacity: .9;
}

/* =========================================================
   FIX caret Resources: chỉ đổi khi is-open, KHÔNG theo hover
 ========================================================= */

/* trạng thái mặc định: caret DOWN */
.lc-menu>li.menu-item-has-children>a::after {
  transform: rotate(45deg) !important;
  /* down */
  transition: transform .2s ease, opacity .2s ease;
  opacity: .75;
}

/* mở menu (click -> is-open): caret UP */
.lc-menu>li.menu-item-has-children.is-open>a::after {
  transform: rotate(-135deg) !important;
  /* up */
  opacity: .95;
}

/* override rule cũ đang xoay theo hover (nếu có) */
.lc-menu>li.menu-item-has-children:hover>a::after,
.lc-menu>li.menu-item-has-children:focus-within>a::after {
  transform: rotate(45deg) !important;
  /* luôn down khi chỉ hover */
}

/* nhưng nếu vừa hover vừa is-open thì vẫn UP */
.lc-menu>li.menu-item-has-children.is-open:hover>a::after,
.lc-menu>li.menu-item-has-children.is-open:focus-within>a::after {
  transform: rotate(-135deg) !important;
}

/* =========================================================
   HEADER ACTIONS: Button group like design (image 1)
 ========================================================= */
@media (min-width: 901px) {

  /* Outer group pill */
  .lc-actions {
    gap: 0 !important;
    padding-right: 8px !important;
  }

  /* Reset both buttons to be segments (no riêng lẻ pill) */
  .lc-actions .lc-action {
    height: 44px;
    padding: 0 20px !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  /* Left segment: Partner Login (brown) */
  .lc-actions .lc-action--light {
    background: #6B3E30 !important;
    /* nâu */
    color: #fff !important;
    border-radius: 999px 0 0 999px !important;
    margin-right: 2px !important;
  }

  /* Right segment: Become a Partner (navy) */
  .lc-actions a.lc-action.lc-action--ghost {
    background: #202A4D !important;
    /* navy */
    color: #fff !important;
    height: 44px !important;
    padding: 0 5px 0 18px !important;
    border-radius: 0 999px 999px 0 !important;
    position: relative;
  }

  /* Divider giữa 2 segment */
  .lc-actions a.lc-action.lc-action--ghost::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: rgba(255, 255, 255, .28);
  }

  /* Label trong nút right: bỏ padding cũ */
  .lc-action--ghost .lc-action__label {
    padding: 0 !important;
    line-height: 1 !important;
  }

  /* Icon tròn bên phải */
  .lc-action--ghost .lc-action__icon {
    width: 34px !important;
    height: 34px !important;
    margin: 0 0 0 12px !important;

    background: rgba(255, 255, 255, .95) !important;
    border: 1px solid rgba(255, 255, 255, .65) !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .15) !important;
    transform: none !important;
    /* bỏ rotate */
  }

  /* Hover nhẹ cho cả group */
  .lc-actions .lc-action:hover {
    filter: brightness(1.05);
  }
}

/* =========================================================
   CLICK-ONLY DROPDOWN (disable hover open)
 ========================================================= */

/* 1) Tắt hoàn toàn mở bằng hover/focus-within (đè tất cả rule cũ) */
.lc-menu>li:hover>.sub-menu,
.lc-menu>li:focus-within>.sub-menu,
.lc-menu .sub-menu>li:hover>.sub-menu,
.lc-menu .sub-menu>li:focus-within>.sub-menu {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 2) Chỉ mở khi có class is-open */
.lc-menu li.is-open>.sub-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Level 2 animation */
.lc-menu>li>.sub-menu {
  transform: translateY(6px);
}

.lc-menu>li.is-open>.sub-menu {
  transform: translateY(0) !important;
}

/* Level 3 animation */
.lc-menu .sub-menu .sub-menu {
  transform: translateX(6px);
}

.lc-menu .sub-menu>li.is-open>.sub-menu {
  transform: translateX(0) !important;
}

/* 3) Caret: chỉ đổi khi is-open (không đổi theo hover) */
.lc-menu>li.menu-item-has-children>a::after {
  transform: rotate(45deg) !important;
  /* down */
  transition: transform .2s ease, opacity .2s ease;
  opacity: .75;
}

/* =========================================================
   FIX: is-open phải thắng rule disable-hover (cả level 2 & 3)
 ========================================================= */

/* Level 2: click mở luôn thắng */
.lc-menu>li.is-open>.sub-menu,
.lc-menu>li.is-open:hover>.sub-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Level 3: click mở luôn thắng (kể cả đang hover) */
.lc-menu .sub-menu>li.is-open>.sub-menu,
.lc-menu .sub-menu>li.is-open:hover>.sub-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
}


/* =========================================================
   LAPTOP FIX (901px–1100px): tránh header bị cấn/đè
 ========================================================= */
@media (min-width: 901px) and (max-width: 1100px) {

  /* bớt padding ngoài + trong pill */
  .lc-header {
    padding: 8px 14px !important;
  }

  .lc-header .lc-container.lc-header__row {
    padding: 8px 16px !important;
    /* giảm 10 30 */
    gap: 10px !important;
    height: 50px !important;
    width: min(var(--lc-container), calc(100% - 40px)) !important;
  }

  /* logo: giảm min-width + bỏ đẩy trái nhiều */
  .lc-brand {
    min-width: 160px !important;
    /* giảm 210/180 */
    padding-left: 10px !important;
    /* giảm 30 */
    gap: 8px !important;
  }

  .lc-brand img,
  .lc-brand .custom-logo {
    height: 30px !important;
    /* giảm nhẹ */
  }

  /* nav: cho phép co lại thay vì đẩy actions ra ngoài */
  .lc-nav {
    min-width: 0 !important;
  }

  .lc-menu {
    gap: 4px !important;
  }

  .lc-menu>li>a {
    font-size: 13px !important;
    padding: 0 12px !important;
    /* giảm 0 16 */
    height: 36px !important;
    line-height: 36px !important;
  }

  /* actions group: thu nhỏ để vừa 1024 */
  .lc-actions {
    flex: 0 0 auto;
    padding-right: 6px !important;
  }

  .lc-actions .lc-action {
    height: 40px !important;
    /* giảm 44 */
    padding: 0 14px !important;
    /* giảm 0 20 */
    font-size: 13px !important;
  }

  /* nút right (Become a Partner) */
  .lc-actions a.lc-action.lc-action--ghost {
    height: 40px !important;
    padding: 0 4px 0 14px !important;
  }

  .lc-action--ghost .lc-action__icon {
    width: 32px !important;
    height: 32px !important;
    margin-left: 10px !important;
  }
}


/* =========================================================
   LAPTOP 1024 FIX (co lại đúng element .lc-header__row)
 ========================================================= */
@media (min-width: 901px) and (max-width: 1150px) {

  /* bớt padding ngoài để pill không bị cấn sát mép */
  .lc-header {
    padding: 8px 12px !important;
  }

  /* co pill bar đúng element */
  .lc-header__row {
    padding: 8px 14px !important;
    /* giảm 10 30 */
    gap: 10px !important;
  }

  /* cho phép nav co lại đúng kiểu flex */
  .lc-nav {
    min-width: 0 !important;
  }

  .lc-menu {
    min-width: 0 !important;
    gap: 4px !important;
  }

  /* giảm menu item */
  .lc-menu>li>a {
    height: 34px !important;
    line-height: 34px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
  }

  /* logo co lại */
  .lc-brand {
    min-width: 150px !important;
    padding-left: 10px !important;
    gap: 8px !important;
  }

  .lc-brand img,
  .lc-brand .custom-logo {
    height: 30px !important;
  }

  /* actions co lại thêm (nếu bạn đang dùng group design) */
  .lc-actions {
    padding: 3px !important;
  }

  .lc-actions .lc-action {
    height: 38px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
  }

  .lc-actions a.lc-action.lc-action--ghost {
    height: 38px !important;
    padding: 0 4px 0 12px !important;
  }

  .lc-action--ghost .lc-action__icon {
    width: 30px !important;
    height: 30px !important;
    margin-left: 8px !important;
  }
}










/* Final Immersive Mobile Menu Fix */
@media (max-width: 1024px) {

  /* Hide Desktop Elements */
  .lc-header .lc-header__row .lc-nav {
    display: none !important;
  }

  .lc-header .lc-header__row .lc-actions>*:not(.lc-burger) {
    display: none !important;
  }

  /* Burger */
  .lc-header .lc-header__row .lc-actions .lc-burger {
    display: flex !important;
    margin: 0 !important;
    cursor: pointer !important;
    z-index: 1000 !important;
  }

  .lc-header .lc-header__row .lc-actions {
    gap: 0 !important;
  }

  /* FULL-SCREEN DRAWER */
  .lc-header .lc-mobile {
    display: none !important;
    position: fixed !important;
    top: 75px !important;
    left: 0 !important;
    width: 95vw !important;
    height: auto !important;
    max-height: calc(100vh - 110px) !important;
    z-index: 1000000 !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 auto !important;
    overflow-y: auto !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .lc-header .lc-mobile.is-active {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }

  .lc-header .lc-mobile__inner {
    display: flex !important;
    flex-direction: column !important;
    /* width: 100% !important; */
    max-width: 500px !important;
    /* Cap width for larger tablets but stays centered */
    min-height: auto !important;
    max-height: none !important;
    /* Changed from height: 100% to allow expansion */
    padding: 20px 16px !important;
    position: relative !important;
    pointer-events: auto !important;
    margin: 0 auto !important;
    /* Ensure children are clickable */
  }

  /* Close Button */
  .lc-header .lc-mobile__close {
    position: absolute !important;
    top: 24px !important;
    right: -65px !important;
    width: 48px !important;
    height: 48px !important;
    background: rgba(114, 64, 49, 1) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 50% !important;
    color: transparent !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  }

  .lc-header .lc-mobile__close::before,
  .lc-header .lc-mobile__close::after {
    content: '' !important;
    position: absolute !important;
    width: 20px !important;
    height: 2px !important;
    background-color: #0f172a !important;
    border-radius: 2px !important;
    transition: transform 0.3s ease !important;
  }

  .lc-header .lc-mobile__close::before {
    transform: rotate(45deg) !important;
  }

  .lc-header .lc-mobile__close::after {
    transform: rotate(-45deg) !important;
  }

  .lc-header .lc-mobile__close:hover {
    background: #f1f5f9 !important;
    transform: rotate(90deg) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1) !important;
  }

  .lc-header .lc-mobile__close:active {
    transform: scale(0.9) rotate(90deg) !important;
  }

  /* Target direct children of Inner for Order */
  .lc-header .lc-mobile__inner>nav {
    order: 1 !important;
    margin-bottom: 30px !important;
    width: 100% !important;
  }

  .lc-header .lc-mobile__inner>.lc-mobile__actions {
    order: 2 !important;
    width: 100% !important;
  }

  /* Navigation Links */
  .lc-header .lc-menu--mobile {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    gap: 12px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .lc-header .lc-menu--mobile li {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0 !important;
  }

  .lc-header .lc-menu--mobile li a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Centered */
    height: 60px !important;
    padding: 0 25px !important;
    border-radius: 50px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    text-decoration: none !important;
    width: 100% !important;
    position: relative !important;
  }

  .lc-header .lc-menu--mobile li a:hover,
  .lc-header .lc-menu--mobile li a:focus-visible {
    background: rgba(32, 42, 77, 1) !important;
    color: #ffffff !important;
  }

  .lc-header .lc-menu--mobile li.current-menu-item>a,
  .lc-header .lc-menu--mobile li.current_page_item>a,
  .lc-header .lc-menu--mobile li.is-open>a {
    background: rgba(32, 42, 77, 1)!important;
    color: #ffffff !important;
  }

  .lc-header .lc-menu--mobile li.menu-item-has-children.is-active>a:not(:hover):not(:focus-visible) {
    background: transparent !important;
    color: #0f172a !important;
  }

  .lc-header .lc-menu--mobile .sub-menu {
    display: none !important;
    /* Hidden by default for accordion logic */
    flex-direction: column !important;
    gap: 6px !important;
    padding: 10px 0 !important;
    /* Removed left padding to allow centering */
    list-style: none !important;
  }

  .lc-header .lc-menu--mobile li.is-open>.sub-menu {
    display: flex !important;
  }

  /* Caret indicator for items with children */
  .lc-header .lc-menu--mobile li.menu-item-has-children>a::after {
    position: absolute !important;
    right: 25px !important;
    /* Keep caret on the right edge while text centers */
    font-size: 24px !important;
    transition: transform .3s ease !important;
  }

  .lc-header .lc-menu--mobile li.menu-item-has-children.is-open>a::after {
    transform: rotate(-135deg) !important;
  }

  .lc-header .lc-menu--mobile .sub-menu li a {
    height: auto !important;
    padding: 12px 0 !important;
    background: transparent !important;
    font-size: 16px !important;
    color: #64748b !important;
    font-weight: 500 !important;
    justify-content: center !important;
    /* Centered */
  }

  /* Action Buttons Area */
  .lc-header .lc-mobile__actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
  }

  .lc-header .lc-mobile__actions .lc-action {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 58px !important;
    border-radius: 29px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .lc-header .lc-mobile__actions .lc-action--light {
    background: #ffffff !important;
    border: 2px solid #f1f5f9 !important;
    color: #0f172a !important;
  }

  .lc-header .lc-mobile__actions .lc-action--ghost {
    background: #0f172a !important;
    color: #ffffff !important;
  }
}

@media (max-width: 600px) {
  .lc-header .lc-brand {
    max-width: 120px !important;
  }

  .lc-header .custom-logo {
    height: 24px !important;
  }

  .lc-header .lc-mobile__inner {
    padding:20px 10px !important;
  }
}

@media (max-width: 1024px) {
  .lc-header .lc-mobile__actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 18px !important;
  }

  .lc-header .lc-mobile__actions .lc-actions--mobile {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    padding-right: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    justify-content: center !important;
    margin-inline: auto !important;
    overflow: visible !important;
    border-radius: 0 !important;
  }

  .lc-header .lc-mobile__actions .lc-actions--mobile .lc-action {
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 0 !important;
    height: 44px !important;
    padding: 0 20px !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
    font-size: 14px !important;
    white-space: nowrap !important;
  }

  .lc-header .lc-mobile__actions .lc-actions--mobile .lc-action--light {
    background: #6B3E30 !important;
    color: #fff !important;
    border-radius: 999px 0 0 999px !important;
    margin-right: 2px !important;
  }

  .lc-header .lc-mobile__actions .lc-actions--mobile a.lc-action.lc-action--ghost {
    background: #202A4D !important;
    color: #fff !important;
    height: 44px !important;
    padding: 0 5px 0 18px !important;
    border-radius: 0 999px 999px 0 !important;
    position: relative !important;
  }

  .lc-header .lc-mobile__actions .lc-actions--mobile a.lc-action.lc-action--ghost::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: rgba(255, 255, 255, .28);
  }

  .lc-header .lc-mobile__actions .lc-actions--mobile .lc-action--ghost .lc-action__label {
    padding: 0 !important;
    line-height: 1 !important;
  }

  .lc-header .lc-mobile__actions .lc-actions--mobile .lc-action--ghost .lc-action__icon {
    width: 34px !important;
    height: 34px !important;
    margin: 0 0 0 12px !important;
    background: rgba(255, 255, 255, .95) !important;
    border: 1px solid rgba(255, 255, 255, .65) !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .15) !important;
    transform: none !important;
  }
}