/* MTP header — scoped to .mtp-hdr. Colours come from Appearance → MTP Homepage → General. */
.mtp-hdr {
  --mtp-blue: #0247B6; --mtp-red: #97282D; --mtp-dark: #24282A;
  --mtp-line: #E2E5E8; --mtp-grey: #F1F2F2; --mtp-muted: #5f666c; --mtp-logo-h: 48px;
  font-size: 15px; line-height: 1.4; color: var(--mtp-dark); position: relative; z-index: 1000;
  font-family: Montserrat, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.mtp-hdr *, .mtp-hdr *::before, .mtp-hdr *::after { box-sizing: border-box; }
.mtp-hdr a { text-decoration: none; }
.mtp-hdr ul { list-style: none; margin: 0; padding: 0; }
.mtp-hdr button { font: inherit; }
.mtp-hdr svg { flex-shrink: 0; display: inline-block; }
.mtp-hdr .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.mtp-hdr.is-sticky { position: sticky; top: 0; }
body.admin-bar .mtp-hdr.is-sticky { top: 32px; }
@media (max-width: 782px) { body.admin-bar .mtp-hdr.is-sticky { top: 0; } }
.mtp-hdr-wrap { margin: 0 auto; padding: 0 40px; max-width: 1280px; } /* boxed: 1200px content, same as the YOOtheme container */
.mtp-skip { position: absolute; left: -9999px; top: 0; background: #fff; padding: 8px 12px; z-index: 2; }
.mtp-skip:focus { left: 8px; }

/* Top bar — light grey, red icons */
.mtp-hdr-top { background: #F3F4F5; color: var(--mtp-dark); font-size: 13.5px; font-weight: 500; }
.mtp-hdr-top .mtp-hdr-wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 34px; }
.mtp-hdr-top-item { display: inline-flex; align-items: center; gap: 9px; color: var(--mtp-dark) !important; white-space: nowrap; }
.mtp-hdr-top-item svg { width: 16px; height: 16px; color: var(--mtp-red); }
a.mtp-hdr-top-item:hover span { text-decoration: underline; }

/* Main row */
.mtp-hdr-main { background: #fff; border-bottom: 1px solid var(--mtp-line); }
.mtp-hdr-main .mtp-hdr-wrap { display: flex; align-items: center; gap: 30px; min-height: 94px; }
.mtp-hdr-logo { display: flex; align-items: center; flex-shrink: 0; }
.mtp-hdr-logo-img { height: var(--mtp-logo-h); width: auto; max-width: 300px; display: block; }
.mtp-hdr-logo-text { font-size: 22px; font-weight: 800; font-style: italic; color: var(--mtp-red); }
.mtp-hdr-burger { display: none; }

/* Search — grey box, red "Search" button set inside */
.mtp-hdr-search { flex: 1 1 auto; max-width: 820px; min-width: 0; display: flex; align-items: center; background: var(--mtp-grey); border: 1px solid #D3D7DB; border-radius: 2px; padding: 5px; margin: 0; height: 50px; }
.mtp-hdr-search input[type=search] { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; padding: 0 0 0 16px; height: 100%; font: inherit; font-size: 14.5px; color: var(--mtp-dark); outline: none; box-shadow: none !important; }
.mtp-hdr-search input[type=search]::placeholder { color: #5f666c; opacity: 1; }
.mtp-hdr-search button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 100%; background: var(--mtp-red); color: #fff; border: 0; border-radius: 2px; padding: 0 30px; font-weight: 700; font-size: 15px; cursor: pointer; }
.mtp-hdr-search button svg { display: none; }
.mtp-hdr-search button:hover { filter: brightness(1.1); }

/* Advanced Woo Search, styled to match */
.mtp-hdr-search-sc { display: block; padding: 0; border: 0; background: none; height: auto; }
.mtp-hdr-search-sc .aws-container .aws-search-form { height: 50px; background: var(--mtp-grey); border: 1px solid #D3D7DB; border-radius: 2px; padding: 5px; display: flex; align-items: stretch; }
.mtp-hdr-search-sc .aws-container .aws-search-form .aws-wrapper { background: transparent; }
.mtp-hdr-search-sc .aws-container .aws-search-field { border: 0 !important; background: transparent !important; height: 100% !important; padding: 0 30px 0 16px !important; font-size: 14.5px !important; color: var(--mtp-dark); box-shadow: none !important; }
.mtp-hdr-search-sc .aws-container .aws-search-field::placeholder { color: #5f666c; opacity: 1; }
.mtp-hdr-search-sc .aws-container .aws-search-form .aws-form-btn { background: var(--mtp-red) !important; border: 0 !important; border-radius: 2px; margin: 0 !important; padding: 0 30px; display: flex; align-items: center; cursor: pointer; }
.mtp-hdr-search-sc .aws-container .aws-search-form .aws-form-btn:hover { filter: brightness(1.1); }
.mtp-hdr-search-sc .aws-container .aws-search-form .aws-search-btn_icon { display: none !important; }
.mtp-hdr-search-sc .aws-container .aws-search-form .aws-form-btn::after { content: "Search"; color: #fff; font-weight: 700; font-size: 15px; font-family: inherit; }

/* Phone */
.mtp-hdr-right { display: flex; align-items: center; gap: 36px; flex-shrink: 0; margin-left: auto; }
.mtp-hdr-phone { display: flex; align-items: center; gap: 12px; color: var(--mtp-dark) !important; line-height: 1.15; }
.mtp-hdr-phone-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--mtp-grey); color: var(--mtp-red); display: flex; align-items: center; justify-content: center; }
.mtp-hdr-phone-ic svg { width: 20px; height: 20px; }
.mtp-hdr-phone-txt { display: flex; flex-direction: column; }
.mtp-hdr-phone small { font-size: 12.5px; font-weight: 500; color: var(--mtp-muted); }
.mtp-hdr-phone strong { font-size: 19.5px; font-weight: 800; letter-spacing: .2px; }

/* Home / Account / Cart */
.mtp-hdr-icons { display: flex; align-items: center; gap: 14px; }
.mtp-hdr-icon { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 62px; font-size: 12.5px; font-weight: 500; color: var(--mtp-dark) !important; position: relative; }
.mtp-hdr-icon svg { width: 24px; height: 24px; }
.mtp-hdr-icon:hover { color: var(--mtp-red) !important; }
.mtp-cart-count { position: absolute; top: -9px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--mtp-red); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }

/* Menu bar — white */
.mtp-hdr-nav { background: #fff; border-bottom: 1px solid var(--mtp-line); position: relative; }
.mtp-hdr-nav > .mtp-hdr-wrap { display: flex; align-items: center; justify-content: space-between; }
.mtp-hdr .mtp-nav { display: flex; align-items: center; gap: 42px; padding-left: 0; }
.mtp-nav-item { position: static; }
.mtp-hdr .mtp-nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 0; height: 51px; color: var(--mtp-dark) !important; font-size: 14.5px; font-weight: 600; letter-spacing: 0; text-transform: none; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.mtp-hdr .mtp-nav-link:hover, .mtp-has-mega.is-open > .mtp-nav-link, .mtp-hdr .mtp-nav-item.is-current > .mtp-nav-link { color: var(--mtp-red) !important; }
.mtp-caret { width: 14px; height: 14px; transition: transform .15s; }
.mtp-has-mega.is-open .mtp-caret { transform: rotate(180deg); }
.mtp-hdr .mtp-nav-hl { color: var(--mtp-red) !important; }
.mtp-hdr .mtp-nav-hl:hover { text-decoration: underline; }
/* v1.7 MTP Trade Portal: drop-down on the highlighted link for approved trade accounts. */
.mtp-nav-hl-wrap { position: relative; }
.mtp-nav-hl-wrap > .mtp-nav-hl:hover { text-decoration: none; }
.mtp-nav-hl-dd { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 220px; margin: 0; padding: 8px 0; list-style: none; background: #fff; border: 1px solid var(--mtp-line); border-radius: 0 0 10px 10px; box-shadow: 0 18px 40px rgba(0,0,0,.16); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; }
.mtp-nav-hl-wrap:hover .mtp-nav-hl-dd, .mtp-nav-hl-wrap:focus-within .mtp-nav-hl-dd { opacity: 1; visibility: visible; transform: none; }
.mtp-nav-hl-wrap:hover .mtp-caret, .mtp-nav-hl-wrap:focus-within .mtp-caret { transform: rotate(180deg); }
.mtp-nav-hl-dd a { display: block; padding: 9px 18px; font-size: 14px; font-weight: 600; color: var(--mtp-dark) !important; white-space: nowrap; }
.mtp-nav-hl-dd a:hover, .mtp-nav-hl-dd a:focus { background: var(--mtp-grey); color: var(--mtp-red) !important; }

/* Mega menu */
.mtp-mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-top: 1px solid var(--mtp-line); box-shadow: 0 18px 40px rgba(0,0,0,.16); padding: 24px 0 18px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; }

.mtp-has-mega.is-open .mtp-mega { opacity: 1; visibility: visible; transform: none; }
.mtp-mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 22px; }
.mtp-mega-make { display: flex; gap: 12px; align-items: flex-start; padding: 8px; border-radius: 10px; }
.mtp-mega-make:hover { background: var(--mtp-grey); }
.mtp-mega-img { width: 76px; height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg,#fff,#eef1f4); border-radius: 8px; overflow: hidden; color: #b9c0c6; }
.mtp-mega-img img { max-width: 100%; max-height: 60px; width: auto; height: auto; mix-blend-mode: multiply; }
.mtp-mega-img svg { width: 36px; height: 36px; }
.mtp-mega-name { display: block; font-weight: 800; font-size: 15px; color: var(--mtp-dark) !important; margin-bottom: 3px; }
.mtp-mega-make li a { font-size: 13px; color: var(--mtp-muted) !important; line-height: 1.7; }
.mtp-mega-make li a:hover, .mtp-mega-name:hover { color: var(--mtp-red) !important; }
.mtp-mega-all { display: inline-block; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--mtp-line); width: 100%; font-weight: 700; font-size: 13px; color: var(--mtp-red) !important; }

/* Drawer (mobile) */
.mtp-drawer { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .5); }
.mtp-drawer[hidden] { display: none; }
.mtp-drawer-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); background: #fff; display: flex; flex-direction: column; box-shadow: 10px 0 30px rgba(0,0,0,.2); animation: mtp-slide .2s ease-out; }
@keyframes mtp-slide { from { transform: translateX(-100%); } to { transform: none; } }
.mtp-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--mtp-line); }
.mtp-drawer-head .mtp-hdr-logo-img { height: 34px; }
.mtp-drawer-close { border: 0; background: var(--mtp-grey); width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer; color: var(--mtp-dark); }
.mtp-drawer-body { flex: 1; overflow-y: auto; padding: 6px 0; }
.mtp-drawer-group summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--mtp-grey); }
.mtp-drawer-group summary::-webkit-details-marker { display: none; }
.mtp-drawer-group summary::after { content: "+"; font-size: 18px; color: var(--mtp-muted); }
.mtp-drawer-group[open] summary { color: var(--mtp-red); }
.mtp-drawer-group[open] summary::after { content: "–"; }
.mtp-drawer-group ul { background: #fafbfb; padding: 4px 0; }
.mtp-drawer-group li a { display: block; padding: 10px 30px; color: var(--mtp-dark) !important; font-size: 14px; }
.mtp-drawer-group li a.mtp-drawer-all { color: var(--mtp-red) !important; font-weight: 700; }
.mtp-drawer-links li a { display: block; padding: 14px 18px; font-weight: 600; font-size: 15px; color: var(--mtp-dark) !important; border-bottom: 1px solid var(--mtp-grey); }
.mtp-drawer-links .mtp-drawer-hl { color: var(--mtp-red) !important; }
.mtp-drawer-links .mtp-drawer-sub a { padding: 10px 18px 10px 32px; font-weight: 500; font-size: 14px; background: #fafbfb; }
.mtp-drawer-foot { padding: 14px 16px; border-top: 1px solid var(--mtp-line); display: grid; gap: 10px; }
.mtp-drawer-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 6px; border: 2px solid var(--mtp-dark); font-weight: 700; color: var(--mtp-dark) !important; }
.mtp-drawer-btn svg { width: 18px; height: 18px; }
.mtp-drawer-call { background: var(--mtp-red); border-color: var(--mtp-red); color: #fff !important; }
body.mtp-drawer-open { overflow: hidden; }

/* Responsive */
@media (max-width: 1280px) {
  .mtp-hdr-main .mtp-hdr-wrap { gap: 24px; }
  .mtp-hdr-right { gap: 24px; }
  .mtp-hdr-icon { width: 62px; }
  .mtp-hdr-phone small { display: none; }
  .mtp-mega-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .mtp-hdr-wrap { padding: 0 24px; }
  .mtp-hdr-top .mtp-hdr-top-item:nth-child(n+3) { display: none; }
  .mtp-hdr-phone-txt { display: none; }
  .mtp-hdr-home { display: none; }
}
@media (max-width: 959px) {
  .mtp-hdr-wrap { padding: 0 16px; }
  .mtp-hdr-top .mtp-hdr-wrap { justify-content: center; }
  .mtp-hdr-top .mtp-hdr-top-item:nth-child(n+2) { display: none; }
  .mtp-hdr-main .mtp-hdr-wrap { flex-wrap: wrap; gap: 10px 14px; padding-top: 10px; padding-bottom: 12px; min-height: 0; }
  .mtp-hdr-burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 40px; padding: 0 9px; border: 0; background: var(--mtp-grey); border-radius: 8px; cursor: pointer; }
  .mtp-hdr-burger span { display: block; height: 2px; background: var(--mtp-dark); border-radius: 2px; }
  .mtp-hdr-logo { flex: 1; justify-content: center; }
  .mtp-hdr-logo-img { height: calc(var(--mtp-logo-h) * .75); }
  .mtp-hdr-search, .mtp-hdr-search-sc { order: 5; flex-basis: 100%; max-width: none; }
  .mtp-hdr-search { height: 46px; }
  .mtp-hdr-search button { padding: 0 18px; }
  .mtp-hdr-search-sc .aws-container .aws-search-form { height: 46px; }
  .mtp-hdr-phone, .mtp-hdr-account, .mtp-hdr-home { display: none; }
  .mtp-hdr-right { gap: 0; margin-left: 0; }
  .mtp-hdr-icon { width: 40px; }
  .mtp-hdr-icon span:not(.mtp-cart-count) { display: none; }
  .mtp-cart-count { left: auto; right: -2px; }
  .mtp-hdr-nav { display: none; }
}

/* v1.5.3 fixes ---------------------------------------------------------- */
/* Advanced Woo Search: keep the form inside its box (it was 700px wide and covered the phone/Home icon) */
.mtp-hdr .mtp-hdr-search-sc, .mtp-hdr .mtp-hdr-search-sc .aws-container, .mtp-hdr .mtp-hdr-search-sc .aws-container .aws-search-form { width: 100% !important; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
.mtp-hdr .mtp-hdr-search-sc .aws-container .aws-search-form .aws-wrapper { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; display: block; position: relative; }
.mtp-hdr .mtp-hdr-search-sc .aws-container .aws-search-form .aws-form-btn { flex: 0 0 auto !important; width: auto !important; padding: 0 24px !important; }
.mtp-hdr .mtp-hdr-search-sc .aws-container .aws-search-form .aws-search-clear { right: 6px; }
@media (max-width: 959px) {
  .mtp-hdr .mtp-hdr-search-sc .aws-container .aws-search-form .aws-form-btn { padding: 0 16px !important; }
}

/* ---------- Shrink on scroll (v1.6) ----------
   The shell keeps the full header's space so the page never jumps; once you've
   scrolled past the header it comes back as a slim fixed bar. */
.mtp-hdr-shell { position: relative; }
.mtp-hdr.has-shrink.is-fixed { position: fixed; top: 0; left: 0; right: 0; animation: mtp-hdr-in .28s ease-out; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
body.admin-bar .mtp-hdr.has-shrink.is-fixed { top: 32px; }
@media (max-width: 782px) { body.admin-bar .mtp-hdr.has-shrink.is-fixed { top: 0; } }
@keyframes mtp-hdr-in { from { transform: translateY(-100%); } to { transform: none; } }
.mtp-hdr.is-compact .mtp-hdr-top { display: none; }
.mtp-hdr.is-compact .mtp-hdr-main .mtp-hdr-wrap { min-height: 64px; }
.mtp-hdr.is-compact .mtp-hdr-logo-img { height: calc(var(--mtp-logo-h) * .74); }
.mtp-hdr.is-compact .mtp-hdr-search, .mtp-hdr.is-compact .mtp-hdr-search-sc .aws-container .aws-search-form { height: 42px; }
.mtp-hdr.is-compact .mtp-hdr-search-sc .aws-container .aws-search-field { height: 100% !important; }
.mtp-hdr.is-compact .mtp-hdr-phone small { display: none; }
.mtp-hdr.is-compact .mtp-hdr-phone strong { font-size: 17px; }
.mtp-hdr.is-compact .mtp-hdr-phone-ic { width: 36px; height: 36px; }
.mtp-hdr.is-compact .mtp-hdr-icon > span:not(.mtp-cart-count) { display: none; }
.mtp-hdr.is-compact .mtp-hdr-icons { gap: 4px; }
.mtp-hdr.is-compact .mtp-hdr-icon { width: 46px; }
.mtp-hdr.is-compact .mtp-hdr .mtp-nav-link, .mtp-hdr.is-compact .mtp-nav-link { height: 42px; }
.mtp-hdr.is-compact .mtp-acc-dd { top: calc(100% + 10px); }
@media (max-width: 959px) {
  .mtp-hdr.is-compact .mtp-hdr-main .mtp-hdr-wrap { padding-top: 6px; padding-bottom: 8px; gap: 6px 14px; }
  .mtp-hdr.is-compact .mtp-hdr-burger { width: 36px; height: 36px; }
  .mtp-hdr.is-compact .mtp-hdr-search, .mtp-hdr.is-compact .mtp-hdr-search-sc .aws-container .aws-search-form { height: 40px; }
}
