/* =========================================================
   HOUSTON SLEEP HEALTH
   HEADER & NAVIGATION
========================================================= */

:root {
    --hsh-primary: #516fe8;
    --hsh-primary-hover: #405fd4;

    --hsh-dark: #111111;
    --hsh-text: #202020;
    --hsh-muted: #666666;

    --hsh-white: #ffffff;
    --hsh-border: #e9e9e9;

    --hsh-header-height: 92px;

    --hsh-container: 1720px;
}


/* =========================================================
   RESET
========================================================= */

.hsh-header *,
.hsh-header *::before,
.hsh-header *::after {
    box-sizing: border-box;
}

.hsh-header ul,
.hsh-header li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hsh-header a {
    text-decoration: none;
}

body.hsh-menu-open {
    overflow: hidden;
}


/* =========================================================
   HEADER
========================================================= */

.hsh-header {
    position: relative;
    z-index: 9999;

    width: 100%;

    background: var(--hsh-white);

    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}


.hsh-header__inner {
    width: 100%;
    max-width: var(--hsh-container);

    min-height: var(--hsh-header-height);

    margin: 0 auto;

    padding: 0 24px;

    display: flex;
    align-items: center;
}


/* =========================================================
   LOGO
========================================================= */

.hsh-header__brand {
    flex: 0 0 auto;

    position: relative;
    z-index: 2;
}


.hsh-header__brand .custom-logo-link {
    display: inline-flex;
    align-items: center;
}


.hsh-header__brand .custom-logo {
    display: block;

    width: auto;
    height: auto;

    max-width: 210px;
    max-height: 58px;
}


.hsh-text-logo {
    display: inline-block;

    color: var(--hsh-dark);

    font-size: 28px;
    font-weight: 700;
    line-height: 1;

    text-decoration: none;
}


/* =========================================================
   NAVIGATION
========================================================= */

.hsh-navigation {
    margin-left: auto;
    margin: auto;
}


.hsh-main-menu {
    display: flex;
    align-items: center;

    gap: 36px;
}


.hsh-main-menu li {
    position: relative;
}


.hsh-main-menu > li > a {
    min-height: var(--hsh-header-height);

    display: flex;
    align-items: center;

    color: var(--hsh-text);

    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;

    white-space: nowrap;

    transition: color 0.25s ease;
}


.hsh-main-menu > li > a:hover,
.hsh-main-menu > li.current-menu-item > a,
.hsh-main-menu > li.current-menu-ancestor > a,
.hsh-main-menu > li.current_page_item > a {
    color: var(--hsh-primary);
}


/* =========================================================
   DESKTOP NAVIGATION
========================================================= */

@media (min-width: 991px) {

    /* -----------------------------------------------------
       TOP LEVEL DROPDOWN ARROW
    ----------------------------------------------------- */

    .hsh-main-menu
    > .menu-item-has-children
    > a::after {

        content: "";

        width: 7px;
        height: 7px;

        margin-left: 9px;
        margin-top: -4px;

        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;

        transform: rotate(45deg);

        transition:
            transform 0.2s ease,
            margin 0.2s ease;
    }


    .hsh-main-menu
    > .menu-item-has-children:hover
    > a::after {

        transform: rotate(225deg);

        margin-top: 4px;
    }


    /* =====================================================
       LEVEL 2 DROPDOWN
    ===================================================== */

    .hsh-main-menu .sub-menu {
        position: absolute;

        top: 100%;
        left: -20px;

        z-index: 99999;

        width: 290px;

        padding: 10px 0;

        background: var(--hsh-white);

        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 3px;

        box-shadow:
            0 18px 45px rgba(0, 0, 0, 0.09),
            0 5px 15px rgba(0, 0, 0, 0.04);

        opacity: 0;
        visibility: hidden;

        transform: translateY(10px);

        pointer-events: none;

        transition:
            opacity 0.2s ease,
            visibility 0.2s ease,
            transform 0.2s ease;
    }


    /* Show dropdown */

    .hsh-main-menu li:hover > .sub-menu,
    .hsh-main-menu li:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;

        transform: translateY(0);

        pointer-events: auto;
    }


    /* =====================================================
       DROPDOWN LINKS
    ===================================================== */

    .hsh-main-menu .sub-menu > li {
        position: relative;
    }


    .hsh-main-menu .sub-menu a {
        position: relative;

        width: 100%;

        padding: 15px 28px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        color: var(--hsh-text);

        font-size: 15px;
        font-weight: 500;
        line-height: 1.5;

        background: transparent;

        transition:
            color 0.2s ease,
            background-color 0.2s ease,
            padding 0.2s ease;
    }


    .hsh-main-menu .sub-menu a:hover,
    .hsh-main-menu .sub-menu .current-menu-item > a,
    .hsh-main-menu .sub-menu .current-menu-ancestor > a {
        color: var(--hsh-primary);

        background: #f5f7ff;
    }


    /* =====================================================
       LEVEL 3+
       IMPORTANT:
       OPEN TO LEFT SIDE
    ===================================================== */

    .hsh-main-menu
    .sub-menu
    .sub-menu {

        top: -10px;

        right: auto;

        left: calc(100% + 2px);

        transform: translateX(10px);
    }


    .hsh-main-menu
    .sub-menu
    li:hover
    > .sub-menu,

    .hsh-main-menu
    .sub-menu
    li:focus-within
    > .sub-menu {

        transform: translateX(0);
    }


    /* =====================================================
       LEVEL 3 ARROW
       POINTING LEFT
    ===================================================== */

    .hsh-main-menu
    .sub-menu
    .menu-item-has-children
    > a::after {

           content: "";

        width: 6px;
        height: 6px;

        border-top: 1.5px solid currentColor;
        border-right: 1.5px solid currentColor;

        transform: rotate(45deg);

        margin-left: auto;
    }


    /* =====================================================
       KEEP RIGHT-SIDE TOP DROPDOWNS INSIDE SCREEN
    ===================================================== */

    .hsh-main-menu
    > li:last-child
    > .sub-menu,

    .hsh-main-menu
    > li:nth-last-child(2)
    > .sub-menu,

    .hsh-main-menu
    > li:nth-last-child(3)
    > .sub-menu {

        left: auto;
        right: 0;
    }

}


/* =========================================================
   APPOINTMENT BUTTON
========================================================= */

.hsh-header__cta {
    flex: 0 0 auto;

    margin-left: 36px;
}


.hsh-appointment-btn {
    min-height: 64px;

    padding: 0 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 14px;

    color: var(--hsh-white);

    background: var(--hsh-primary);

    border-radius: 6px;

    font-size: 15px;
    font-weight: 600;

    white-space: nowrap;

    transition:
        background-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


.hsh-appointment-btn:hover {
    color: var(--hsh-white);

    background: var(--hsh-primary-hover);

    transform: translateY(-2px);

    box-shadow:
        0 10px 24px rgba(81, 111, 232, 0.25);
}


.hsh-appointment-btn svg {
    flex: 0 0 auto;

    transition: transform 0.25s ease;
}


.hsh-appointment-btn:hover svg {
    transform: translateX(4px);
}


/* =========================================================
   MOBILE ELEMENTS
   HIDDEN ON DESKTOP
========================================================= */

.hsh-menu-toggle,
.hsh-mobile-nav-header,
.hsh-mobile-appointment,
.hsh-submenu-toggle,
.hsh-menu-overlay {
    display: none;
}


/* =========================================================
   SMALL DESKTOP
========================================================= */

@media (max-width: 1200px) and (min-width: 991px) {

    .hsh-main-menu {
        gap: 20px;
    }


    .hsh-main-menu > li > a {
        font-size: 14px;
    }


    .hsh-header__cta {
        margin-left: 22px;
    }


    .hsh-appointment-btn {
        min-height: 54px;

        padding-left: 18px;
        padding-right: 18px;

        font-size: 14px;
    }

}


/* =========================================================
   TABLET + MOBILE
   BELOW 991PX
========================================================= */

@media (max-width: 990.98px) {

    :root {
        --hsh-header-height: 76px;
    }


    /* =====================================================
       HEADER
    ===================================================== */

    .hsh-header__inner {
        min-height: 76px;

        padding-left: 20px;
        padding-right: 20px;
    }


    /* =====================================================
       LOGO
    ===================================================== */

    .hsh-header__brand .custom-logo {
        max-width: 170px;
        max-height: 50px;
    }


    /* =====================================================
       HIDE DESKTOP CTA
    ===================================================== */

    .hsh-header__cta {
        display: none;
    }


    /* =====================================================
       HAMBURGER
    ===================================================== */

    .hsh-menu-toggle {
        position: relative;
        z-index: 10002;

        width: 46px;
        height: 46px;

        margin-left: auto;

        padding: 0;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 5px;

        border: 0;
        border-radius: 5px;

        background: var(--hsh-primary);

        cursor: pointer;
    }


    .hsh-menu-toggle span {
        display: block;

        width: 22px;
        height: 2px;

        border-radius: 2px;

        background: var(--hsh-white);

        transition:
            transform 0.25s ease,
            opacity 0.25s ease;
    }


    /* Hamburger animation */

    .hsh-header.hsh-menu-open
    .hsh-menu-toggle span:nth-child(1) {

        transform: translateY(7px) rotate(45deg);
    }


    .hsh-header.hsh-menu-open
    .hsh-menu-toggle span:nth-child(2) {

        opacity: 0;
    }


    .hsh-header.hsh-menu-open
    .hsh-menu-toggle span:nth-child(3) {

        transform: translateY(-7px) rotate(-45deg);
    }


    /* =====================================================
       OFF-CANVAS MOBILE MENU
    ===================================================== */

    .hsh-navigation {
        position: fixed;

        top: 0;
        right: 0;

        z-index: 10005;

        width: min(88vw, 390px);

        height: 100vh;
        height: 100dvh;

        margin: 0;

        background: var(--hsh-white);

        overflow-x: hidden;
        overflow-y: auto;

        visibility: hidden;

        transform: translateX(100%);

        box-shadow:
            -15px 0 40px rgba(0, 0, 0, 0.12);

        transition:
            transform 0.35s ease,
            visibility 0.35s ease;
    }


    .hsh-header.hsh-menu-open
    .hsh-navigation {

        visibility: visible;

        transform: translateX(0);
    }


    /* =====================================================
       MOBILE NAV HEADER
    ===================================================== */

    .hsh-mobile-nav-header {
        min-height: 78px;

        padding: 18px 22px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        border-bottom:
            1px solid var(--hsh-border);
    }


    .hsh-mobile-nav-title {
        color: var(--hsh-dark);

        font-size: 21px;
        font-weight: 700;
    }


    .hsh-menu-close {
        width: 42px;
        height: 42px;

        padding: 0;

        display: flex;
        align-items: center;
        justify-content: center;

        color: var(--hsh-dark);

        background: #f5f5f5;

        border: 0;
        border-radius: 50%;

        cursor: pointer;

        transition:
            color 0.2s ease,
            background-color 0.2s ease;
    }


    .hsh-menu-close:hover {
        color: var(--hsh-white);

        background: var(--hsh-primary);
    }


    /* =====================================================
       MOBILE MENU
    ===================================================== */

    .hsh-main-menu {
        display: block;

        width: 100%;

        padding: 12px 22px 20px;
    }


    .hsh-main-menu > li,
    .hsh-main-menu .sub-menu > li {

        position: relative;

        width: 100%;

        border-bottom:
            1px solid var(--hsh-border);
    }


    .hsh-main-menu > li:last-child {
        border-bottom: 0;
    }


    .hsh-main-menu > li > a,
    .hsh-main-menu .sub-menu a {

        min-height: auto;

        width: 100%;

        padding:
            15px
            45px
            15px
            0;

        display: block;

        color: var(--hsh-dark);

        background: transparent;

        font-size: 15px;
        font-weight: 600;
        line-height: 1.5;
    }


    .hsh-main-menu .sub-menu a {
        padding-top: 12px;
        padding-bottom: 12px;

        font-size: 14px;
        font-weight: 500;
    }


    .hsh-main-menu a:hover,
    .hsh-main-menu .current-menu-item > a,
    .hsh-main-menu .current-menu-ancestor > a {

        color: var(--hsh-primary);

        background: transparent;
    }


    /* Remove desktop arrows */

    .hsh-main-menu
    .menu-item-has-children
    > a::after {

        display: none !important;
    }


    /* =====================================================
       MOBILE SUBMENU
    ===================================================== */

    .hsh-main-menu .sub-menu {
        position: static;

        width: 100%;

        margin: 0;

        padding:
            0
            0
            8px
            16px;

        display: none;

        border: 0;

        background: transparent;

        box-shadow: none;

        opacity: 1;
        visibility: visible;

        transform: none;

        pointer-events: auto;
    }


    .hsh-main-menu
    .menu-item-has-children.hsh-submenu-open
    > .sub-menu {

        display: block;
    }


    /* Level 3 indentation */

    .hsh-main-menu
    .sub-menu
    .sub-menu {

        padding-left: 16px;
    }


    /* =====================================================
       SUBMENU TOGGLE
    ===================================================== */

    .hsh-submenu-toggle {
        position: absolute;

        top: 7px;
        right: 0;

        z-index: 3;

        width: 40px;
        height: 40px;

        padding: 0;

        display: flex;
        align-items: center;
        justify-content: center;

        color: var(--hsh-dark);

        background: transparent;

        border: 0;

        cursor: pointer;
    }


    .hsh-submenu-toggle svg {
        width: 15px;
        height: 15px;

        transition: transform 0.25s ease;
    }


    .hsh-submenu-open
    > .hsh-submenu-toggle
    svg {

        transform: rotate(180deg);
    }


    /* =====================================================
       MOBILE APPOINTMENT BUTTON
    ===================================================== */

    .hsh-mobile-appointment {
        min-height: 54px;

        margin:
            10px
            22px
            30px;

        padding:
            0
            20px;

        display: flex;
        align-items: center;
        justify-content: center;

        gap: 10px;

        color: var(--hsh-white);

        background: var(--hsh-primary);

        border-radius: 5px;

        font-size: 14px;
        font-weight: 600;
    }


    .hsh-mobile-appointment:hover {
        color: var(--hsh-white);

        background:
            var(--hsh-primary-hover);
    }


    /* =====================================================
       MOBILE OVERLAY
    ===================================================== */

    .hsh-menu-overlay {
        position: fixed;

        inset: 0;

        z-index: 10000;

        width: 100%;
        height: 100%;

        padding: 0;

        display: block;

        background:
            rgba(0, 0, 0, 0.55);

        border: 0;

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        cursor: pointer;

        transition:
            opacity 0.3s ease,
            visibility 0.3s ease;
    }


    .hsh-header.hsh-menu-open
    .hsh-menu-overlay {

        opacity: 1;
        visibility: visible;

        pointer-events: auto;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 575px) {

    .hsh-header__inner {
        padding-left: 15px;
        padding-right: 15px;
    }


    .hsh-header__brand .custom-logo {
        max-width: 150px;
    }


    .hsh-menu-toggle {
        width: 43px;
        height: 43px;
    }


    .hsh-navigation {
        width: min(90vw, 360px);
    }

}