/* HTNAV modern mobile header - integrated v1.0.20 */
.htmh-root { display: none; }
@media (max-width: 1399px) {
  .htmh-root, .htmh-root * { box-sizing: border-box; }
  .htmh-root { display: block; font-family: inherit; color: #17392f; }
  /* The Elementor shortcode already sits in its header template.
     Do not add a second 64px blank space below the visible bar.
     An embedded HTNAV menu (or reserve_space=yes) reserves its own space. */
  .htmh-spacer { height: 0; }
  .htmh-root.htmh-reserve-space .htmh-spacer { height: 64px; }
  .htmh-fixed {
    position: fixed; inset: 0 0 auto; z-index: 2147482900;
    width: 100%; background: #fff; box-shadow: 0 1px 0 rgba(13,35,26,.085);
    transform: translateY(0); transition: transform .24s ease;
  }
  body.admin-bar .htmh-fixed { top: 46px; }
  .htmh-root.htmh-hidden .htmh-fixed { transform: translateY(calc(-100% - 4px)); }
  .htmh-bar {
    height: 64px; max-width: 100%; padding: 7px 11px;
    display: grid; grid-template-columns: minmax(0,1fr) auto;
    gap: 5px; align-items: center;
  }
  .htmh-icon {
    border: 0; background: transparent; color: #17392f;
    width: 42px; height: 42px; min-width: 42px;
    border-radius: 12px; padding: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    position: relative; cursor: pointer; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .htmh-icon:hover, .htmh-icon:focus-visible { color: #17392f; background: #f0f5f2; }
  .htmh-icon svg { width: 26px; height: 26px; display: block; flex: none; }
  .htmh-logo { display: flex; align-items: center; justify-content: flex-start; min-width: 0; max-width: 100%; margin-right: auto; }
  .htmh-logo img { width: auto; height: auto; max-width: 100%; max-height: 43px; object-fit: contain; }
  .htmh-text-logo { color: #121a16; font-size: clamp(12px, 3.3vw, 18px); font-weight: 700; white-space: nowrap; letter-spacing: -.5px; }
  .htmh-text-logo i { color: #ed0c2c; margin-right: 4px; font-style: normal; font-size: 21px; }
  .htmh-actions { display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; gap: 2px; }
  .htmh-actions .htmh-menu-button { margin-left: 0; }
  .htmh-search-button .htmh-close-symbol { display: none; }
  .htmh-root.htmh-search-open .htmh-search-button .htmh-search-symbol { display: none; }
  .htmh-root.htmh-search-open .htmh-search-button .htmh-close-symbol { display: block; }
  .htmh-count {
    position: absolute; top: -1px; right: -1px;
    min-width: 19px; height: 19px; padding: 0 3px;
    border-radius: 99px; border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    color: #fff; background: #e90022; font: 700 10px/1 Arial, sans-serif;
  }
  .htmh-count[hidden] { display: none; }
  .htmh-search-row {
    overflow: hidden; max-height: 0; opacity: 0; visibility: hidden;
    transition: max-height .22s ease, opacity .2s ease, visibility .2s;
    padding: 0 12px;
  }
  .htmh-search-open .htmh-search-row { max-height: 72px; opacity: 1; visibility: visible; }
  .htmh-search-row form {
    display: flex; align-items: center; height: 47px; margin: 0 0 12px;
    border: 1px solid #dae5dd; background: #f7f9f7; border-radius: 12px; overflow: hidden;
  }
  .htmh-search-row form:focus-within { border-color: #6b9d85; box-shadow: 0 0 0 2px rgba(55,135,92,.12); }
  .htmh-search-deco { display: flex; margin: 0 12px; }
  .htmh-search-deco svg { width: 19px; height: 19px; }
  .htmh-search-row input[type="search"] {
    border: 0 !important; box-shadow: none !important;
    padding: 0 !important; margin: 0 !important; min-width: 0; flex: 1;
    outline: 0 !important; background: transparent !important;
    color: #18392f; font-size: 15px; height: 43px;
    -webkit-appearance: none; appearance: none;
  }
  .htmh-search-row input::placeholder { color: #7c8f85; }
  .htmh-search-row form button {
    border: 0; width: 38px; height: 37px; padding: 8px;
    margin: 0 4px 0 5px; flex-shrink: 0;
    background: #204b3b; color: #fff; border-radius: 9px; cursor: pointer;
  }
  .htmh-search-row button svg { width: 21px; height: 21px; }
  .htmh-overlay {
    position: fixed; inset: 0; z-index: 2147482990;
    display: flex; pointer-events: none;
  }
  .htmh-overlay[hidden] { display: none; }
  .htmh-overlay.htmh-open { pointer-events: auto; }
  .htmh-backdrop { position: absolute; inset: 0; padding: 0; border: 0; background: rgba(8,22,16,.52); cursor: pointer; }
  .htmh-panel {
    position: absolute; top: 0; bottom: 0; width: min(90vw, 390px);
    display: flex; flex-direction: column; background: #fff;
    box-shadow: 0 0 50px rgba(0,0,0,.18); overflow: hidden;
  }
  .htmh-panel[hidden] { display: none; }
  .htmh-menu-panel { left: 0; }
  .htmh-cart-panel { right: 0; }
  .htmh-panel-heading {
    min-height: 78px; padding: 20px 17px; border-bottom: 1px solid #e9eee9;
    display: flex; justify-content: space-between; align-items: center;
  }
  .htmh-panel-heading h2 { color: #193a2d; font-size: 23px; margin: 0; font-weight: 700; line-height: 1.3; }
  .htmh-panel-heading small { display: block; color: #729184; font-size: 10px; font-weight: 700; letter-spacing: .1em; margin-bottom: 4px; }
  .htmh-cart-heading-count { color: #83978b; font-weight: 500; }
  .htmh-panel-close { background: #f4f7f5; }
  .htmh-navigation { padding: 12px 18px 30px; overflow: auto; flex: 1; }
  .htmh-navigation ul { list-style: none; margin: 0; padding: 0; }
  .htmh-navigation li { margin: 0; padding: 0; border-bottom: 1px solid #eaf0ec; }
  .htmh-navigation a { display: block; padding: 14px 2px; color: #19382e; text-decoration: none; font-size: 15px; font-weight: 650; }
  .htmh-navigation .sub-menu { padding-left: 14px; border-left: 2px solid #e3eae5; }
  .htmh-navigation .sub-menu a { font-size: 13px; padding: 10px 0; font-weight: 450; }
  /* Defensive reset: the site theme or mega-menu plugin must not hide navigation. */
  .htmh-root .htmh-navigation .htmh-menu-list,
  .htmh-root .htmh-navigation .htmh-submenu {
    display: block !important; list-style: none !important;
    position: static !important; float: none !important;
    width: 100% !important; min-width: 0 !important;
    max-height: none !important; height: auto !important;
    opacity: 1 !important; visibility: visible !important;
    transform: none !important; box-shadow: none !important;
    background: transparent !important; margin: 0 !important;
  }
  .htmh-root .htmh-navigation .htmh-submenu[hidden] { display: none !important; }
  .htmh-root .htmh-navigation .htmh-menu-list { padding: 0 !important; }
  .htmh-root .htmh-navigation .htmh-submenu { padding: 0 0 0 14px !important; border-left: 2px solid #e3eae5 !important; }
  .htmh-root .htmh-navigation .htmh-menu-item {
    display: block !important; width: 100% !important;
    position: relative !important; float: none !important;
    margin: 0 !important; padding: 0 !important;
    border-bottom: 1px solid #eaf0ec !important;
    visibility: visible !important; opacity: 1 !important;
  }
  .htmh-root .htmh-navigation .htmh-item-row { display: flex !important; align-items: center; width: 100%; min-height: 52px; }
  .htmh-root .htmh-navigation .htmh-item-row > a {
    display: flex !important; flex: 1 1 auto; min-width: 0;
    align-items: center; padding: 14px 5px !important;
    color: #19382e !important; background: transparent !important;
    font-size: 15px !important; font-weight: 650 !important;
    line-height: 1.4; text-decoration: none !important;
    opacity: 1 !important; visibility: visible !important;
  }
  .htmh-root .htmh-navigation .htmh-submenu .htmh-item-row > a { font-size: 13px !important; font-weight: 500 !important; }
  .htmh-root .htmh-navigation .htmh-subtoggle {
    display: flex !important; align-items: center; justify-content: center;
    flex: 0 0 42px; width: 42px; min-width: 42px; height: 42px;
    border-radius: 9px; border: 0; background: #f0f5f2;
    padding: 11px; color: #19382e; cursor: pointer;
    box-shadow: none; text-decoration: none;
  }
  .htmh-root .htmh-navigation .htmh-subtoggle svg { width: 19px; height: 19px; transition: transform .18s ease; }
  .htmh-root .htmh-navigation .htmh-subtoggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .htmh-root .htmh-navigation .htmh-subtoggle:focus-visible { outline: 2px solid #427e62; outline-offset: 2px; }
  .htmh-cart-content { flex: 1; overflow-y: auto; padding: 18px; }
  .htmh-cart-content .woocommerce-mini-cart { padding: 0; margin: 0; list-style: none; }
  .htmh-cart-content .woocommerce-mini-cart-item {
    position: relative; display: flex; align-items: center; gap: 11px;
    padding: 12px 25px 12px 0; border-bottom: 1px solid #edf0ed;
    min-height: 85px; flex-wrap: wrap;
  }
  .htmh-cart-content .woocommerce-mini-cart-item a:not(.remove) { color: #1d3d31; font-size: 13px; line-height: 1.4; font-weight: 600; }
  .htmh-cart-content .woocommerce-mini-cart-item a:not(.remove) img {
    width: 70px !important; height: 76px !important; object-fit: contain;
    float: left !important; margin: 0 10px 0 0 !important;
    background: #f5f6f4; border-radius: 8px;
  }
  .htmh-cart-content .woocommerce-mini-cart-item .quantity { display: block; font-size: 13px; color: #61796b; }
  .htmh-cart-content .woocommerce-mini-cart-item a.remove {
    position: absolute; top: 12px; right: 0; font-size: 20px !important;
    width: 24px; height: 24px; line-height: 24px; text-align: center;
    border-radius: 7px; background: #f6f7f5; color: #657e70 !important;
  }
  .htmh-cart-content .woocommerce-mini-cart__total { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid #ebefec; padding-top: 15px; font-size: 14px; }
  .htmh-cart-content .woocommerce-mini-cart__buttons { display: none !important; }
  .htmh-cart-content .woocommerce-mini-cart__empty-message,
  .htmh-cart-content .htmh-empty { text-align: center; padding: 65px 12px; color: #647e70; font-size: 15px; }
  .htmh-cart-footer { padding: 17px 18px 25px; border-top: 1px solid #ecf0ed; display: grid; gap: 10px; }
  .htmh-cart-footer a { text-decoration: none; text-align: center; display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 46px; border-radius: 11px; font-weight: 700; font-size: 14px; }
  .htmh-view-cart { border: 1px solid #c9d6cd; color: #1c4a37; background: #fff; }
  .htmh-checkout { color: #fff; background: #184a38; }
  .htmh-checkout svg { width: 19px; height: 19px; }
  body.htmh-lock { overflow: hidden !important; }
  /* Elementor responsive preview needs the same floating behavior as live pages.
     Fixed positioning becomes unreliable inside transformed Elementor wrappers;
     JavaScript portals the active header directly into document.body. */
}
@media (max-width: 370px) {
  .htmh-bar { grid-template-columns: minmax(0,1fr) auto; gap: 2px; padding-left: 7px; padding-right: 7px; }
  .htmh-actions { gap: 0; }
  .htmh-icon { width: 41px; min-width: 41px; }
}
@media (prefers-reduced-motion: reduce) {
  .htmh-fixed, .htmh-search-row { transition: none !important; }
}

/* Hide old HTNAV bar only while the modern header is actually active. */
@media (max-width:1399px) {
  body.htnav-modern-is-active .htnav-shell { display: none !important; }
  .htmh-root.htmh-embedded { width: 100%; }
  .htmh-root[hidden] { display: none !important; }
}

@media (max-width:1399px) {
  .htmh-menu-account {padding:15px 20px 28px; border-top:1px solid #e9e9e9;}
  .htmh-menu-account a {color:#17392f; font-weight:600; text-decoration:none;}
}

/* The older [htnav_navigation] shortcode can coexist on desktop with the new
   Elementor mobile header. Suppress its mobile-only shell to avoid extra gap. */
@media (max-width: 1399px) {
  body.htnav-modern-is-active .htnav-shell.htnav-modern-superseded {
    display: none !important;
  }
}

/* v1.0.18: an auto mobile header is rendered directly before </body>, not
   inside a potentially hidden Elementor desktop-only header container. */
@media (max-width: 1399px) {
  .htmh-root.htmh-auto[hidden] { display: none !important; }
  /* No additional 64px placeholder near the footer. */
  .htmh-root.htmh-auto .htmh-spacer { display: none !important; }
}

/* v1.0.19 - unified fixed/portal layout, including Elementor mobile preview. */
@media (max-width: 1399px) {
  .htmh-root:not([hidden]) .htmh-fixed {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100% !important;
    z-index: 2147482900 !important;
    transform: translate3d(0,0,0);
  }
  body.admin-bar .htmh-root:not([hidden]) .htmh-fixed { top: 46px; }
  .htmh-root.htmh-hidden:not([hidden]) .htmh-fixed { transform: translate3d(0,calc(-100% - 4px),0); }
  .htmh-root .htmh-bar {
    grid-template-columns: minmax(0,1fr) auto !important;
    width: 100%;
    max-width: 100%;
    min-height: 64px;
    overflow: visible;
  }
  .htmh-root .htmh-logo {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 auto;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
  }
  .htmh-root .htmh-logo img {
    display: block !important;
    width: 100% !important;
    max-width: 245px !important;
    min-width: 0;
    height: 44px !important;
    min-height: 44px;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
    transform: none !important;
  }
  .htmh-root .htmh-actions { display: flex !important; flex: 0 0 auto !important; }
  .htmh-root .htmh-spacer { display: none !important; }
  .htmh-root[hidden] { display: none !important; }
}
@media (min-width: 783px) and (max-width: 1399px) {
  body.admin-bar .htmh-root:not([hidden]) .htmh-fixed { top: 32px; }
}
@media (max-width: 380px) {
  .htmh-root .htmh-icon { width: 39px; min-width: 39px; padding: 7px; }
  .htmh-root .htmh-actions { gap: 0; }
}

/* v1.0.20 - logo survives storefront-wide img rules and Elementor templates. */
@media (max-width: 1399px) {
  .htmh-root .htmh-bar > .htmh-logo {
    display: flex !important;
    flex: 1 1 0 !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  .htmh-root .htmh-bar > .htmh-logo > img {
    display: block !important;
    box-sizing: border-box !important;
    position: static !important;
    width: min(100%, 228px) !important;
    max-width: 228px !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 0 !important;
    max-height: 48px !important;
    flex: 0 1 228px !important;
    object-fit: contain !important;
    object-position: left center !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
}
@media (max-width: 370px) {
  .htmh-root .htmh-bar > .htmh-logo > img {
    height: 44px !important;
    max-height: 44px !important;
  }
}
