/* Keep the desktop menu measurable, even while the compact header is visible. */
.stvm-header {
    position: relative;
    z-index: 99;
}

.stvm-header > .container {
    position: relative;
}

.stvm-header__row {
    display: grid;
    grid-template-columns: minmax(174px, 2fr) minmax(0, 9fr) minmax(64px, 1fr);
    min-height: 72px;
}

.stvm-header__row > * {
    grid-row: 1;
    min-width: 0;
}

.stvm-header__logo {
    grid-column: 1;
}

.stvm-header__menu {
    grid-column: 2;
}

.stvm-header__actions {
    grid-column: 3;
}

#stvm-desktop-menu > ul {
    display: flex;
    gap: 4px;
    width: max-content;
    margin: 0;
    padding: 0;
}

#stvm-desktop-menu > ul > li {
    flex: 0 0 auto;
}

#stvm-desktop-menu > ul > li > a {
    white-space: nowrap;
}

/* Size each desktop dropdown to its labels; leave the drawer untouched. */
#stvm-desktop-menu .submenu {
    width: max-content;
    min-width: 220px;
    max-width: calc(100vw - 80px);
    padding: 0;
}

#stvm-desktop-menu .submenu > li + li {
    box-shadow: inset 0 1px 0 #d7e3dc;
}

#stvm-desktop-menu .submenu > li > a {
    padding-block: 9px;
    overflow-wrap: anywhere;
}

#stvm-desktop-menu .submenu > li.has-dropdown > a {
    padding-right: 50px;
}

#stvm-desktop-menu > ul > li:last-child > .submenu {
    right: 0;
    left: auto;
}

#stvm-desktop-menu li:focus-within > .submenu {
    top: 100%;
    visibility: visible;
    opacity: 1;
}

#stvm-desktop-menu .submenu li:focus-within > .submenu {
    top: 0;
    left: 100%;
}

#stvm-desktop-menu a:focus-visible {
    outline: 2px solid var(--tp-theme-1);
    outline-offset: -3px;
}

.stvm-header__hamburger {
    display: none;
}

.stvm-header[data-navigation="compact"] {
    padding-block: 20px;
}

.stvm-header[data-navigation="compact"] .stvm-header__row {
    min-height: 40px;
}

.stvm-header[data-navigation="compact"] .stvm-header__logo {
    grid-column: 1 / 3;
}

.stvm-header[data-navigation="compact"] .stvm-header__menu {
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

.stvm-header[data-navigation="compact"] .stvm-header__hamburger {
    display: block;
}

.stvm-header[data-navigation="compact"] .stvm-header-search,
.stvm-header[data-navigation="compact"] .stvm-search-panel {
    display: none;
}

.stvm-header__hamburger button:focus-visible,
.stvm-mobile-nav a:focus-visible,
.stvm-mobile-nav button:focus-visible {
    outline: 2px solid var(--tp-theme-1);
    outline-offset: 3px;
}

/* The same WordPress menu remains usable in the existing Bootstrap drawer. */
.stvm-mobile-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.stvm-mobile-nav li {
    position: relative;
    border-bottom: 1px solid var(--tp-border-1);
}

.stvm-mobile-nav li > a {
    display: block;
    padding: 12px 48px 12px 0;
    color: var(--tp-common-black);
    font-size: 15px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.stvm-mobile-nav li > ul {
    margin-left: 16px;
}

.stvm-mobile-nav [hidden] {
    display: none;
}

.stvm-submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    color: var(--tp-theme-1);
    font-size: 22px;
}

/* Top utility strip. These items remain plain text until their pages are ready. */
.stvm-topbar {
    background: #fff;
    border-bottom: 1px solid #d7e3dc;
    color: #18322e;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.stvm-topbar__inner,
.stvm-topbar__group,
.stvm-topbar__item {
    display: flex;
    align-items: center;
}

.stvm-topbar__inner {
    min-height: 44px;
    justify-content: space-between;
    gap: 24px;
    padding-block: 8px;
}

.stvm-topbar__group {
    gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stvm-topbar__item {
    gap: 10px;
    white-space: nowrap;
}

.stvm-topbar__item i {
    color: var(--tp-theme-1, #007a70);
    font-size: 16px;
}

.stvm-topbar__schedule-mobile {
    display: none;
}

@media (max-width: 767px) {
    .stvm-topbar__inner {
        gap: 16px;
    }

    .stvm-topbar__group {
        gap: 24px;
    }

    .stvm-topbar__item {
        gap: 8px;
    }

    .stvm-topbar__schedule-desktop,
    .stvm-topbar__phone {
        display: none;
    }

    .stvm-topbar__schedule-mobile {
        display: inline;
    }
}

@media (max-width: 359px) {
    .stvm-topbar {
        font-size: 12px;
    }

    .stvm-topbar__inner,
    .stvm-topbar__group {
        gap: 12px;
    }

    .stvm-topbar__item {
        gap: 6px;
    }
}
