/* ========================================
   HEADER
   ======================================== */

/* Prevent any scaling of header elements */
.header-container,
.nav-wrapper,
.nav-button,
.call-button {
    transform: scale(1) !important;
    zoom: 1 !important;
}

.header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0px 80px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-bottom: 1px solid rgba(121, 121, 121, 0.5);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transform-origin: top center;
    min-height: 70px;
    transition: transform 0.3s ease;
}

/* VPS Logo */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-container img {
    height: 70px;
    width: auto;
}

.header-container img:hover {
    cursor: pointer;
}


/* Navigation */
.nav-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    list-style: none;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: visible;
    transform: scale(1);
    transform-origin: center;
}

.nav-wrapper .call-button {
    order: 999;
    flex-shrink: 0;
}

.nav-wrapper * {
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-button {
    transition: color 0.1s ease-in-out;
    text-decoration: none;
    color: inherit;
}

.nav-button:hover {
    color: var(--green);
    cursor: pointer;
}

.nav-button.active {
    color: var(--green);
    font-weight: 600;
}

/* Call Button */
.call-button {
    border-radius: 50px;
    padding: 10px 20px;
    background: rgba(5, 168, 76, 0.945);
    color: var(--white);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(104, 233, 160, 0.4);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease-in-out;
    white-space: nowrap !important;
    flex-shrink: 0;
    min-width: fit-content;
    width: auto;
    max-width: none;
    overflow: hidden;
    text-decoration: none;
}

.call-button:hover {
    scale: 1.03;
    box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: solid 1px rgba(10, 82, 41, 0.1);
}

@keyframes ring-phone {
    0% {
        transform: rotate(0deg) scale(1);
    }
    16.67% {
        transform: rotate(-20deg) scale(1.1);
    }
    33.33% {
        transform: rotate(20deg) scale(1.05);
    }
    50% {
        transform: rotate(-20deg) scale(1.1);
    }
    66.67% {
        transform: rotate(20deg) scale(1.05);
    }
    83.33% {
        transform: rotate(-20deg) scale(1.1);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

/* Phone Icon */
.phone-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Ensure phone icon can animate on hover */
.call-button:hover .phone-icon {
    animation: ring-phone 0.6s ease-in-out;
    animation-iteration-count: 1;
}

/* Phone Number Text */
.call-button p {
    white-space: nowrap !important;
    flex-shrink: 0;
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none;
    word-break: keep-all;
    hyphens: none;
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: none;
    box-shadow: none;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1002;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--green);
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle:focus-visible {
    outline: 2px solid rgba(5, 168, 76, 0.7);
    outline-offset: 3px;
}

.nav-overlay {
    display: none;
}

body.nav-locked {
    overflow: hidden;
}

/* Responsive navigation */
@media screen and (max-width: 1100px) {
    .header-container {
        padding: 0 80px;
        gap: 12px;
        justify-content: space-between;
        /* Ensure header stays pinned on mobile */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-wrapper {
        position: fixed;
        top: 0;
        right: -320px;
        width: min(320px, 80vw);
        height: 100vh;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 18px;
        padding: 110px 28px 40px;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(25px) saturate(180%);
        -webkit-backdrop-filter: blur(25px) saturate(180%);
        box-shadow: -12px 0 30px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1001;
    }

    .nav-wrapper .nav-button,
    .nav-wrapper .call-button {
        width: 100%;
        text-align: left;
    }

    .nav-wrapper .call-button {
        justify-content: center;
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1000;
    }

    .header-container.nav-open .nav-wrapper {
        right: 0;
    }

    .header-container.nav-open .nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .header-container.nav-open .menu-toggle span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .header-container.nav-open .menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .header-container.nav-open .menu-toggle span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

@media screen and (max-width: 768px) {
    .header-container {
        padding: 0 10px;
        justify-content: space-between;
    }

    .header-container.header-hidden {
        transform: translateY(-100%) !important;
    }

    .header-container.header-visible {
        transform: translateY(0) !important;
    }
}
