/* Master header rules extracted from index.html. */
:root {
    --shared-header-ready: 1;
}

/* Prevent any raw page header from painting before the shared UI is assembled. */
html:not(.site-ready) body {
    visibility: hidden !important;
    opacity: 0 !important;
}

html.site-ready body {
    visibility: visible;
}

.master-header-shell {
    width: 100%;
    margin: 0;
    font-family: "Poppins", sans-serif;
}

.master-header-shell .home-header,
.master-header-shell .home-service-nav {
    display: none !important;
    width: 100%;
}

body.home-page #home-service-nav {
    display: none !important;
}

.master-header-shell .home-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    background: #ffffff;
    border-bottom: 1px solid #dbe4d7;
    position: relative;
    z-index: 3004;
    visibility: visible !important;
    opacity: 1 !important;
}

.master-header-shell .home-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.master-header-shell .home-brand-mark {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible;
    box-shadow: none !important;
}

@media (min-width: 1101px) {
    .master-header-shell .home-header {
        height: 105px;
        min-height: 105px;
        padding-top: 8px;
        padding-bottom: 8px;
        box-sizing: border-box;
    }
}

.master-header-shell .home-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.master-header-shell .home-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.02;
}

.master-header-shell .home-brand-copy strong {
    font-size: 20px !important;
    letter-spacing: -0.02em;
    color: #24483a;
}

.master-header-shell .home-brand-copy span {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #2b8b55;
}

.master-header-shell .home-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.master-header-shell .home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    color: #ffffff;
    white-space: nowrap;
}

.master-header-shell .home-btn--blue { background: #2e9359 !important; }
.master-header-shell .home-btn--about { background: #24483a; }

.home-actions .home-btn--about { background: #24483a; }
.home-actions .home-btn--blue { background: #2e9359; }
.home-actions .home-nav-link { background: #276c70; }
.home-actions .home-header-consultation .nav-menu-trigger,
.home-actions .home-header-consultation .nav-menu-trigger:hover,
.home-actions .home-header-consultation .nav-menu-trigger:focus-visible,
.home-actions .home-header-consultation.is-open .nav-menu-trigger {
    background: #276c70 !important;
}

.home-actions .home-header-services .nav-menu-trigger,
.home-actions .home-header-services .nav-menu-trigger:hover,
.home-actions .home-header-services .nav-menu-trigger:focus-visible,
.home-actions .home-header-services.is-open .nav-menu-trigger {
    background: #276c70 !important;
    color: #ffffff !important;
}

.home-actions .home-header-services .nav-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 39px;
    padding: 11px 16px !important;
    border-radius: 7px !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.home-actions .home-header-services .nav-menu-trigger i {
    color: #b5e7e4 !important;
    font-size: 14px;
}

.home-actions .home-btn--about i { color: #e1c45e !important; }
.home-actions .home-btn--blue i { color: #d8f2df !important; }
.home-actions .home-nav-link i { color: #b5e7e4 !important; }
.home-actions .home-header-consultation .nav-menu-trigger i { color: #b5e7e4 !important; }

.home-actions .home-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 16px;
    border: 0;
    border-radius: 7px;
    background: #24483a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.home-actions .home-nav-link:hover,
.home-actions .home-nav-link:focus-visible,
.home-actions .nav-menu.is-open .home-nav-link {
    background: #1d3b30;
    color: #ffffff;
    transform: translateY(-1px);
}

.home-actions .home-nav-link i {
    font-size: 14px;
}

.home-actions .home-header-consultation .nav-menu-trigger {
    background: #276c70 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    min-height: 39px;
    padding: 11px 16px !important;
    border-radius: 7px !important;
}

.home-actions .home-header-services .nav-menu-trigger,
.home-actions .home-header-consultation .nav-menu-trigger {
    gap: 6px !important;
}

.home-actions .home-header-services .nav-menu-trigger > i,
.home-actions .home-header-consultation .nav-menu-trigger > i {
    color: #b5e7e4 !important;
}

.home-actions .home-header-services .nav-menu-trigger > i:first-child,
.home-actions .home-header-consultation .nav-menu-trigger > i:first-child {
    margin-right: 0 !important;
}

.home-actions .home-header-consultation {
    padding-bottom: 12px;
    margin-bottom: -12px;
}

.home-actions .home-header-consultation .nav-dropdown {
    top: calc(100% - 12px);
    left: auto;
    right: 0;
    width: 270px;
    padding: 12px;
    border-radius: 10px;
}

.home-actions .home-header-consultation.is-open .nav-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.home-actions .home-header-consultation .nav-dropdown-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.home-actions .home-header-consultation .nav-dropdown-link i {
    width: 18px;
    color: #597b9b;
    font-size: 18px;
    text-align: center;
}

.home-actions .home-header-services {
    padding-bottom: 12px;
    margin-bottom: -12px;
}

.home-actions .home-header-services .nav-dropdown {
    top: calc(100% - 12px);
    left: 0;
    right: auto;
    width: min(480px, calc(100vw - 32px));
    padding: 12px;
    border-radius: 10px;
}

.home-actions .home-header-services.is-open .nav-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.services-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.services-category {
    min-width: 0;
}

.services-category.is-expanded {
    grid-column: 1 / -1;
}

.services-category-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #ffffff;
    color: #27415f;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.services-category-trigger:hover,
.services-category-trigger:focus-visible,
.services-category.is-expanded .services-category-trigger {
    border-color: #d7e8e5;
    background: #eef6f4;
    color: #214f52;
    outline: none;
}

.services-category-icon {
    display: grid;
    flex: 0 0 32px;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: #e7f1ef;
    color: #276c70;
    font-size: 14px;
}

.services-category-label {
    min-width: 0;
    flex: 1 1 auto;
}

.services-category-chevron {
    color: #78908d;
    font-size: 11px;
    transition: transform 0.18s ease;
}

.services-category.is-expanded .services-category-chevron {
    transform: rotate(180deg);
}

.services-category-panel {
    margin: 0 4px 8px;
    padding: 12px 8px 6px;
    border-top: 1px solid #e3ece9;
}

.services-category-panel[hidden] {
    display: none !important;
}

.services-submenu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 18px;
}

.services-submenu-column {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.services-submenu-column .nav-dropdown-heading {
    margin: 4px 8px 6px;
    color: #276c70;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.services-category-panel > .nav-dropdown-heading {
    margin: 0 8px 8px;
    color: #24483a;
    font-size: 13px;
    font-weight: 800;
}

.services-submenu-column .nav-dropdown-link {
    display: block;
    min-width: 0;
    padding: 7px 9px;
    border-radius: 6px;
    color: #52645c;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
    white-space: normal;
}

.services-submenu-column .nav-dropdown-link:hover,
.services-submenu-column .nav-dropdown-link:focus-visible {
    background: #eef6f4;
    color: #214f52;
}

.services-submenu-column .nav-dropdown-link[aria-disabled="true"] {
    color: #9aa8a4;
    cursor: not-allowed;
}

.home-actions .home-header-services .nav-dropdown-link i {
    width: 17px;
    color: #276c70;
    text-align: center;
}

.master-header-shell .home-service-nav.topbar-nav {
    display: flex;
    align-items: center;
    gap: 34px;
    padding: 15px 18px 13px;
    background: #f6f6f1;
    border-bottom: 2px solid #d8ebfb !important;
    overflow: visible;
    scrollbar-width: none;
    white-space: nowrap;
    color: #5e6c67;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    z-index: 3003;
}

.master-header-shell .home-service-nav.topbar-nav::-webkit-scrollbar { display: none; }

.master-header-shell .home-service-nav.topbar-nav .nav-menu {
    position: relative;
    flex: 0 0 auto;
    z-index: 1;
}

.master-header-shell .home-service-nav.topbar-nav .nav-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    transform: none;
}

.master-header-shell .home-service-nav.topbar-nav .nav-menu-trigger:hover,
.master-header-shell .home-service-nav.topbar-nav .nav-menu-trigger:focus-visible,
.master-header-shell .home-service-nav.topbar-nav .nav-menu.is-open .nav-menu-trigger {
    color: #234537;
    font-weight: 700;
    transform: none;
}

.master-header-shell .home-service-nav.topbar-nav .nav-menu-trigger i { display: none; }
.master-header-shell .home-service-nav.topbar-nav .nav-dropdown { text-align: left; }

/* Shared dropdown rules from style.css, scoped to the master header. */
.master-header-shell .nav-menu {
    position: relative;
    flex: 0 0 auto;
    padding-bottom: 12px;
    margin-bottom: -12px;
    z-index: 3001;
}

.master-header-shell .nav-menu.is-open { z-index: 3002; }

.master-header-shell .nav-menu-trigger,
.master-header-shell .topbar-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: #5f7188;
    transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.master-header-shell .nav-menu-trigger:hover,
.master-header-shell .nav-menu-trigger:focus-visible,
.master-header-shell .nav-menu.is-open .nav-menu-trigger,
.master-header-shell .topbar-nav a:hover,
.master-header-shell .topbar-nav a:focus-visible {
    color: #183b72;
    transform: translateY(-1px);
}

.master-header-shell .nav-menu-trigger > .fa-angle-down {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.master-header-shell .nav-menu.is-open .nav-menu-trigger > .fa-angle-down,
.master-header-shell .nav-menu-trigger:hover > .fa-angle-down,
.master-header-shell .nav-menu-trigger:focus-visible > .fa-angle-down { transform: rotate(180deg); }

.master-header-shell .nav-dropdown {
    position: absolute;
    top: calc(100% - 12px);
    left: 0;
    right: auto;
    width: 320px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 128px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(16, 36, 61, 0.10);
    box-shadow: 0 24px 54px rgba(18, 40, 72, 0.18);
    z-index: 3003;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    --dropdown-shift-x: 0;
    --dropdown-shift-y: 0;
    transform: translateX(var(--dropdown-shift-x)) translateY(var(--dropdown-shift-y));
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

.master-header-shell .nav-menu.is-open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.master-header-shell .nav-dropdown--sm { width: 300px; }
.master-header-shell .nav-dropdown--md { width: 360px; }
.master-header-shell .nav-dropdown--lg { width: min(760px, calc(100vw - 24px)); }
.master-header-shell .nav-dropdown--xl { width: min(980px, calc(100vw - 24px)); }

.master-header-shell .nav-dropdown-heading {
    margin-bottom: 10px;
    color: #183b72;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.master-header-shell .nav-dropdown-heading--single { margin-bottom: 12px; }
.master-header-shell .nav-dropdown-grid { display: grid; gap: 14px; }
.master-header-shell .nav-dropdown-grid--1 { grid-template-columns: 1fr; }
.master-header-shell .nav-dropdown-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.master-header-shell .nav-dropdown-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.master-header-shell .nav-dropdown-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.master-header-shell .nav-dropdown-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.master-header-shell .nav-dropdown-link {
    color: #27415f;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    padding: 8px 10px;
    border-radius: 12px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.master-header-shell .nav-dropdown-link:hover,
.master-header-shell .nav-dropdown-link:focus-visible {
    color: #183b72;
    background: rgba(24, 59, 114, 0.08);
    transform: translateX(2px);
}

.master-header-shell .nav-menu--left .nav-dropdown { transform-origin: top left; }
.master-header-shell .nav-menu--right .nav-dropdown { transform-origin: top right; }
.master-header-shell .nav-menu--center .nav-dropdown { transform-origin: top left; }

@media (max-width: 920px) {
    .master-header-shell .home-header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .master-header-shell .home-actions { justify-content: center; }
}

/* Keep every shared-header page inside the Nest Hub Max landscape viewport. */
@media only screen and (width: 1280px) and (height: 800px) and (orientation: landscape) {
    html {
        width: 100%;
        max-width: 100%;
        overflow-x: clip !important;
    }

    body {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        overflow-x: clip !important;
    }
}
/* Keep the outgoing page visible until the destination is ready, then cross-fade. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: none;
}

::view-transition-new(root) {
    animation: page-transition-in 220ms ease both;
}

@keyframes page-transition-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
    html.site-ready body {
        animation: initial-page-reveal 180ms ease-out both;
    }
}

@keyframes initial-page-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Enlarge the logo after removing the adjacent brand text. */
html body > .master-header-shell .home-header .home-brand-mark {
    width: 130px !important;
    height: 60px !important;
}

@media (max-width: 1100px) {
    html body > .master-header-shell .home-header .home-brand-mark {
        width: 100px !important;
        height: 46px !important;
    }
}
