/* Fallback CSS only. Prefer block settings and theme.json first. */
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.ma-card { border: 1px solid var(--wp--preset--color--border); border-radius: var(--ma-radius-md); overflow: hidden; }
.ma-shadow { box-shadow: 0 12px 36px rgba(16, 24, 40, .08); }
.ma-section { padding-block: clamp(3rem, 7vw, 6rem); }
@media (max-width: 781px) {
  .wp-site-blocks > .wp-block-template-part:first-child .wp-block-group:has(> .manhan-mobile-header-bar) { min-height: var(--manhan-header-height-mobile, 70px); padding-block: 0 !important; margin-block: 0 !important; }
  .ma-mobile-stack { flex-direction: column !important; }
}

/* Sidebar Builder widgets */
.manhan-sidebar-widget { padding: 1.25rem; margin-block: 0 1rem; }
.manhan-sidebar-widget h3 { margin: 0 0 .75rem; font-size: 1.125rem; }
.manhan-sidebar-widget ul { margin: 0; padding-inline-start: 1.2rem; }
.manhan-sidebar-widget li + li { margin-block-start: .45rem; }
.manhan-sidebar-widget .search-form { display: flex; gap: .5rem; }
.manhan-sidebar-widget .search-field { min-width: 0; width: 100%; }

/* Remove link underlines across frontend content, including plugin output. */
.wp-site-blocks a,
.wp-site-blocks a:visited,
.wp-site-blocks a:hover,
.wp-site-blocks a:focus,
.wp-site-blocks a:active { text-decoration: none !important; }

/* Site-wide search field, styled as a compact pill. */
.wp-block-search .wp-block-search__inside-wrapper,
.manhan-search-form {
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(100%, 390px);
  min-height: 40px;
  padding: 3px 5px 3px 14px;
  border: 1px solid #707070;
  border-radius: 999px;
  background: #555;
  box-sizing: border-box;
}
.wp-block-search .wp-block-search__input,
.manhan-search-form .search-field {
  min-width: 0;
  flex: 1 1 auto;
  height: 32px;
  padding: 0;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 13px;
}
.wp-block-search .wp-block-search__input::placeholder,
.manhan-search-form .search-field::placeholder { color: #e4e4e4; opacity: 1; }
.wp-block-search .wp-block-search__button,
.manhan-search-form .search-submit {
  position: relative;
  display: inline-grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: transparent !important;
  font-size: 0;
  cursor: pointer;
}
.wp-block-search .wp-block-search__button::before,
.manhan-search-form .search-submit::before {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  content: "";
}
.wp-block-search .wp-block-search__button::after,
.manhan-search-form .search-submit::after {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  content: "";
  transform: rotate(45deg);
  transform-origin: center;
}

/* Classic menu locations power the responsive site header. */
.wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group,
.wp-site-blocks > .wp-block-template-part:last-child > .wp-block-group {
  box-sizing: border-box;
}
body.manhan-ai-header-width-layout .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:not(.alignfull),
body.manhan-ai-header-width-layout .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group.alignfull > .alignwide,
body.manhan-ai-footer-width-layout .wp-site-blocks > .wp-block-template-part:last-child > .wp-block-group:not(.alignfull),
body.manhan-ai-footer-width-layout .wp-site-blocks > .wp-block-template-part:last-child > .wp-block-group.alignfull > .alignwide {
  width: min(calc(100% - 32px), var(--wp--style--global--wide-size, 1200px));
  max-width: var(--wp--style--global--wide-size, 1200px);
  margin-inline: auto;
}
body.manhan-ai-header-width-full .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:not(.alignfull),
body.manhan-ai-header-width-full .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group.alignfull > .alignwide,
body.manhan-ai-footer-width-full .wp-site-blocks > .wp-block-template-part:last-child > .wp-block-group:not(.alignfull),
body.manhan-ai-footer-width-full .wp-site-blocks > .wp-block-template-part:last-child > .wp-block-group.alignfull > .alignwide {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
/* The WooCommerce Shop page is a page in WordPress, but its product archive
   should use the theme's site width like other archive templates. */
body.manhan-layout-product-archive-context .wp-site-blocks > main {
  width: min(calc(100% - 32px), var(--wp--style--global--wide-size, 1200px));
  max-width: var(--wp--style--global--wide-size, 1200px);
  margin-inline: auto;
  box-sizing: border-box;
}
.manhan-responsive-navigation { display: flex; align-items: center; gap: 22px; }
.manhan-desktop-navigation .manhan-classic-menu,
.manhan-desktop-navigation ul { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); margin: 0; padding: 0; list-style: none; }
.manhan-desktop-navigation li { position: relative; margin: 0; padding: 0; }
.manhan-desktop-navigation a { display: inline-flex; align-items: center; padding: 10px 0; color: inherit; text-decoration: none !important; }
.manhan-desktop-navigation li.menu-item-has-children > a { gap: 9px; }
.manhan-desktop-navigation li.menu-item-has-children > a::after { width: 7px; height: 7px; flex: 0 0 7px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; content: ""; transform: rotate(45deg) translateY(-2px); }
.manhan-desktop-navigation .sub-menu { position: absolute; z-index: 50; top: 100%; left: 0; display: block; min-width: 220px; margin: 0; padding: 8px 14px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.12); opacity: 0; visibility: hidden; }
.manhan-desktop-navigation .sub-menu .sub-menu { top: -1px; left: calc(100% - 1px); }
.manhan-desktop-navigation .sub-menu li { width: 100%; }
.manhan-desktop-navigation li:hover > .sub-menu,
.manhan-desktop-navigation li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
.manhan-desktop-navigation .sub-menu a { display: flex; justify-content: space-between; width: 100%; padding: 10px 5px; color: #202124; white-space: nowrap; box-sizing: border-box; }
.manhan-desktop-navigation .sub-menu li + li { border-top: 1px solid #f0f1f2; }
.manhan-desktop-navigation .sub-menu li.menu-item-has-children > a::after { transform: rotate(-45deg); }
.manhan-mobile-menu-toggle,
.manhan-mobile-menu-panel,
.manhan-mobile-menu-backdrop { display: none; }
[hidden] { display: none !important; }

/* A configured logo is the sole brand mark in the Header; the title is its fallback. */
.manhan-ai-has-logo .wp-site-blocks > .wp-block-template-part:first-child .wp-block-site-title { display: none !important; }

@media (max-width: 781px) {
  .manhan-mobile-header-bar { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 5px; width: 100%; min-height: var(--manhan-header-height-mobile, 70px); box-sizing: border-box; }
  .manhan-mobile-header-brand { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; }
  .manhan-mobile-header-brand .wp-block-site-logo { margin: 0; }
  .manhan-mobile-header-brand .custom-logo { display: block; width: auto; max-width: min(38vw, 150px); max-height: calc(var(--manhan-header-height-mobile, 70px) - 12px); object-fit: contain; }
  .manhan-mobile-header-brand .wp-block-site-title { margin: 0; max-width: 30vw; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .manhan-mobile-header-search { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; }
  .manhan-mobile-search-toggle,.manhan-mobile-header-cart { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 8px; border: 0; border-radius: 7px; background: transparent; color: inherit; cursor: pointer; }
  .manhan-mobile-search-toggle svg,.manhan-mobile-header-cart svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
  .manhan-mobile-search-toggle:hover,.manhan-mobile-header-cart:hover { background: rgba(0,0,0,.06); }
  .manhan-mobile-header-search .wp-block-search__inside-wrapper { width: 100%; }
  .manhan-mobile-header-bar>[data-mobile-item="menu"] { flex: 0 0 auto; }
  .manhan-search-modal[hidden] { display: none !important; }
  .manhan-search-modal { position: fixed; z-index: 2147483645; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: max(12vh, 56px) 16px 24px; box-sizing: border-box; opacity: 0; transition: opacity .2s ease; }
  .manhan-search-modal.is-open { opacity: 1; }
  .manhan-search-modal__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgba(12,18,28,.58); cursor: default; }
  .manhan-search-modal__dialog { position: relative; z-index: 1; width: min(100%, 560px); padding: clamp(20px, 5vw, 30px); border: 1px solid rgba(255,255,255,.7); border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.24); transform: translateY(12px) scale(.985); transition: transform .2s ease; }
  .manhan-search-modal.is-open .manhan-search-modal__dialog { transform: translateY(0) scale(1); }
  .manhan-search-modal__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
  .manhan-search-modal__eyebrow { color: #1f6f5c; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
  .manhan-search-modal__heading h2 { margin: 5px 0 0; color: #18212b; font-size: clamp(20px, 5vw, 26px); line-height: 1.25; }
  .manhan-search-modal__close { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #e7e9ed; border-radius: 50%; background: #f7f8fa; color: #344054; font-size: 24px; line-height: 1; cursor: pointer; }
  .manhan-search-modal__form>.wp-block-search,.manhan-search-modal__form>.manhan-mobile-generated-search { display: flex; width: 100%; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .manhan-search-modal__form>.manhan-mobile-generated-search { align-items: center; min-height: 50px; gap: 8px; padding: 5px 6px 5px 14px; border: 1px solid #d8dde5; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.05); }
  .manhan-search-modal__form .wp-block-search__inside-wrapper { display: flex; width: 100%; min-height: 50px; gap: 8px; padding: 5px 6px 5px 14px; border: 1px solid #d8dde5; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.05); }
  .manhan-search-modal__form input[type="search"] { min-width: 0; flex: 1 1 auto; height: 40px; border: 0 !important; outline: 0; background: transparent !important; color: #18212b !important; box-shadow: none !important; font-size: 15px; }
  .manhan-search-modal__form .wp-block-search__button { flex: 0 0 40px; width: 40px; min-width: 40px; height: 40px; border: 0; border-radius: 8px; background: #1f6f5c !important; color: #fff !important; }
  .manhan-search-modal__form .wp-block-search__button::before { border-color: #fff; }
  .manhan-search-modal__form .wp-block-search__button::after { background: #fff; }
  body.manhan-search-open { overflow: hidden; }
  .manhan-mobile-cart-count { position: absolute; top: 0; right: 0; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 999px; background: #c62828; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; }
  .manhan-mobile-header-bar>.manhan-responsive-navigation { display: flex; align-items: center; justify-content: flex-end; gap: 0; }
  .wp-site-blocks > .wp-block-template-part:first-child .wp-block-group.alignwide { padding-inline: 16px; box-sizing: border-box; }
  .manhan-desktop-navigation { display: none !important; }
  .manhan-responsive-navigation { justify-content: flex-end; }
  .manhan-mobile-menu-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 8px; border: 1px solid #e2e5e9; border-radius: 8px; background: #fff; color: #202124; cursor: pointer; }
  .manhan-menu-toggle-icon { display: grid; gap: 4px; width: 20px; }
  .manhan-menu-toggle-icon i { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
  .manhan-mobile-menu-backdrop { position: fixed; z-index: 2147483646; inset: 0; display: block; background: rgba(0,0,0,.72); opacity: 0; transition: opacity .2s ease; }
  .manhan-mobile-menu-backdrop.is-open { opacity: 1; }
  .manhan-mobile-menu-panel { position: fixed; z-index: 2147483647; inset: 0 auto 0 0; display: block; width: min(340px, 86vw); height: 100dvh; padding: 18px 20px 28px; overflow-y: auto; box-sizing: border-box; background: #fff; color: #202124; box-shadow: 12px 0 36px rgba(0,0,0,.18); transform: translateX(-105%); transition: transform .24s ease; }
  .manhan-mobile-menu-panel.is-open { transform: translateX(0); }
  .manhan-mobile-menu-brand { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 86px; padding: 32px 42px 20px 0; border-bottom: 1px solid #eceef0; font-size: 14px; font-weight: 700; }
  .manhan-mobile-menu-brand .custom-logo-link { display: inline-flex; align-items: center; max-width: 190px; }
  .manhan-mobile-menu-brand .custom-logo { display: block; width: auto; max-width: 190px; max-height: 58px; object-fit: contain; }
  .manhan-mobile-menu-close { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #f3f4f6; color: #202124; font-size: 28px; line-height: 1; cursor: pointer; }
  .manhan-mobile-menu-panel nav { margin-top: 12px; }
  .manhan-mobile-menu-panel ul { margin: 0; padding: 0; list-style: none; }
  .manhan-mobile-menu-panel li { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; margin: 0; border-bottom: 1px solid #f0f1f2; }
  .manhan-mobile-menu-panel li > a { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; padding: 13px 8px; color: #202124; font-size: 15px; line-height: 1.4; text-decoration: none !important; }
  .manhan-mobile-submenu-toggle { display: inline-grid; flex: 0 0 44px; place-items: center; align-self: stretch; min-height: 46px; margin: 0; padding: 0; border: 0; background: transparent; color: #343a40; cursor: pointer; }
  .manhan-mobile-submenu-toggle::before { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; content: ""; transform: rotate(45deg) translate(-2px, -2px); transition: transform .18s ease; }
  .manhan-mobile-submenu-toggle[aria-expanded="true"]::before { transform: rotate(225deg) translate(-2px, -2px); }
  .manhan-mobile-menu-panel .sub-menu { position: static; flex: 0 0 100%; width: calc(100% - 12px); margin: 0 0 8px 12px; border-left: 2px solid #d8dee6; border-radius: 0; background: #f8fafc; box-shadow: none; }
  .manhan-mobile-menu-panel .sub-menu[hidden] { display: none !important; }
  .manhan-mobile-menu-panel .sub-menu li:last-child { border-bottom: 0; }
  .manhan-mobile-menu-panel .sub-menu a { padding: 11px 12px; color: #4b5563; font-size: 14px; }
  .manhan-mobile-menu-panel .sub-menu .sub-menu { width: calc(100% - 12px); margin-left: 12px; }
  body.manhan-mobile-menu-open { overflow: hidden; }
}

@media (min-width: 782px) {
  .manhan-mobile-header-bar { display: none !important; }
  .wp-site-blocks > .wp-block-template-part:first-child .manhan-responsive-navigation { order: 0 !important; }
  .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child { min-height: var(--manhan-header-height-desktop, 90px); box-sizing: border-box; }
  :is(.manhan-header-preset-layout-b, .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child:has(> .manhan-responsive-navigation + .wp-block-group)) { display: grid !important; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(12px, 2vw, 32px); }
  :is(.manhan-header-preset-layout-b, .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child:has(> .manhan-responsive-navigation + .wp-block-group)) > .manhan-responsive-navigation { grid-column: 1; justify-self: start; width: 100%; justify-content: flex-start !important; }
  :is(.manhan-header-preset-layout-b, .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child:has(> .manhan-responsive-navigation + .wp-block-group)) > .manhan-secondary-navigation { grid-column: 3; justify-self: end; }
  :is(.manhan-header-preset-layout-b, .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child:has(> .manhan-responsive-navigation + .wp-block-group)) > .wp-block-group { grid-column: 2; grid-row: 1; position: static !important; justify-self: center; width: max-content; max-width: none; margin: 0; transform: none; }
  :is(.manhan-header-preset-layout-b, .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child:has(> .manhan-responsive-navigation + .wp-block-group)) .manhan-classic-menu { gap: clamp(8px, 1vw, 12px); }
  :is(.manhan-header-preset-layout-b, .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child:has(> .manhan-responsive-navigation + .wp-block-group)) .manhan-classic-menu > li > a { white-space: nowrap; }
  :is(.manhan-header-preset-layout-b, .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child:has(> .manhan-responsive-navigation + .wp-block-group)) .wp-block-site-title,
  :is(.manhan-header-preset-layout-b, .wp-site-blocks > .wp-block-template-part:first-child > .wp-block-group:first-child:has(> .manhan-responsive-navigation + .wp-block-group)) .wp-block-site-title a { white-space: nowrap; }
  .manhan-header-preset-layout-c,
  .manhan-header-preset-layout-d { display: flex !important; flex-direction: column; align-items: center; justify-content: center; }
  .manhan-header-preset-layout-c > *,
  .manhan-header-preset-layout-d > * { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .manhan-mobile-menu-panel,
  .manhan-mobile-menu-backdrop,
  .manhan-search-modal,
  .manhan-search-modal__dialog { transition: none; }
}
