/* Consolidated responsive header (inc/genesis-header.php).
   Button rules are prefixed with .gm-hdr because the theme's reset.css
   ([type="button"], button) loads later and ties bare-class specificity. */

/* Hide the old stacked Elementor header rows; the new bar replaces them.
   Rollback = remove the genesis-header include. */
[data-elementor-type="header"] { display: none !important; }

/* The old header overhung content; pages compensated with top margins.
   The new header sits in normal flow, so those compensations reset. */
.genesis-page-banner { margin-top: 0 !important; }

.gm-hdr {
    position: sticky;
    top: 0;
    z-index: 300;
    background: #fff;
    border-bottom: 1px solid #EEF2F7;
    box-shadow: 0 2px 14px rgba(15, 23, 42, .06);
    font-family: Roboto, Inter, -apple-system, sans-serif;
}
body.admin-bar .gm-hdr { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .gm-hdr { top: 46px; }
}
.gm-hdr__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 22px;
}
.gm-hdr__logo { flex: 0 0 auto; display: inline-flex; }
.gm-hdr__logo img { height: 56px; width: auto; display: block; }

/* ---------- desktop nav ---------- */
.gm-hdr__nav { flex: 1 1 auto; min-width: 0; }
.gm-hdr__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    /* Distribute the links across the space between logo and pill group;
       the gap is only the minimum spacing when the row gets tight. */
    justify-content: space-evenly;
    gap: 12px;
}
.gm-hdr__menu li { position: relative; }
.gm-hdr__menu a {
    color: #1f2937;
    font-weight: 600;
    font-size: 15.5px;
    text-decoration: none;
    padding: 10px 0;
    display: inline-block;
    white-space: nowrap;
}
.gm-hdr__menu > li.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    border: 4px solid transparent;
    border-top-color: #6b7280;
    transform: translateY(2px);
}
.gm-hdr__menu a:hover { color: #284D9A; }
.gm-hdr__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 8px;
    position: absolute;
    top: 100%;
    left: -10px;
    min-width: 230px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
    display: none;
    z-index: 320;
}
.gm-hdr__menu li:hover > .sub-menu,
.gm-hdr__menu li:focus-within > .sub-menu,
.gm-hdr__menu li.is-tapped > .sub-menu { display: block; } /* touch */
.gm-hdr__menu .sub-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14.5px;
    white-space: normal;
}
.gm-hdr__menu .sub-menu a:hover { background: #F0F6FF; }
/* third-level submenus fly out beside their parent item */
.gm-hdr__menu .sub-menu li.menu-item-has-children > a {
    position: relative;
    padding-right: 28px;
}
.gm-hdr__menu .sub-menu li.menu-item-has-children > a::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-left-color: #6b7280;
}
.gm-hdr__menu .sub-menu .sub-menu {
    top: -9px; /* aligns with the parent dropdown's padding */
    left: 100%;
}

/* ---------- actions: search circle + segmented pill group ---------- */
.gm-hdr__actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.gm-hdr__group {
    display: inline-flex;
    align-items: stretch;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
}
.gm-hdr__seg {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    font-weight: 600;
    font-size: 13.5px;
    color: #18469B;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease;
}
.gm-hdr__seg + .gm-hdr__seg { border-left: 1px solid #E2E8F0; }
.gm-hdr__seg:hover { background: #F0F6FF; }
.gm-hdr__seg i { font-size: 12px; }
.gm-hdr__seg--tel { color: #C8262D; }
.gm-hdr__seg--red { background: #C8262D; color: #fff !important; }
.gm-hdr__seg--red:hover { background: #a01e23; }
/* Search: the group's leading segment, styled like the other segments.
   Fully self-contained rule: it is a button, and the theme reset ties
   the bare segment class. */
.gm-hdr .gm-hdr__seg--search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #18469B;
    border: 0;
    /* square corners: the group container clips the left cap round, and a
       pill end must sit flat against the next segment (no right curve) */
    border-radius: 0;
    margin: 0;
    padding: 0 16px;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .15s ease;
}
/* color repeated on hover: a theme button:hover rule forces white */
.gm-hdr .gm-hdr__seg--search:hover { background: #F0F6FF; color: #18469B; }
/* icon-only segment, so the glyph runs larger than the labeled ones */
.gm-hdr .gm-hdr__seg--search svg { width: 21px; height: 21px; }

/* ---------- hamburger + panel ---------- */
/* always blue with white lines; only the glyph changes (lines <-> X) */
.gm-hdr .gm-hdr__burger {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 50%; /* matches the pill group's curvature */
    border: 1.5px solid #18469B;
    background: #18469B;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.gm-hdr .gm-hdr__burger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: transform .18s ease, opacity .18s ease;
}
/* pinned across hover/focus states: the theme kit's button:hover/:focus
   backgrounds otherwise repaint it */
.gm-hdr .gm-hdr__burger:hover,
.gm-hdr .gm-hdr__burger:focus,
.gm-hdr .gm-hdr__burger:active {
    background: #12377d;
    border: 1.5px solid #12377d; /* full border: the kit hover zeroes width */
}
.gm-hdr--open .gm-hdr__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.gm-hdr--open .gm-hdr__burger span:nth-child(2) { opacity: 0; }
.gm-hdr--open .gm-hdr__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Panel drops over the page content below the sticky bar. */
.gm-hdr__panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-top: 1px solid #EEF2F7;
    background: #fff;
    box-shadow: 0 18px 30px rgba(15, 23, 42, .16);
    padding: 10px 20px 22px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}
.gm-hdr__panel-menu { list-style: none; margin: 0; padding: 0; }
.gm-hdr__panel-menu a {
    display: block;
    padding: 12px 4px;
    color: #1f2937;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    border-bottom: 1px solid #F1F5F9;
}
.gm-hdr__panel-menu > li.menu-item-has-children > a { position: relative; padding-right: 34px; }
.gm-hdr__panel-menu > li.menu-item-has-children > a::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    border: 5px solid transparent;
    border-top-color: #6b7280;
    transform: translateY(-2px);
    transition: transform .15s ease;
}
.gm-hdr__panel-menu > li.is-open > a::after { transform: translateY(-7px) rotate(180deg); }
.gm-hdr__panel-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 6px 16px;
    display: none;
}
.gm-hdr__panel-menu li.is-open > .sub-menu { display: block; }
.gm-hdr__panel-menu .sub-menu a { font-weight: 500; font-size: 15px; border-bottom: 0; padding: 9px 4px; }
.gm-hdr__panel-menu .sub-menu .sub-menu { display: block; padding-left: 14px; }
/* Every pill segment stays in the bar at all widths, so the panel is
   the nav accordion alone. */

/* ---------- breakpoints ---------- */
/* 1024-1279: the full pill group stays; only the nav folds away */
@media (max-width: 1279px) {
    .gm-hdr__nav { display: none; }
    .gm-hdr .gm-hdr__burger { display: inline-flex; }
    .gm-hdr__inner { justify-content: space-between; }
    .gm-hdr__actions { margin-left: auto; }
}
/* below 1024 the pill labels start crowding and cause layout shifts:
   segments go icon-only — except Schedule Now, which keeps its text
   until ~600px where it no longer fits */
@media (max-width: 1023px) {
    .gm-hdr .gm-hdr__seg--search { padding: 0 14px; }
    .gm-hdr__inner .gm-hdr__tel span,
    .gm-hdr__inner .gm-hdr__loc span,
    .gm-hdr__inner .gm-hdr__portal span { display: none; }
    .gm-hdr__inner .gm-hdr__tel,
    .gm-hdr__inner .gm-hdr__loc,
    .gm-hdr__inner .gm-hdr__portal {
        padding: 0 14px;
        justify-content: center;
    }
    .gm-hdr__inner .gm-hdr__tel i,
    .gm-hdr__inner .gm-hdr__loc i,
    .gm-hdr__inner .gm-hdr__portal i { font-size: 15px; }
}
/* below 600 Schedule Now goes icon-only too */
@media (max-width: 599px) {
    .gm-hdr__inner .gm-hdr__seg--red span { display: none; }
    .gm-hdr__inner .gm-hdr__seg--red {
        padding: 0 14px;
        min-height: 40px;
        justify-content: center;
    }
    .gm-hdr__inner .gm-hdr__seg--red i { font-size: 15px; }
}

/* phones */
@media (max-width: 767px) {
    .gm-hdr__logo img { height: 44px; }
    .gm-hdr__inner { padding: 10px 14px; gap: 10px; }
}

/* small phones: crop the logo to the shield icon alone (the SVG is
   shield + wordmark; the wrapper clips to the shield's width) */
@media (max-width: 480px) {
    .gm-hdr__logo { width: 42px; overflow: hidden; }
    .gm-hdr__logo img { max-width: none; }
}
