/**
 * Site Header
 * 
 * Layered SVG background design with:
 * - Blue diagonal background layer
 * - Red and grey decorative stripes (desktop only)
 * - 4-column grid layout for desktop
 * - Flexbox layout for mobile
 * - Full-screen mobile menu overlay
 */

.site-header {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 7.75rem;
    overflow: visible;
    z-index: 3;

    @media screen and (max-width: 992px) {
        height: auto;
        min-height: 5rem;
    }
}

/* Background Layer - Blue - extends to right edge always */
.site-header__bg-blue {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 640px);
    right: 0;
    z-index: 1;
    filter: drop-shadow(0px 4px 16px rgba(0, 47, 95, 0.25));

    @media screen and (max-width: 1280px) {
        left: 0;
    }

    @media screen and (max-width: 992px) {
        background: var(--color-primary);
        filter: none;
    }

    img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: left center;

        @media screen and (max-width: 992px) {
            display: none;
        }
    }
}

/* Background Layer - Red Stripe (First/Behind) - fixed position relative to container */
.site-header__bg-red {
    position: absolute;
    bottom: 0;
    left: calc(50% - 640px + 333px);
    width: 84px;
    top: 0;
    z-index: 2;

    @media screen and (max-width: 1280px) {
        left: 26.06%;
        width: 84px;
    }

    @media screen and (max-width: 992px) {
        display: none;
    }

    img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: fill;
    }
}

/* Background Layer - Grey Stripe (Second/On Top) - fixed position relative to container */
.site-header__bg-grey {
    position: absolute;
    bottom: 0;
    left: calc(50% - 640px + 355px);
    width: 84px;
    top: 0;
    z-index: 3;

    @media screen and (max-width: 1280px) {
        left: 27.2%;
        width: 84px;
    }

    @media screen and (max-width: 992px) {
        display: none;
    }

    img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: fill;
    }
}

/* Header Inner Container */
.site-header__inner {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;

    @media screen and (max-width: 992px) {
        padding: 1rem 0;
    }
}

/* Eyebrow Bar */
.site-header__eyebrow {
    padding: 0;

    @media screen and (max-width: 992px) {
        display: none;
    }
}

.site-header__eyebrow-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.875rem;
    transition: gap 0.3s ease-in-out;
}

.site-header__emergency {
    font-family: var(--sans);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;

    @media screen and (max-width: 768px) {
        font-size: 0.75rem;
    }
}

/* Expandable Search */
.site-header__search-container {
    position: relative;
    width: 1.625rem;
    height: 1.625rem;
    transition: width 0.3s ease-in-out;
}

/* Expand container when search is active */
.site-header__search-container:has(.site-header__search-form.is-expanded),
.site-header__search-container:has(.site-header__search-input:focus-visible) {
    width: 12.5rem;
}

.site-header__search-form {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 2rem;
    width: 2rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2rem;
    padding: 0 0.1875rem;
    transition: all 0.3s ease-in-out;
    outline: none !important;
    box-shadow: none !important;

    /* Prevent any focus indicators on the form itself */
    &:focus,
    &:focus-visible,
    &:focus-within {
        outline: none !important;
        box-shadow: none !important;
        border-color: transparent !important;
    }
}

/* Override global.css form styles for header search */
input[type="search"].site-header__search-input {
    width: 0 !important;
    height: 100% !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    color: var(--color-white) !important;
    font-family: var(--sans) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    opacity: 0 !important;
    transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out !important;
    outline: none !important;
    border-radius: 2rem !important;
    box-shadow: none !important;

    /* Override all possible focus styles */
    &:focus,
    &:focus-visible,
    &:focus-within,
    &:hover,
    &:active {
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
        border-width: 0 !important;
        border-style: none !important;
        border-color: transparent !important;
        background: transparent !important;
    }

    /* Only show focus ring for keyboard navigation */
    &[data-keyboard-focus="true"]:focus {
        outline: 2px solid var(--color-white) !important;
        outline-offset: 2px;
        border: none !important;
        border-width: 0 !important;
        box-shadow: none !important;
    }

    &::placeholder {
        color: rgba(var(--color-white-rgb), 0.6) !important;
    }
}

/* Expanded state - override width and opacity */
.site-header__search-form.is-expanded input[type="search"].site-header__search-input {
    width: calc(100% - 2rem) !important;
    opacity: 1 !important;
    padding-right: 0.5rem !important;
}

.site-header__search-button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;

    &:hover {
        opacity: 0.7;
    }

    img {
        width: 100%;
        height: 100%;
    }
}

/* Expanded state */
.site-header__search-form.is-expanded {
    width: 12.5rem;
    background: rgba(var(--color-white-rgb), 0.2);
    border-color: transparent;
    padding-left: 1rem;
    padding-right: 0.1875rem;

    .site-header__search-input {
        width: calc(100% - 2rem);
        opacity: 1;
        padding-right: 0.5rem;
    }
}

/* Main Header Content */
.site-header__main {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0;
}

.site-header__main-content {
    display: grid;
    /* Grid: spacer | logo | spacer | navigation */
    grid-template-columns: 128px 166px 168px 1fr;
    align-items: end;
    width: 100%;
    gap: 0;

    /* Tighter columns for smaller screens */
    @media screen and (max-width: 1399px) {
        grid-template-columns: 100px 150px 168px 1fr;
    }

    @media screen and (max-width: 1199px) {
        grid-template-columns: 80px 140px 168px 1fr;
    }

    /* Mobile: switch to flexbox */
    @media screen and (max-width: 992px) {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}

/* Logo - Fixed position in second column */
.site-branding {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    grid-column: 2;
    position: relative;
    top: -0.25rem;
    left: -3rem;

    @media screen and (max-width: 992px) {
        position: static;
        flex: 0 0 auto;
        top: 0;
        left: 0;
    }
}

/* Mobile menu toggle - positioned in grid */
.mobile-menu-toggle {
    grid-column: 4;
    justify-self: end;
}

.custom-logo-link {
    display: block;
    line-height: 0;
    transition: opacity 0.2s ease-in-out;

    &:hover {
        opacity: 0.8;
    }
}

.custom-logo {
    height: auto;
    max-height: 3.5rem;
    width: auto;
    transition: max-height 0.3s ease;

    @media screen and (max-width: 1399px) {
        max-height: 3rem;
    }

    @media screen and (max-width: 1199px) {
        max-height: 2.75rem;
    }

    @media screen and (max-width: 768px) {
        max-height: 2.5rem;
    }

    @media screen and (max-width: 576px) {
        max-height: 2.25rem;
    }
}

/* Main Navigation - In fourth column, right aligned */
.main-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    grid-column: 4;

    @media screen and (max-width: 992px) {
        display: none;
    }

    ul {
        display: flex;
        align-items: center;
        gap: 1.875rem;
        list-style: none;
        margin: 0;
        padding: 0;

        @media screen and (max-width: 1200px) {
            gap: 1.5rem;
        }
    }

    li {
        margin: 0;
        position: relative;
    }

    a {
        font-family: var(--sans);
        font-size: 1rem;
        font-weight: 800;
        color: var(--color-white);
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 0.0075em;
        transition: opacity 0.2s ease-in-out;
        white-space: nowrap;
        display: block;
        padding:0;

        &:hover {
            opacity: 0.7;
        }

        @media screen and (max-width: 1200px) {
            font-size: 0.9375rem;
        }
    }

    /* Dropdown Menus */
    .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 15rem;
        background-color: var(--color-blue);
        box-shadow: 0px 4px 16px 0px rgba(0, 47, 95, 0.25);
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, visibility 0.3s;
        z-index: 1000;
        display: flex;
        flex-direction: column;

        li {
            display: block;
            width: 100%;
        }

        a {
            padding: 0.75rem 1.5rem;
            font-size: 0.9375rem;
            text-transform: none;
            font-weight: 700;

            &:hover {
                background-color: rgba(255, 255, 255, 0.1);
                opacity: 1;
            }
        }

        /* Nested dropdowns */
        .sub-menu {
            left: 100%;
            top: 0;
            margin-top: 0;
            margin-left: 0.5rem;
        }
    }

    /* Show dropdown on hover */
    .menu-item-has-children:hover > .sub-menu,
    .menu-item-has-children:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Dropdown indicator */
    .menu-item-has-children > a::after {
        content: '';
        display: inline-block;
        width: 0;
        height: 0;
        margin-left: 0.5rem;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 4px solid currentColor;
        vertical-align: middle;
    }
}

/* ========================================
   MOBILE MENU
   Full-screen overlay with centered navigation
   ======================================== */

.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 2.375rem;
    height: 2.25rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;

    @media screen and (max-width: 992px) {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: stretch;
    }

    span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--color-white);
        transition: all 0.3s ease-in-out;
        transform-origin: center;

        &:nth-child(1) {
            transform: translateY(0);
        }

        &:nth-child(2) {
            opacity: 1;
        }

        &:nth-child(3) {
            transform: translateY(0);
        }
    }

    &[aria-expanded="true"] {
        span {
            &:nth-child(1) {
                transform: translateY(10px) rotate(45deg);
            }

            &:nth-child(2) {
                opacity: 0;
            }

            &:nth-child(3) {
                transform: translateY(-10px) rotate(-45deg);
            }
        }
    }
}

/* Mobile Navigation Overlay */
.mobile-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-blue);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s;
    overflow: visible;
    padding: 10rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;

    @media screen and (min-width: 993px) {
        display: none;
    }

    &.is-active {
        opacity: 1;
        visibility: visible;
    }
}

/* Mobile Menu Close Button */
.mobile-menu-close {
    position: absolute;
    top: 2.4375rem;
    right: 1.4375rem;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    display: none;

    @media screen and (max-width: 992px) {
        display: block;
    }

    span {
        position: absolute;
        top: 50%;
        left: 50%;
        display: block;
        width: 2.298rem;
        height: 2px;
        background-color: var(--color-white);
        transform-origin: center;

        &:nth-child(1) {
            transform: translate(-50%, -50%) rotate(45deg);
        }

        &:nth-child(2) {
            transform: translate(-50%, -50%) rotate(-45deg);
        }
    }

    &:hover {
        opacity: 0.7;
    }
}

/* Mobile Menu List */
.mobile-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 16.3125rem;
    display: flex;
    flex-direction: column;
    gap: 1.875rem;
    align-items: center;
}

.mobile-navigation li {
    margin: 0;
    width: 16.3125rem;
    text-align: center;
}

.mobile-navigation a:not(.btn-employee-login) {
    display: block;
    padding: 0;
    font-family: var(--sans);
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.135px;
    transition: opacity 0.2s ease-in-out;

    &:hover {
        opacity: 0.7;
    }
}

/* Mobile Submenu */
.mobile-navigation .sub-menu {
    padding: 1rem 0 0;
    display: none;
    gap: 1rem;

    &.is-open {
        display: flex;
        flex-direction: column;
    }

    a {
        font-size: 1rem;
        font-weight: 700;
        text-transform: none;
    }
}

/* Mobile submenu toggle */
.mobile-navigation .menu-item-has-children {
    position: relative;

    > a {
        padding-right: 0;
    }
}

.mobile-navigation .submenu-toggle {
    display: none;
}

/* Mobile Search */
.mobile-search {
    width: 100%;
    max-width: 16.3125rem;
    margin-top: 1.875rem;
}

.mobile-search-form {
    position: relative;
    display: flex;
    align-items: center;
    height: 2.5rem;
    background: rgba(var(--color-white-rgb), 0.2);
    border: 1px solid transparent;
    border-radius: 2.5rem;
    padding: 0 0.5rem 0 1.25rem;
    transition: all 0.3s ease-in-out;

    &:focus-within {
        background: rgba(var(--color-white-rgb), 0.25);
        border-color: rgba(var(--color-white-rgb), 0.3);
    }
}

/* Override global.css form styles for mobile search */
input[type="search"].mobile-search-input {
    flex: 1 !important;
    height: 100% !important;
    padding: 0 0.5rem 0 0 !important;
    background: transparent !important;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    color: var(--color-white) !important;
    font-family: var(--sans) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    outline: none !important;
    box-shadow: none !important;
    width: auto !important;

    &::placeholder {
        color: rgba(var(--color-white-rgb), 0.6) !important;
    }

    &:focus,
    &:focus-visible,
    &:focus-within,
    &:hover,
    &:active {
        outline: none !important;
        box-shadow: none !important;
        border: none !important;
        border-width: 0 !important;
        border-style: none !important;
        border-color: transparent !important;
        background: transparent !important;
    }
}

.mobile-search-button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;

    &:hover {
        opacity: 0.7;
    }

    img {
        width: 100%;
        height: 100%;
    }
}

/* Mobile Phone Number */
.mobile-phone {
    display: block;
    width: 100%;
    max-width: 16.3125rem;
    margin-top: 1.875rem;
    padding: 0;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-white);
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.09px;
    transition: opacity 0.2s ease-in-out;

    &:hover {
        opacity: 0.7;
    }
}

/* ========================================
   EMPLOYEE LOGIN BUTTON
   Parallelogram button with SVG border
   ======================================== */
.btn-employee-login {
    display: inline-block;
    position: relative;
    padding: 0.8125rem 2.5rem;
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.0075em;
    background: transparent;
    border: none;
    transition: opacity 0.2s ease-in-out;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    min-width: 14rem;

    .btn-border {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
    }

    span {
        position: relative;
        z-index: 1;
    }

    &:hover {
        opacity: 0.7;
    }

    /* Mobile menu specific styling */
    .mobile-navigation & {
        margin-top: 1.875rem;
    }
}
.contact-tab {
    position: fixed;
    top: 150px;
    left: 0;
    z-index: 100;

    @media screen and (max-width: 991px) {
        display: none;
    }
    a {
        display: flex;
        align-items: center;
        background-color: var(--color-white);
        position: relative;
        padding: 15px 8px 15px 15px;
        font-weight: 800;
        color: var(--color-primary);
        text-decoration: none;
        position: relative;
        left: -115px;
        transition: .3s ease-in-out;

        &:hover, &:focus-visible {
            left: 0;
        }
        &:before {
            content: '';
            width: 30px;
            height: 100%;
            background-color: var(--color-white);
            position: absolute;
            bottom: 0;
            right: -29.5px;
            clip-path: polygon(0% 0%, 0% 0%, 0% 100%, 100% 100%);
        }
        img {
            width: 32px;
            display: block;
            margin-left: 10px;
        }
    }
}