/* ===== JPB Design Polish — авсаархан толгой хэсэг (header) =====
   Бүтэц (Storefront): .jpb-annbar → header#masthead{ .col-full(мөр 1) + .storefront-primary-navigation(мөр 2) } → .jpb-hdchips
   JS: ul#site-header-cart ба button.menu-toggle-ийг мөр 1 рүү зөөнө; body.jpb-stuck (scroll>140px) */
:root { --jpb-hd-navy: #0B1F3A; }

/* ---- Sticky (JS: body.jpb-stuck + .jpb-hd-ph placeholder; #page/body overflow-x:hidden тул position:sticky ажиллахгүй) ---- */
body.jpb-hd-v2 #masthead.site-header { position: relative; z-index: 990; padding: 0 !important; margin: 0 !important; box-shadow: none; }
body.jpb-hd-v2.jpb-stuck #masthead.site-header { position: fixed !important; top: 0; left: 0; right: 0; width: 100%; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); transition: transform .25s ease; }
body.jpb-hd-v2.jpb-stuck.admin-bar #masthead.site-header { top: 32px; }
@media (max-width: 600px) { body.jpb-hd-v2.jpb-stuck.admin-bar #masthead.site-header { top: 0; } }
body.jpb-hd-v2.jpb-stuck .storefront-primary-navigation { display: none !important; }
body.jpb-hd-v2 .jpb-hd-ph { display: none; }
body.jpb-hd-v2.jpb-stuck .jpb-hd-ph { display: block; }

/* ---- Мөр 1: лого · нэр · хайлт · бүртгэл · сагс ---- */
body.jpb-hd-v2 #masthead > .col-full {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 9px 16px !important;
  min-height: 62px;
  max-width: 1148px;
  margin: 0 auto;
}
body.jpb-hd-v2 #masthead > .col-full::before, body.jpb-hd-v2 #masthead > .col-full::after { display: none !important; }
body.jpb-hd-v2 .site-branding { flex: 0 0 auto !important; width: auto !important; float: none !important; margin: 0 !important; padding: 0 !important; display: flex; align-items: center; }
body.jpb-hd-v2 .site-branding .custom-logo-link { margin: 0 !important; display: block; line-height: 0; }
body.jpb-hd-v2 .site-branding img.custom-logo { width: 42px !important; height: 42px !important; max-width: 42px !important; object-fit: contain; border-radius: 8px; background: #fff; }
body.jpb-hd-v2 .jpb-hd-brand { display: flex; flex-direction: column; justify-content: center; text-decoration: none !important; line-height: 1.1; margin-left: 2px; }
body.jpb-hd-v2 .jpb-hd-brand b { color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .08em; white-space: nowrap; }
body.jpb-hd-v2 .jpb-hd-brand small { color: #C9A84C; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; margin-top: 3px; white-space: nowrap; }
body.jpb-hd-v2 .jpb-header-tagline, body.jpb-hd-v2 .jpb-mob-title { display: none !important; }
body.jpb-hd-v2 .site-search { flex: 1 1 auto !important; width: auto !important; max-width: 520px; float: none !important; margin: 0 auto !important; padding: 0 !important; clear: none !important; }
body.jpb-hd-v2 .site-search .widget { margin: 0 !important; }
body.jpb-hd-v2 .site-search .woocommerce-product-search { max-width: none !important; position: relative; }
body.jpb-hd-v2 .site-search input[type="search"] { width: 100%; height: 42px; border-radius: 21px !important; padding: 0 44px 0 18px !important; border: 1px solid #d8d2c2 !important; font-size: 14px !important; background: #fff; }
body.jpb-hd-v2 .site-search form::before { display: none !important; content: none !important; }
body.jpb-hd-v2 .site-search button[type="submit"] { position: absolute !important; left: auto !important; right: 4px !important; top: 4px !important; height: 34px !important; width: 34px !important; clip: auto !important; clip-path: none !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; border-radius: 50% !important; background: #C9A84C !important; color: #0B1F3A !important; border: 0 !important; font-size: 0 !important; line-height: 34px; cursor: pointer; }
body.jpb-hd-v2 .site-search button[type="submit"]:hover { background: #A8843C !important; }
body.jpb-hd-v2 .site-search button[type="submit"]::before { content: ''; display: block; width: 16px; height: 16px; margin: 0 auto; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1F3A' stroke-width='2.4' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") center/contain no-repeat; }
/* Бүртгэл (account) icon */
body.jpb-hd-v2 .jpb-hd-acct { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #C9A84C !important; text-decoration: none !important; }
body.jpb-hd-v2 .jpb-hd-acct:hover { background: rgba(255, 255, 255, .08); }
body.jpb-hd-v2 .jpb-hd-acct svg { width: 24px; height: 24px; }
/* Сагс (мөр 1 рүү зөөгдсөн) */
body.jpb-hd-v2 #masthead > .col-full > ul.site-header-cart { flex: 0 0 auto; margin: 0 !important; float: none !important; width: auto !important; position: relative; list-style: none; padding: 0; }
body.jpb-hd-v2 #masthead > .col-full > ul.site-header-cart > li { list-style: none; }
body.jpb-hd-v2 ul.site-header-cart a.cart-contents {
  display: inline-flex !important; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px !important;
  border: 1px solid rgba(201, 168, 76, .55); border-radius: 20px; color: #fff !important; text-decoration: none !important; white-space: nowrap; font-size: 13.5px; line-height: 1;
}
body.jpb-hd-v2 ul.site-header-cart a.cart-contents:hover { border-color: #C9A84C; background: rgba(255, 255, 255, .06); }
body.jpb-hd-v2 ul.site-header-cart a.cart-contents::after { position: static !important; order: -1; width: auto !important; height: auto !important; margin: 0 !important; font-size: 17px !important; line-height: 1 !important; color: #C9A84C !important; display: inline-block !important; }
body.jpb-hd-v2 ul.site-header-cart a.cart-contents .amount { font-weight: 700; color: #fff; }
body.jpb-hd-v2 ul.site-header-cart a.cart-contents .count { display: inline-block; background: #C9A84C !important; color: #0B1F3A !important; font-weight: 800; font-size: 11.5px; padding: 3px 8px; border-radius: 10px; }
body.jpb-hd-v2 ul.site-header-cart .widget_shopping_cart { left: auto !important; right: 0 !important; top: 100% !important; width: 320px; margin-top: 8px !important; border-radius: 12px; overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s; display: block !important; }
body.jpb-hd-v2 ul.site-header-cart:hover .widget_shopping_cart, body.jpb-hd-v2 ul.site-header-cart.focus .widget_shopping_cart, body.jpb-hd-v2 ul.site-header-cart li:hover > .widget_shopping_cart { opacity: 1; visibility: visible; pointer-events: auto; }

/* ---- Мөр 2: цэс ---- */
body.jpb-hd-v2 .storefront-primary-navigation { padding: 0 !important; margin: 0 !important; border-top: 1px solid rgba(255, 255, 255, .08); }
body.jpb-hd-v2 .storefront-primary-navigation > .col-full { display: flex; justify-content: center; align-items: center; padding: 0 16px !important; min-height: 44px; }
body.jpb-hd-v2 .storefront-primary-navigation > .col-full::before, body.jpb-hd-v2 .storefront-primary-navigation > .col-full::after { display: none !important; }
body.jpb-hd-v2 nav#site-navigation.main-navigation { width: auto !important; float: none !important; margin: 0 !important; }
body.jpb-hd-v2 .main-navigation ul.menu.nav-menu { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; margin: 0; }
body.jpb-hd-v2 .main-navigation ul.menu.nav-menu > li { margin: 0; }
body.jpb-hd-v2 .main-navigation ul.menu.nav-menu > li > a { padding: 12px 11px !important; font-size: 13.5px !important; font-weight: 600 !important; line-height: 1 !important; color: #fff !important; border-radius: 8px; }
body.jpb-hd-v2 .main-navigation ul.menu.nav-menu > li > a:hover, body.jpb-hd-v2 .main-navigation ul.menu.nav-menu > li.current-menu-item > a { color: #C9A84C !important; background: rgba(255, 255, 255, .06); }
body.jpb-hd-v2 .main-navigation ul.menu.nav-menu > li.menu-item-has-children > a::after { margin-left: 5px !important; font-size: 10px !important; opacity: .8; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
  body.jpb-hd-v2 #masthead > .col-full { gap: 8px; padding: 6px 10px !important; min-height: 56px; }
  /* Hamburger: DOM байрлал нь nav дотроо хэвээр (Storefront navigation.js эхний button-ыг барьдаг), харагдах байрлал нь мөр 1-ийн зүүн */
  body.jpb-hd-v2 #masthead > .col-full { padding-left: 58px !important; }
  body.jpb-hd-v2 .storefront-primary-navigation, body.jpb-hd-v2 .storefront-primary-navigation > .col-full, body.jpb-hd-v2 nav#site-navigation.main-navigation { position: static !important; }
  body.jpb-hd-v2 nav#site-navigation button.menu-toggle {
    position: absolute !important; top: 8px; left: 10px; z-index: 6; width: 40px; height: 40px; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 10px; background: rgba(255, 255, 255, .08) !important; color: #C9A84C !important; font-size: 0 !important; line-height: 0; display: block !important; box-shadow: none !important;
  }
  body.jpb-hd-v2 nav#site-navigation button.menu-toggle::before,
  body.jpb-hd-v2 nav#site-navigation button.menu-toggle::after,
  body.jpb-hd-v2 nav#site-navigation button.menu-toggle span::before { display: none !important; content: none !important; }
  body.jpb-hd-v2 nav#site-navigation button.menu-toggle span { display: block; width: 22px; height: 22px; margin: 0 auto; font-size: 0; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2.4' stroke-linecap='round'><path d='M4 7h16M4 12h16M4 17h16'/></svg>") center/contain no-repeat; }
  body.jpb-hd-v2 nav#site-navigation.toggled button.menu-toggle span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2.4' stroke-linecap='round'><path d='M6 6l12 12M18 6 6 18'/></svg>"); }
  body.jpb-hd-v2 .site-branding img.custom-logo { width: 38px !important; height: 38px !important; max-width: 38px !important; }
  body.jpb-hd-v2 .jpb-hd-brand b { font-size: 14px; }
  body.jpb-hd-v2 .jpb-hd-brand small { font-size: 9.5px; }
  body.jpb-hd-v2 .site-search { display: none !important; }
  body.jpb-hd-v2 .jpb-hd-acct { display: none; }
  body.jpb-hd-v2 #masthead > .col-full > ul.site-header-cart { display: block !important; margin-left: auto !important; }
  body.jpb-hd-v2 ul.site-header-cart a.cart-contents { height: 40px; width: 40px; padding: 0 !important; justify-content: center; border-radius: 50%; gap: 0; }
  body.jpb-hd-v2 ul.site-header-cart a.cart-contents .amount { display: none !important; }
  body.jpb-hd-v2 ul.site-header-cart a.cart-contents .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; line-height: 18px; text-align: center; font-size: 11px; }
  body.jpb-hd-v2 ul.site-header-cart a.cart-contents::after { content: '' !important; display: block !important; width: 22px !important; height: 22px !important; font-size: 0 !important; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 4h2l2.4 11.2a1.5 1.5 0 0 0 1.5 1.2h8.6a1.5 1.5 0 0 0 1.5-1.1L21 8H6.2'/><circle cx='10' cy='20' r='1.3'/><circle cx='17' cy='20' r='1.3'/></svg>") center/contain no-repeat; }
  body.jpb-hd-v2 ul.site-header-cart a.cart-contents .count[data-n] { font-size: 0 !important; }
  body.jpb-hd-v2 ul.site-header-cart a.cart-contents .count[data-n]::after { content: attr(data-n); font-size: 11px; }
  body.jpb-hd-v2 ul.site-header-cart .widget_shopping_cart { display: none !important; }
  /* Мөр 2: зөвхөн нээгдсэн handheld цэс */
  body.jpb-hd-v2 .storefront-primary-navigation { border-top: 0; }
  body.jpb-hd-v2 .storefront-primary-navigation > .col-full { min-height: 0; padding: 0 !important; display: block; }
  body.jpb-hd-v2 nav#site-navigation.main-navigation { width: 100% !important; }
  body.jpb-hd-v2 .main-navigation .handheld-navigation { padding: 4px 0 10px; }
  body.jpb-hd-v2 .main-navigation .handheld-navigation ul.menu > li { position: relative; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  body.jpb-hd-v2 .main-navigation .handheld-navigation ul.menu li a { display: block; padding: 13px 16px !important; color: #fff !important; font-size: 15px; font-weight: 600; text-decoration: none !important; }
  body.jpb-hd-v2 .main-navigation .handheld-navigation ul.menu > li.menu-item-has-children > a { padding-right: 56px !important; }
  /* Дэд цэсний toggle (JS-ээр нэмэгдэнэ) */
  body.jpb-hd-v2 .handheld-navigation button.jpb-sub-toggle { position: absolute; top: 4px; right: 8px; width: 40px; height: 40px; border: 0 !important; background: transparent !important; padding: 0 !important; margin: 0 !important; cursor: pointer; }
  body.jpb-hd-v2 .handheld-navigation button.jpb-sub-toggle::before { content: ''; display: block; width: 18px; height: 18px; margin: 0 auto; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") center/contain no-repeat; transition: transform .18s; }
  body.jpb-hd-v2 .handheld-navigation li.jpb-open > button.jpb-sub-toggle::before { transform: rotate(180deg); }
  body.jpb-hd-v2 .handheld-navigation ul.sub-menu { display: none !important; position: static !important; visibility: visible !important; opacity: 1 !important; transform: none !important; width: auto !important; margin: 0 !important; padding: 4px 0 8px !important; background: rgba(0, 0, 0, .22) !important; box-shadow: none !important; }
  body.jpb-hd-v2 .handheld-navigation li.jpb-open > ul.sub-menu { display: block !important; max-height: none !important; height: auto !important; overflow: visible !important; }
  body.jpb-hd-v2 .handheld-navigation ul.sub-menu li { border: 0 !important; }
  body.jpb-hd-v2 .handheld-navigation ul.sub-menu li a { padding: 10px 16px 10px 30px !important; font-size: 14px; font-weight: 500; color: #E9E4D6 !important; }
  body.jpb-hd-v2 .handheld-navigation ul.sub-menu li a::before { content: '– '; color: #C9A84C; }
  body.jpb-hd-v2 .handheld-navigation button.dropdown-toggle { display: none !important; }
  body.jpb-hd-v2.jpb-stuck .storefront-primary-navigation { display: block !important; }
}
@media (min-width: 769px) {
  body.jpb-hd-v2 nav#site-navigation button.menu-toggle { display: none !important; }
}
/* Брэндийн чипс: хамгийн урд "Нүүр" */
body.jpb-hd-v2 .jpb-hdchips-in a.jpb-chip-home { background: #0B1F3A !important; color: #fff !important; border-color: #0B1F3A !important; display: inline-flex; align-items: center; gap: 6px; }
body.jpb-hd-v2 .jpb-hdchips-in a.jpb-chip-home::before { content: ''; display: inline-block; width: 14px; height: 14px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11 12 3l9 8'/><path d='M5 10v10h5v-6h4v6h5V10'/></svg>") center/contain no-repeat; }
body.jpb-hd-v2 .jpb-hdchips-in a.jpb-chip-home:hover { background: #C9A84C !important; color: #0B1F3A !important; border-color: #C9A84C !important; }
