/* ============================================================
   Hydropath Style Header — front-end stylesheet
   All colour, font and breakpoint values are driven by CSS
   variables emitted inline by the renderer.
   ============================================================ */

.hph-wrap, .hph-wrap *, .hph-wrap *::before, .hph-wrap *::after {
    box-sizing: border-box;
}

.hph-wrap {
    font-family: var(--hph-font, "Montserrat", "Helvetica Neue", Arial, sans-serif);
    color: var(--hph-text, #384a9c);
    position: relative;
    z-index: 9990;
}

/* Full-width breakout: when the shortcode is placed inside a constrained
   parent (e.g. a Divi row, max-width 1080px), this stretches the header
   to fill the actual viewport width so the menu has room to breathe. */
.hph-wrap.hph-fullwidth {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
}

/* ---------- Defensive resets (defeat host theme/editor styles) ----------
   Divi, the WordPress visual editor (TinyMCE) and many themes inject
   ul { list-style: disc; padding-left: 18px } which leaks into our menu.
   We isolate every list inside .hph-wrap. */
.hph-wrap ul,
.hph-wrap ol,
.hph-wrap li {
    list-style: none !important;
    list-style-image: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
}
.hph-wrap ul::before,
.hph-wrap ol::before,
.hph-wrap li::before,
.hph-wrap ul::marker,
.hph-wrap ol::marker,
.hph-wrap li::marker {
    content: none !important;
    display: none !important;
}
.hph-wrap li {
    display: block !important;
    text-indent: 0 !important;
}
.hph-wrap .hph-menu,
.hph-wrap .hph-mobile-menu,
.hph-wrap .hph-sub,
.hph-wrap .hph-mega-list,
.hph-wrap .hph-mobile-sub {
    display: flex;
}
.hph-wrap .hph-mobile-menu,
.hph-wrap .hph-sub,
.hph-wrap .hph-mobile-sub {
    display: block;
}
.hph-wrap .hph-menu { display: flex; }
.hph-wrap a { text-decoration: none; box-shadow: none; }
.hph-wrap a:focus { outline: 2px solid var(--hph-accent, #1eaedb); outline-offset: 2px; }
.hph-wrap button { font-family: inherit; }

/* Spacer is created by JS when sticky is on so content doesn't jump */
.hph-spacer { display: none; }

/* ---------- Container ---------- */
.hph-container {
    max-width: var(--hph-container, 1280px);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ---------- Top bar ---------- */
.hph-topbar {
    background: var(--hph-topbar-bg, #384a9c);
    color: var(--hph-topbar-text, #fff);
    font-size: 13px;
    line-height: 1.4;
}
.hph-topbar .hph-container {
    min-height: 36px;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.hph-topbar-left, .hph-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.hph-topbar-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.95;
}
.hph-topbar-link:hover { opacity: 1; }
.hph-topbar-socials { display: inline-flex; gap: 12px; }
.hph-social { color: inherit; display: inline-flex; }
.hph-social:hover { opacity: 0.8; }

/* ---------- Main header ---------- */
.hph-header {
    background: var(--hph-bg, #fff);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: padding 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.hph-header > .hph-container {
    min-height: 90px;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Sticky behaviour */
.hph-header.hph-sticky {
    position: sticky;
    top: 0;
    z-index: 9990;
}
.hph-header.hph-sticky.is-scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.hph-header.hph-shrink.is-scrolled > .hph-container { min-height: 64px; }
.hph-header.hph-shrink.is-scrolled .hph-logo-img { max-height: calc(var(--hph-logo-h, 40px) * 0.78); }

/* ---------- Logo ---------- */
.hph-logo { flex: 0 0 auto; }
.hph-logo-link { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.hph-logo-img { display: block; max-height: var(--hph-logo-h, 40px); width: auto; transition: max-height 0.25s ease; }
.hph-logo-text { font-weight: 800; font-size: 22px; color: var(--hph-primary, #384a9c); letter-spacing: -0.01em; }

/* ---------- Layout variants ---------- */
.hph-layout-logo-left   .hph-container { justify-content: flex-start; }
.hph-layout-logo-left   .hph-nav       { margin-left: auto; }
.hph-layout-logo-center .hph-container { justify-content: center; }
.hph-layout-logo-center .hph-logo      { order: 2; margin: 0 24px; }
.hph-layout-logo-center .hph-nav       { order: 1; margin-left: auto; }
.hph-layout-logo-center .hph-actions   { order: 3; margin-left: auto; }
.hph-layout-logo-right  .hph-logo      { order: 3; margin-left: auto; }
.hph-layout-logo-right  .hph-nav       { order: 1; }
.hph-layout-logo-right  .hph-actions   { order: 2; }

/* ---------- Desktop nav ---------- */
.hph-nav { display: flex; align-items: center; }
.hph-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}
.hph-item { position: relative; }
.hph-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 14px;
    color: var(--hph-text, #384a9c);
    font-size: var(--hph-menu-size, 16px);
    font-weight: var(--hph-menu-weight, 700);
    line-height: 1;
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}
.hph-uppercase .hph-link { text-transform: uppercase; letter-spacing: 0.02em; }
.hph-link:hover, .hph-item.is-open > .hph-link { color: var(--hph-accent, #1eaedb); }
.hph-link-badge {
    background: var(--hph-accent, #1eaedb);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 4px;
    font-weight: 700;
    text-transform: uppercase;
}
.hph-caret {
    width: 0; height: 0; margin-left: 4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    display: inline-block;
    transition: transform 0.15s ease;
}
.hph-item.is-open > .hph-link .hph-caret { transform: rotate(180deg); }

/* ---------- Standard dropdowns ---------- */
.hph-wrap .hph-sub {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 8px 28px rgba(0,0,0,0.10);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s 0.18s;
    z-index: 9991;
}
.hph-wrap .hph-item.has-children:hover > .hph-sub,
.hph-wrap .hph-item.has-children:focus-within > .hph-sub,
.hph-wrap .hph-item.is-open > .hph-sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}
.hph-wrap .hph-sub .hph-link {
    display: flex;
    padding: 10px 18px;
    font-weight: 600;
    width: 100%;
    text-transform: none;
    font-size: 14px;
    letter-spacing: 0;
    line-height: 1.3;
}
.hph-wrap .hph-sub .hph-link:hover { background: rgba(56, 74, 156, 0.06); color: var(--hph-accent, #1eaedb); }

/* Nested sub */
.hph-wrap .hph-sub .hph-item.has-children > .hph-sub { top: 0; left: 100%; transform: translateX(6px); }
.hph-wrap .hph-sub .hph-item.has-children:hover > .hph-sub { transform: translateX(0); }

/* ---------- Mega menu ---------- */
.hph-wrap .hph-mega {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 6px);
    background: #fff;
    border-top: 3px solid var(--hph-primary, #384a9c);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    width: max-content;
    min-width: 720px;
    max-width: 92vw;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
    z-index: 9991;
}
.hph-wrap .hph-item.is-mega:hover > .hph-mega,
.hph-wrap .hph-item.is-mega:focus-within > .hph-mega,
.hph-wrap .hph-item.is-mega.is-open > .hph-mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}
.hph-mega-inner { padding: 24px 28px; }
.hph-mega-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px 24px;
}
.hph-mega-col { min-width: 0; }
.hph-mega-heading {
    display: block;
    color: var(--hph-primary, #384a9c);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--hph-primary, #384a9c);
    text-decoration: none;
}
.hph-mega-heading:hover { color: var(--hph-accent, #1eaedb); }
.hph-mega-list { list-style: none !important; padding: 0; margin: 0; display: block; }
.hph-mega-list .hph-mega-item { display: block; }
.hph-mega-link {
    display: block;
    color: var(--hph-text, #384a9c);
    padding: 6px 0;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.35;
}
.hph-mega-link:hover { color: var(--hph-accent, #1eaedb); }

/* ---------- Actions area ---------- */
.hph-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hph-action {
    background: transparent;
    border: 0;
    padding: 10px;
    color: var(--hph-text, #384a9c);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    text-decoration: none;
    position: relative;
}
.hph-action:hover { color: var(--hph-accent, #1eaedb); }

/* Shopping cart */
.hph-action-cart {
    position: relative;
    padding-right: 14px;
}
.hph-action-cart .hph-cart-icon { display: inline-flex; }
.hph-action-cart .hph-cart-count {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--hph-accent, #1eaedb);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--hph-bg, #fff);
}
.hph-action-cart .hph-cart-count.is-empty { display: none; }

.hph-cta {
    display: inline-flex;
    align-items: center;
    padding: 12px 22px;
    background: var(--hph-cta-bg, #384a9c);
    color: var(--hph-cta-text, #fff);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}
.hph-cta:hover {
    background: var(--hph-cta-hover-bg, #1eaedb);
    color: var(--hph-cta-hover-text, #fff);
    transform: translateY(-1px);
}

/* ---------- Hamburger button ---------- */
.hph-action-toggle { display: none; }
.hph-burger { display: inline-flex; flex-direction: column; gap: 4px; width: 22px; }
.hph-burger span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.is-menu-open .hph-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.is-menu-open .hph-burger span:nth-child(2) { opacity: 0; }
.is-menu-open .hph-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Mobile slide-in panel ----------
   Force-hidden by default. Many themes (incl. Divi) override `transform`
   on positioned elements, which would otherwise leave the panel visible.
   We use !important on transform + visibility + pointer-events so the
   panel is truly off-screen until JS adds .is-menu-open. */
.hph-wrap .hph-mobile-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    width: min(360px, 90vw);
    background: #fff;
    z-index: 99999;
    overflow-y: auto;
    transform: translateX(110%) !important;
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
    visibility: hidden !important;
    pointer-events: none !important;
    box-shadow: -8px 0 24px rgba(0,0,0,0.10);
}
.hph-wrap.hph-panel-right .hph-mobile-panel { right: 0 !important; left: auto !important; }
.hph-wrap.hph-panel-left  .hph-mobile-panel { left: 0 !important; right: auto !important; transform: translateX(-110%) !important; box-shadow: 8px 0 24px rgba(0,0,0,0.10); }
.hph-wrap.is-menu-open .hph-mobile-panel {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: transform 0.28s ease, visibility 0s;
}

.hph-mobile-inner { padding: 24px 20px 32px; }
.hph-mobile-close {
    background: transparent;
    border: 0;
    font-size: 32px;
    line-height: 1;
    color: var(--hph-primary, #384a9c);
    cursor: pointer;
    margin-left: auto;
    display: block;
}
.hph-mobile-menu { list-style: none; padding: 0; margin: 16px 0 24px; }
.hph-mobile-item { border-bottom: 1px solid rgba(0,0,0,0.06); }
.hph-mobile-row { display: flex; align-items: center; }
.hph-mobile-link {
    flex: 1;
    padding: 14px 0;
    text-decoration: none;
    color: var(--hph-text, #384a9c);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.hph-mobile-toggle {
    background: transparent;
    border: 0;
    padding: 10px 12px;
    color: var(--hph-text, #384a9c);
    cursor: pointer;
}
.hph-mobile-toggle .hph-caret { transition: transform 0.2s ease; }
.hph-mobile-item.is-open > .hph-mobile-row .hph-mobile-toggle .hph-caret { transform: rotate(180deg); }
.hph-mobile-sub {
    list-style: none;
    padding: 0 0 8px 12px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.hph-mobile-item.is-open > .hph-mobile-sub { max-height: 2000px; }
.hph-mobile-sub .hph-mobile-link { font-size: 14px; text-transform: none; padding: 10px 0; font-weight: 600; }
.hph-mobile-cta { display: inline-flex; width: 100%; justify-content: center; }

.hph-wrap .hph-mobile-backdrop {
    position: fixed !important;
    inset: 0;
    background: rgba(20, 24, 50, 0.5);
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease;
    z-index: 99990;
    visibility: hidden !important;
}
.hph-wrap.is-menu-open .hph-mobile-backdrop {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* ---------- Search overlay ---------- */
.hph-wrap .hph-search-overlay {
    position: fixed !important;
    inset: 0;
    background: rgba(20, 24, 50, 0.96);
    z-index: 100000;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.hph-wrap .hph-search-overlay.is-open {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}
.hph-search-inner { width: 100%; max-width: 720px; padding: 120px 20px 40px; position: relative; }
.hph-search-close {
    position: absolute;
    top: 32px;
    right: 32px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
}
.hph-search-form { display: flex; gap: 8px; border-bottom: 2px solid rgba(255,255,255,0.4); padding-bottom: 8px; }
.hph-search-form input[type="search"] {
    flex: 1;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    padding: 8px 0;
    outline: none;
}
.hph-search-form input[type="search"]::placeholder { color: rgba(255,255,255,0.55); }
.hph-search-submit {
    background: var(--hph-cta-bg, #384a9c);
    color: #fff;
    border: 0;
    padding: 0 22px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.hph-search-submit:hover { background: var(--hph-cta-hover-bg, #1eaedb); }

/* ---------- Body lock when menu/search open ---------- */
body.hph-lock { overflow: hidden; }

/* ---------- Responsive ---------- */
/* Desktop: tighten spacing once container gets crowded */
@media (max-width: 1380px) {
    .hph-link { padding: 14px 9px; font-size: 14px; letter-spacing: 0; }
    .hph-container { gap: 12px; padding: 0 16px; }
    .hph-cta { padding: 10px 16px; font-size: 13px; letter-spacing: 0.02em; }
}
@media (max-width: 1240px) {
    .hph-link { padding: 14px 7px; font-size: 13px; }
    .hph-cta { padding: 9px 14px; }
}

/* Mobile/tablet: switch to hamburger when below mobile breakpoint */
@media (max-width: 1200px) {
    .hph-nav { display: none; }
    .hph-action-toggle { display: inline-flex; }
    .hph-cta { display: none; }
    .hph-header > .hph-container { min-height: 70px; }
}

@media (max-width: 640px) {
    .hph-topbar .hph-container { font-size: 12px; }
    .hph-topbar-link span { display: none; }
    .hph-search-form input[type="search"] { font-size: 22px; }
    .hph-search-inner { padding-top: 80px; }
}

/* Screen-reader only utility */
.hph-wrap .screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden;
    padding: 0; position: absolute; width: 1px;
    word-wrap: normal !important;
}

/* Print: hide header */
@media print { .hph-wrap { display: none; } }
