/* Header refresh 1.0.3. Scoped to the opt-in class; dropdown styles stay in the theme. */
.kd-header-v2 { --kd-ink:#123d51; --kd-accent:#ef7c39; background:#fff; }
/* Container widths intentionally come from the site's Bootstrap grid. */
.kd-header-v2 .site_top_menu { gap:28px; padding:12px 0; font-size:13px; line-height:20px; }
.kd-header-v2 .site_top_menu .new_menu_logo,.kd-header-v2 .new_phone_top { width:auto; flex:0 0 auto; }
.kd-header-v2 .ask-phone { text-align:left; }
.kd-header-v2 .ask-phone a { text-underline-offset:4px; }
.kd-header-v2 .ask-phone a:hover { text-decoration:underline; }
.kd-header-v2 .main_phone a { color:var(--kd-ink); border:0; font-size:16px; font-weight:700; white-space:nowrap; }
.kd-header-v2 .top_sub_menu { flex:1; gap:28px; }
.kd-header-v2 .top_sub_menu p { margin:0; }
.kd-header-v2 .top_sub_menu a { color:#53616a; white-space:nowrap; }
.kd-header-v2 .top_sub_menu a:hover { color:var(--kd-accent); }
.kd-header-v2 #header_sticky { border-top:1px solid #edf0f2; }
.kd-header-v2 .new_menu { display:grid; grid-template-columns:240px minmax(210px,1fr) 150px 230px; gap:24px; padding:20px 0; }
.kd-header-v2 .new_menu > div { width:auto; min-width:0; }
.kd-header-v2 .new_menu_logo img { width:100%; max-width:240px; height:auto; display:block; }
.kd-header-v2 .new_menu_phone iframe { display:block; max-width:none; }
.kd-header-v2 .new_menu_icons .new_icons_items { gap:16px; }
.kd-header-v2 .new_icons_items > div { flex:1; min-width:0; }
.kd-header-v2 .new_icons_items a { color:var(--kd-ink); display:inline-flex; justify-content:center; align-items:center; min-width:36px; min-height:36px; }
.kd-header-v2 .new_icons_items a:hover { color:var(--kd-accent); }
.kd-header-v2 .top_icons_desc { font-size:11px; line-height:18px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kd-header-v2 .header-wish-icon { display:block; }
.kd-header-v2 .counter-wish { top:-5px; right:0; }
.kd-header-v2 .global_search form { display:flex; width:100%; margin:0; border:1px solid #d8dfe3; border-radius:7px; background:#fff; }
.kd-header-v2 .global_search .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; }
.kd-header-v2 .global_search form:focus-within { border-color:var(--kd-ink); box-shadow:0 0 0 2px #123d5114; }
.kd-header-v2 .global_search .search-field { width:100%; min-width:0; flex:1; height:44px; border:0; border-radius:7px 0 0 7px; padding:0 14px; color:var(--kd-ink); font-size:14px; background-color:transparent; }
.kd-header-v2 .global_search button { flex:0 0 82px; width:auto; min-height:44px; margin:-1px; border:1px solid var(--kd-accent); border-radius:7px; padding:0 12px; color:var(--kd-accent); background:#fff; font-weight:600; }
.kd-header-v2 .global_search button:hover { background:var(--kd-accent); color:#fff; }
.kd-header-v2 .search_res_block { top:100%; border-radius:0 0 7px 7px; box-shadow:0 10px 20px #123d5114; }
/* The existing search JS writes an inline 560px width. Keep its behavior,
   but bind the visible dropdown to the complete form, including Find. */
.kd-header-v2 .global_search .search_res_block,
.kd-header-v2 .global_search .kd-search-results {
  position:absolute; top:100%; left:0; right:auto;
  width:100%!important; min-width:0!important; max-width:100%!important;
  box-sizing:border-box; height:auto; max-height:min(65vh,520px);
  overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain;
  padding:14px; border:1px solid #d8dfe3; border-top:2px solid var(--kd-accent);
  border-radius:0 0 8px 8px; background:#fff; box-shadow:0 12px 24px #123d5124;
}
.kd-header-v2 .global_search .search_res_block.active { display:block!important; }
.kd-header-v2 .global_search .search_res_block[hidden],
.kd-header-v2 .global_search .kd-search-results[hidden] { display:none!important; }
.kd-header-v2 .global_search .search_res_cats,
.kd-header-v2 .global_search .search_res_prods { width:100%; min-width:0; }
.kd-header-v2 .global_search.kd-simple-open form,
.kd-header-v2 .global_search.kd-search-open form { border-radius:7px 7px 0 0; }
.kd-header-v2 .global_search.kd-simple-open .search-field,
.kd-header-v2 .global_search.kd-search-open .search-field { border-bottom-left-radius:0; }
.kd-header-v2 .global_search.kd-simple-open button[type="submit"],
.kd-header-v2 .global_search.kd-search-open button[type="submit"] { border-bottom-right-radius:0; }
.kd-header-v2 .header-menu-bar { margin-bottom:0; }
.kd-header-v2 .header-menu-nav.menu-style-2 { background:var(--kd-ink); }
.kd-header-v2 .header-menu-nav-inner { gap:20px; padding:6px 0; }
.kd-header-v2 #box-vertical-megamenus { width:150px; flex:0 0 150px; }
.kd-header-v2 #box-vertical-megamenus > .title { display:flex; justify-content:center; width:100%; min-height:44px; padding:10px 16px; border:0; border-radius:6px; background:var(--kd-accent); color:#fff; font-size:15px; font-weight:700; cursor:pointer; }
.kd-header-v2 #box-vertical-megamenus > .title:hover { background:#d96c2d; }
.kd-header-v2 .kd-category-icon { display:inline-block; width:25px; height:25px; flex:0 0 25px; vertical-align:middle; margin-right:8px; }
.kd-header-v2 .kd-flame { color:var(--kd-accent); }
.kd-header-v2 .kd-promo > a { display:flex; align-items:center; gap:0; }
.kd-header-v2 a:focus-visible,.kd-header-v2 button:focus-visible { outline:2px solid var(--kd-accent); outline-offset:3px; }
@media (min-width:992px) {
  .kd-header-v2 #main_menu { flex:1; min-width:0; width:auto; }
  .kd-header-v2 #main_menu > .header-nav { gap:12px; padding-left:0; }
  .kd-header-v2 #main_menu > .header-nav > p { display:flex; align-items:center; white-space:nowrap; }
  .kd-header-v2 #main_menu > .header-nav > p.hidden-md { display:none!important; }
  .kd-header-v2 #main_menu > .header-nav > p > a { color:#fff!important; font-size:13px; }
  .kd-header-v2 #main_menu > .header-nav > p > a:hover { color:#ffb388!important; }
  .kd-header-v2 .cat_menu_span { flex:0 0 24px; margin-right:8px; }
  .kd-header-v2 #main_menu > .header-nav > .cat_menu_item > .kd-category-icon { color:#fff; }
}
@media (min-width:992px) and (max-width:1199px) {
  .kd-header-v2 .new_menu { grid-template-columns:195px minmax(180px,1fr) 150px 218px; gap:16px; }
  .kd-header-v2 .site_top_menu,.kd-header-v2 .top_sub_menu { gap:20px; }
  .kd-header-v2 #box-vertical-megamenus { flex-basis:120px; width:120px; }
  .kd-header-v2 .header-menu-nav-inner { gap:12px; }
  .kd-header-v2 #main_menu > .header-nav { gap:8px; }
  .kd-header-v2 #main_menu > .header-nav > p > a { font-size:11px; }
  .kd-header-v2 .cat_menu_span { margin-right:5px; }
  .kd-header-v2 .kd-category-icon { margin-right:5px; width:24px; flex-basis:24px; }
}
@media (max-width:991px) {
  .kd-header-v2 .site_top_menu { justify-content:space-between; flex-direction:row-reverse; gap:8px; padding:8px 0; }
  .kd-header-v2 .site_top_menu .top_sub_menu { display:none; }
  .kd-header-v2 .site_top_menu a { font-size:12px; }
  .kd-header-v2 .new_menu { grid-template-columns:minmax(0,1fr) auto; gap:12px; height:64px; padding:8px 0; }
  .kd-header-v2 .new_menu .new_menu_logo { max-width:210px; }
  .kd-header-v2 .new_menu_icons { width:120px; }
  .kd-header-v2 .new_icons_items { gap:4px!important; }
  .kd-header-v2 .new_icons_items > .hidden-md { display:none; } /* phone is available in the top row */
  .kd-header-v2 .top_icons_desc { display:none; }
  .kd-header-v2 .new_icons_items > div:last-child { position:relative; }
  .kd-header-v2 .top_cart_count { display:block; position:absolute; right:0; bottom:-9px; min-width:100px; text-align:right; overflow:visible; font-size:9px; line-height:12px; }
  .kd-header-v2 .counter-wish { top:-4px; right:-2px; }
  .kd-header-v2 .header-menu-nav.menu-style-2 { background:#fff; padding-bottom:0; }
  .kd-header-v2 .header-menu-nav-inner { display:grid; grid-template-columns:minmax(0,1fr) 42px; gap:10px; padding:8px 0 10px; }
  .kd-header-v2 .new_mobile_search { grid-column:1; grid-row:1; width:100%; min-width:0; }
  .kd-header-v2 .global_search .search-field { font-size:16px; }
  .kd-header-v2 .global_search button { flex-basis:65px; padding:0 8px; font-size:12px; }
  .kd-header-v2 .menu-on-mobile { grid-column:2; grid-row:1; height:44px; width:42px; padding:0; border:1px solid #d8dfe3; border-radius:7px; background:#fff; text-align:center; font-size:20px; color:var(--kd-ink); }
  .kd-header-v2 #box-vertical-megamenus { grid-column:1 / 3; grid-row:2; width:calc(100% - 160px); min-width:0; }
  .kd-header-v2 #box-vertical-megamenus > .title { min-height:48px; padding:10px 8px; font-size:14px; }
  .kd-header-v2 .kd-mobile-rating { grid-column:1 / 3; grid-row:2; justify-self:end; }
  .kd-header-v2 .kd-mobile-rating iframe { display:block; width:150px; height:50px; border:0; }
  .kd-header-v2 #main_menu { position:absolute; width:0; height:0; } /* the existing fixed drawer remains untouched */
  .kd-header-v2 .kd-mobile-shortcuts { border-top:1px solid #edf0f2; border-bottom:1px solid #edf0f2; }
  .kd-header-v2 .kd-mobile-shortcuts nav { display:flex; align-items:center; gap:20px; overflow-x:auto; padding:12px 0; scrollbar-width:none; }
  .kd-header-v2 .kd-mobile-shortcuts nav::-webkit-scrollbar { display:none; }
  .kd-header-v2 .kd-shortcut { display:flex; align-items:center; flex:0 0 auto; white-space:nowrap; }
  .kd-header-v2 .kd-shortcut a { display:flex; align-items:center; color:var(--kd-ink); font-size:12px; font-weight:600; min-height:28px; }
  .kd-header-v2 .kd-shortcut .cat_menu_span { display:block; flex:0 0 24px; width:24px; height:24px; margin-right:8px; background-image:url('../images/cats_menu.png'); background-repeat:no-repeat; background-size:24px; }
  .kd-header-v2 .kd-shortcut .cat_menu_1 { background-position:0 0; }
  .kd-header-v2 .kd-shortcut .cat_menu_2 { background-position:0 -24px; }
  .kd-header-v2 .kd-shortcut .cat_menu_4 { background-position:0 -73px; }
  .kd-header-v2 .kd-shortcut .cat_menu_5 { background-position:0 -97px; }
  .kd-header-v2 .kd-shortcut .cat_menu_7 { background-position:0 -144px; }
  /* Reuse the original sprite shapes; tint them for the light mobile surface. */
  .kd-header-v2 .kd-shortcut .cat_menu_span { filter:brightness(0); opacity:.75; }
  .kd-header-v2 .kd-shortcut a { color:var(--kd-ink)!important; }
  .kd-header-v2 #main_menu .kd-category-icon { color:var(--kd-ink); }
  .kd-header-v2 #main_menu .kd-flame { color:var(--kd-accent); }
}
@media (max-width:360px) {
  .kd-header-v2 .new_menu { gap:6px; }
  .kd-header-v2 .new_menu_icons { width:106px; }
  .kd-header-v2 .header-menu-nav-inner { gap:8px; }
  .kd-header-v2 #box-vertical-megamenus > .title { font-size:13px; padding:10px 5px; }
}

/* Keep the expanded mobile grid spacer (46 + 10 + 50 + 18px).
   jquery.sticky recalculates its inline height on scroll; a stable minimum
   prevents the document from jumping when the fixed second row collapses. */
@media (max-width:991px) {
  .kd-header-v2 #header_menu_sticky-sticky-wrapper { min-height:124px; }
  .kd-header-v2 #header_menu_sticky-sticky-wrapper.is-sticky > #header_menu_sticky #box-vertical-megamenus,
  .kd-header-v2 #header_menu_sticky-sticky-wrapper.is-sticky > #header_menu_sticky .kd-mobile-rating { display:none; }
}
