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

.cnfsm-header {
  position: relative;
  z-index: 999;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  background: #fff;
  color: #0f172a;
  isolation: isolate;
}

.cnfsm-header--sticky {
  position: sticky;
  top: 0;
}

.admin-bar .cnfsm-header--sticky {
  top: 32px;
}

.cnfsm-header--overlay {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  background: transparent;
  border-bottom-color: transparent;
}

.cnfsm-header__inner {
  width: min(100% - 32px, 1320px);
  min-height: 84px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

.cnfsm-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.cnfsm-brand img {
  display: block;
  width: 120px;
  max-height: 62px;
  object-fit: contain;
}

.cnfsm-brand__text {
  color: #0f172a;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.cnfsm-desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.cnfsm-desktop-nav > ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cnfsm-desktop-nav li {
  position: relative;
  margin: 0;
}

.cnfsm-desktop-nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 0;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, opacity .2s ease;
}

.cnfsm-desktop-nav .menu-item-has-children > a::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.cnfsm-desktop-nav .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  min-width: 230px;
  margin: 0;
  padding: 10px;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.cnfsm-desktop-nav .sub-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  right: 0;
  left: 0;
  height: 12px;
}

.cnfsm-desktop-nav li:hover > .sub-menu,
.cnfsm-desktop-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.cnfsm-desktop-nav .sub-menu a {
  padding: 12px 14px;
  color: #0f172a;
  border-radius: 10px;
}

.cnfsm-desktop-nav .sub-menu a:hover {
  background: #f5f3ff;
}

.cnfsm-desktop-nav .sub-menu .sub-menu {
  top: -10px;
  left: calc(100% + 8px);
  transform: translate(8px, 0);
}

.cnfsm-desktop-nav .sub-menu li:hover > .sub-menu,
.cnfsm-desktop-nav .sub-menu li:focus-within > .sub-menu {
  transform: translate(0, 0);
}

.cnfsm-home-link {
  display: inline-flex !important;
  width: 42px;
  height: 42px;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 12px;
}

.cnfsm-home-link svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.cnfsm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.cnfsm-icon-btn,
.cnfsm-menu-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  background: #fff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.cnfsm-icon-btn:hover,
.cnfsm-menu-toggle:hover {
  background: #f8fafc;
  border-color: rgba(124, 58, 237, .25);
  transform: translateY(-1px);
}

.cnfsm-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.cnfsm-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: #facc15;
  color: #111827;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(250, 204, 21, .25);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s ease, filter .2s ease;
}

.cnfsm-cta:hover {
  filter: brightness(.98);
  transform: translateY(-2px);
}

.cnfsm-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.cnfsm-menu-toggle span {
  display: block;
  width: 21px;
  height: 2px;
  background: currentColor;
  border-radius: 99px;
  transition: transform .2s ease, opacity .2s ease;
}

.cnfsm-search-panel {
  position: absolute;
  z-index: 1001;
  top: 100%;
  right: 0;
  left: 0;
  padding: 18px 20px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
  backdrop-filter: blur(16px);
}

.cnfsm-search-panel[hidden],
.cnfsm-backdrop[hidden] {
  display: none;
}

.cnfsm-search-form {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 9px 10px 9px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 18px;
}

.cnfsm-search-form svg,
.cnfsm-mobile-search svg {
  width: 20px;
  fill: none;
  stroke: #64748b;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.cnfsm-search-form input,
.cnfsm-mobile-search input {
  min-width: 0;
  background: transparent !important;
  color: #0f172a;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  font-size: 16px;
}

.cnfsm-search-form button[type="submit"] {
  padding: 12px 18px;
  background: #111827;
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.cnfsm-search-close {
  padding: 0 8px;
  background: transparent;
  color: #64748b;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.cnfsm-backdrop {
  position: fixed;
  z-index: 9998;
  inset: 0;
  background: rgba(2, 6, 23, .56);
  opacity: 0;
  backdrop-filter: blur(5px);
  transition: opacity .24s ease;
}

.cnfsm-backdrop.is-open {
  opacity: 1;
}

.cnfsm-drawer {
  position: fixed;
  z-index: 9999;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(92vw, 420px);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  background: #fff;
  box-shadow: -22px 0 70px rgba(2, 6, 23, .22);
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}

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

.cnfsm-drawer__head {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 82px;
  padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: inherit;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.cnfsm-brand--drawer img {
  width: auto;
  max-width: 150px;
  max-height: 50px;
}

.cnfsm-drawer-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
  background: #f1f5f9;
  color: #0f172a;
  border: 0;
  border-radius: 14px;
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
}

.cnfsm-mobile-search {
  flex: 0 0 auto;
  margin: 16px 18px 10px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 15px;
}

.cnfsm-mobile-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 18px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, .35) transparent;
}

.cnfsm-mobile-nav::-webkit-scrollbar {
  width: 5px;
}

.cnfsm-mobile-nav::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, .35);
  border-radius: 999px;
}

.cnfsm-mobile-nav ul {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cnfsm-mobile-nav li {
  width: 100%;
  margin: 0;
  padding: 0;
}

.cnfsm-mobile-nav > ul > li {
  border-bottom: 1px solid rgba(15, 23, 42, .075);
}

.cnfsm-mobile-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cnfsm-mobile-nav a {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: normal;
}

.cnfsm-mobile-nav > ul > li > a,
.cnfsm-mobile-nav > ul > li > .cnfsm-mobile-row > a {
  min-height: 58px;
  padding: 15px 4px;
}

.cnfsm-mobile-row > a {
  flex: 1 1 auto;
}

.cnfsm-mobile-nav a > span:not(.cnfsm-link-icon) {
  min-width: 0;
}

.cnfsm-mobile-nav .cnfsm-submenu-toggle {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  background: #f1f5f9;
  color: #0f172a;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.cnfsm-mobile-nav .cnfsm-submenu-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .2s ease;
}

.cnfsm-mobile-nav .menu-item-has-children.is-open > .cnfsm-mobile-row > .cnfsm-submenu-toggle {
  background: #e9e5ff;
  color: #6d28d9;
}

.cnfsm-mobile-nav .menu-item-has-children.is-open > .cnfsm-mobile-row > .cnfsm-submenu-toggle::before {
  transform: rotate(225deg) translate(-1px, -1px);
}

.cnfsm-mobile-nav .sub-menu {
  display: none;
  width: 100%;
  margin: 0 0 12px;
  padding: 7px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: 14px;
}

.cnfsm-mobile-nav .menu-item-has-children.is-open > .sub-menu {
  display: block;
}

.cnfsm-mobile-nav .sub-menu li + li {
  margin-top: 2px;
}

.cnfsm-mobile-nav .sub-menu a,
.cnfsm-mobile-nav .sub-menu .cnfsm-mobile-row > a {
  min-height: 46px;
  padding: 11px 12px;
  color: #475569;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.cnfsm-mobile-nav .sub-menu a:hover,
.cnfsm-mobile-nav .sub-menu a:focus-visible,
.cnfsm-mobile-nav .sub-menu .current-menu-item > a {
  background: #fff;
  color: #0f172a;
}

.cnfsm-mobile-nav .sub-menu .cnfsm-submenu-toggle {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  margin-right: 5px;
  border-radius: 9px;
}

.cnfsm-mobile-nav .sub-menu .sub-menu {
  margin: 3px 0 8px 10px;
  width: calc(100% - 10px);
  background: #fff;
  border-color: rgba(15, 23, 42, .06);
}

.cnfsm-mobile-nav .sub-menu .sub-menu a,
.cnfsm-mobile-nav .sub-menu .sub-menu .cnfsm-mobile-row > a {
  padding-left: 14px;
  color: #64748b;
  font-size: 13.5px;
}

.cnfsm-mobile-nav .current-menu-item > a,
.cnfsm-mobile-nav .current-menu-ancestor > .cnfsm-mobile-row > a {
  color: #6d28d9;
}

.cnfsm-drawer__footer {
  flex: 0 0 auto;
  padding: 14px max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: inherit;
  border-top: 1px solid rgba(15, 23, 42, .08);
}

.cnfsm-cta--mobile {
  width: 100%;
  min-height: 50px;
}

.cnfsm-link-icon {
  flex: 0 0 auto;
  display: inline-flex;
}

.cnfsm-link-icon svg {
  width: 18px;
  height: 18px;
}

.cnfsm-lock-scroll {
  overflow: hidden !important;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cnfsm-header button:focus-visible,
.cnfsm-header a:focus-visible,
.cnfsm-header input:focus-visible {
  outline: 3px solid rgba(124, 58, 237, .35);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  .admin-bar .cnfsm-header--sticky {
    top: 46px;
  }

  .cnfsm-header__inner {
    width: min(100% - 24px, 1320px);
    grid-template-columns: auto 1fr;
    gap: 14px;
  }

  .cnfsm-actions {
    grid-column: 2;
  }

  .cnfsm-brand img {
    max-height: 52px;
  }

  .cnfsm-actions > .cnfsm-search-toggle {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .cnfsm-header__inner {
    width: min(100% - 20px, 1320px);
    min-height: 68px;
  }

  .cnfsm-brand img {
    width: 96px;
    max-height: 46px;
  }

  .cnfsm-actions {
    gap: 8px;
  }

  .cnfsm-icon-btn,
  .cnfsm-menu-toggle {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .cnfsm-search-panel {
    padding: 12px;
  }

  .cnfsm-search-form {
    padding: 8px 8px 8px 14px;
    grid-template-columns: auto 1fr auto;
  }

  .cnfsm-search-form button[type="submit"] {
    display: none;
  }

  .cnfsm-search-close {
    font-size: 26px;
  }

  .cnfsm-drawer {
    width: min(94vw, 390px);
  }

  .cnfsm-drawer__head {
    min-height: 74px;
    padding-left: 16px;
  }

  .cnfsm-brand--drawer img {
    max-width: 128px;
    max-height: 44px;
  }

  .cnfsm-mobile-search {
    margin-right: 14px;
    margin-left: 14px;
  }

  .cnfsm-mobile-nav {
    padding-right: 14px;
    padding-left: 14px;
  }

  .cnfsm-mobile-nav a {
    font-size: 15.5px;
  }

  .cnfsm-mobile-nav > ul > li > a,
  .cnfsm-mobile-nav > ul > li > .cnfsm-mobile-row > a {
    min-height: 54px;
    padding-top: 13px;
    padding-bottom: 13px;
  }
}

@media (max-width: 380px) {
  .cnfsm-drawer {
    width: 100vw;
    max-width: none;
  }

  .cnfsm-mobile-nav .sub-menu .sub-menu {
    margin-left: 5px;
    width: calc(100% - 5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cnfsm-header * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
