/* HEADER 浮動圓角白色導覽列 */
#header {
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 15px 20px;
}

#header .navbar {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 4.5rem;
    padding: 8px 20px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(13, 59, 92, .12);
}

#header .brand {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

#header .brand img {
    width: auto;
    height: 100%;
    max-width: 230px;
    display: block;
    object-fit: contain;
    object-position: left center;
}

#header .navbar__collapse {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 導覽連結 */
#header .navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#header .nav-link {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    color: #232222;
    font-size: 17px;
    white-space: nowrap;
    text-decoration: none;
    transition: all .3s ease;
}

#header .nav-link:hover,
#header .nav-link.active {
    color: #239fd9;
    background: transparent;
}

/* CTA 按鈕 */
#header .cta-segment {
    display: flex;
    align-items: center;
    gap: 8px;
}

#header .cta {
    padding: 10px 20px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    transition: all .3s ease;
}

#header .cta-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: linear-gradient(90deg, #a6f7c0, #5fbfe8);
    background-origin: border-box;
}

#header .cta-apply svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

#header .cta-login {
    color: #239fd9;
    background: #fff;
}

#header .cta:hover {
    color: #1a84bd;
    background: #dff3ec;
}

/* 漢堡按鈕 */
#header .navbar__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 0;
    background: transparent;
}

#header .navbar__toggle span {
    display: block;
    height: 2px;
    background: linear-gradient(90deg, #a6f7c0, #5fbfe8);
    transition: transform .3s ease, opacity .3s ease;
}

#header .navbar__toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#header .navbar__toggle.is-open span:nth-child(2) {
    opacity: 0;
}

#header .navbar__toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* WhatsApp 浮動圖示 */
.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 30px;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: #fff;
    background: #25d366;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    transition: transform .3s ease, box-shadow .3s ease;
}

.whatsapp-float::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25d366;
    animation: whatsapp-pulse 2s ease-out infinite;
    z-index: -1;
}

.whatsapp-float:hover {
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

@keyframes whatsapp-pulse {
    0% { transform: scale(1); opacity: .5; }
    100% { transform: scale(1.6); opacity: 0; }
}

@media (max-width: 1399px) {
    #header .nav-link {
        font-size: 16px;
        padding: 8px 8px;
    }

    #header .cta {
        padding: 8px 14px;
        font-size: 15px;
    }
}

@media (max-width: 1279px) {
    #header .navbar__toggle {
        display: flex;
    }

    #header .brand img {
        max-width: 10rem;
    }

    #header .navbar__collapse {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 4px 16px rgba(13, 59, 92, .12);
    }

    #header .navbar__collapse.is-open {
        display: flex;
    }

    #header .navbar-nav {
        flex-direction: column;
        align-items: stretch;
    }

    #header .nav-link {
        font-size: 18px;
        padding: 10px;
    }

    #header .cta-segment {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 576px) {
    .whatsapp-float {
        right: 16px;
        bottom: 20px;
        width: 52px;
        height: 52px;
    }

    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}
