.header {
    height: var(--header-height);
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
}

.bar {
    height: 100%;
    width: 100%;
    background-color: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2%;
    box-sizing: border-box;
    gap: 1rem;
}

.image {
    height: 60%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.image a {
    height: 100%;
    display: block;
}

.image img {
    height: 100%;
    width: auto;
    display: block;
}

.header-actions {
    display: none;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    box-sizing: border-box;
}

.menu-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.open .menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open .menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open .menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-wrapper {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4%;
    flex: 1;
    max-width: none;
    max-height: 80%;
}

.links a {
    color: rgb(31, 31, 31);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.9;
    font-style: normal;
    padding: 0;
    word-wrap: break-word;
    white-space: nowrap;
    position: relative;
    transition: color 0.3s ease;
}

.links a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0px;
    left: 0;
    background-color: #333;
    transform: scaleX(0);
    transform-origin: bottom left;
    transition: transform 0.3s ease;
    z-index: 10;
}

.links a:hover {
    color: #516774;
    transform: scale(1.15);
    transition: all 500ms;
}

.links a:hover::after {
    transform: scaleX(1);
}

.contact {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    width: auto;
}

.phone-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgb(31, 31, 31);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.phone-link:hover {
    color: #516774;
}

.phone-link-compact {
    padding: 8px;
    border-radius: 4px;
}

.phone-icon {
    stroke: currentColor;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .header-actions {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-wrapper {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex: none;
        flex-direction: column;
        align-items: stretch;
        background-color: white;
        padding: 0;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    }

    .nav-wrapper.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .links {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        max-height: none;
        width: 100%;
    }

    .links a {
        white-space: normal;
        font-size: 1.05rem;
        line-height: 1.4;
        padding: 14px 5%;
        border-bottom: 1px solid #eee;
        transform: none;
    }

    .links a:hover {
        transform: none;
        background-color: #f5f5f5;
    }

    .links a::after {
        display: none;
    }

    .contact {
        justify-content: center;
        padding: 16px 5%;
        border-top: 1px solid #eee;
    }

    .phone-link {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .phone-link-compact + .menu-toggle {
        margin-left: 0;
    }

    .bar {
        padding: 0 4%;
    }
}
