.home-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.home-header__logo {
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

/* Language Switcher Section */
.home-header__lang-switcher {
    position: relative;
    z-index: 100;
}

.home-header__lang-trigger {
    display: inline-flex;
    height: 34px;
    width: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: #f7f7f8;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.home-header__lang-trigger img {
    width: 36px;
    height: 24px;
    min-width: 36px;
    min-height: 24px;
    object-fit: cover;
}

.home-header__lang-trigger:hover,
.home-header__lang-switcher:hover .home-header__lang-trigger,
.home-header__lang-switcher:focus-within .home-header__lang-trigger {
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.home-header__lang-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: -5px;
    transform: translateY(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
    z-index: 100;
}

/* Pseudo-element bridge to prevent hover loss during the small gap */
.home-header__lang-dropdown::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.home-header__lang-switcher:hover .home-header__lang-dropdown,
.home-header__lang-switcher:focus-within .home-header__lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.home-header__lang-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 12px;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.home-header__lang-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 6px 4px;
    background: transparent;
    transition: transform 0.18s ease, background-color 0.18s ease;
    cursor: pointer;
    width: 100%;
}

.home-header__lang-trigger:hover,
.home-header__lang-option:hover {
    background: #1BA2DA !important;
}

.home-header__lang-option img {
    width: 36px;
    height: 24px;
    min-width: 36px;
    min-height: 24px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Nav Menu Items */
.home-header__item {
    position: relative;
}

.home-header__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    border: 0;
    background: transparent;
    color: #111111;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    transition: color 0.2s ease;
}

.home-header__link::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--aip-secondary, #1ca7e1);
    transition: width 0.3s ease-in-out;
}

.home-header__link:hover::after,
.home-header__item:hover>.home-header__link::after {
    width: 100%;
}

.home-header__link:hover,
.home-header__item:hover>.home-header__link,
.home-header__item:focus-within>.home-header__link,
.home-header__link.is-active,
.home-header__item.is-active>.home-header__link {
    color: var(--aip-secondary);
}

.home-header__link.is-active::after,
.home-header__item.is-active>.home-header__link::after {
    width: 100%;
}

.home-header__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    transform: translateY(10px);
    min-width: max-content;
    padding-top: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}

/* Bridge to prevent hover loss between link and dropdown */
.home-header__dropdown::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 30px;
    z-index: -1;
}

.home-header__item:hover .home-header__dropdown,
.home-header__item:focus-within .home-header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.home-header__dropdown-panel {
    border: 1px solid #d8dce2;
    border-radius: 20px;
    background: #ffffff;
    padding: 14px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.home-header__dropdown-group+.home-header__dropdown-group {
    margin-top: 10px;
}

.home-header__dropdown-group {
    position: relative;
}

.home-header__dropdown-link,
.home-header__sub-link {
    display: block;
    color: #111111;
    font-size: 16px;
    line-height: 1.45;
    text-decoration: none;
}

.home-header__dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 12px;
    padding: 10px 12px;
    white-space: nowrap;
    font-weight: 700;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.home-header__dropdown-link:hover,
.home-header__dropdown-link.is-active {
    background: #eef6ff;
    color: #177cff;
    transform: translateX(2px);
}

.home-header__flyout {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: max-content;
    padding-left: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}

/* Bridge to prevent hover loss between dropdown and flyout */
.home-header__flyout::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -20px;
    width: 25px;
    z-index: -1;
}

.home-header__dropdown-group.has-flyout:hover .home-header__flyout,
.home-header__dropdown-group.has-flyout:focus-within .home-header__flyout {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.home-header__flyout-panel {
    border: 1px solid #d8dce2;
    border-radius: 20px;
    background: #ffffff;
    padding: 12px 14px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.home-header__sub-link {
    border-radius: 12px;
    padding: 10px 12px;
    color: #111111;
    font-weight: 700;
    white-space: nowrap;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.home-header__sub-link+.home-header__sub-link {
    margin-top: 4px;
}

.home-header__sub-link:hover,
.home-header__sub-link.is-active {
    background: #eef6ff;
    color: #177cff;
    transform: translateX(2px);
}

.home-header__item:hover>.home-header__link svg,
.home-header__item:focus-within>.home-header__link svg,
.home-header__dropdown-group.has-flyout:hover>.home-header__dropdown-link svg,
.home-header__dropdown-group.has-flyout:focus-within>.home-header__dropdown-link svg {
    transform: translateX(1px);
}

.home-header__link svg,
.home-header__dropdown-link svg {
    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

@media (max-width: 1023px) {
    .home-header__dropdown {
        display: none !important;
    }

    .home-header__lang-trigger {
        height: 34px;
        width: 46px;
    }

    .home-header__lang-trigger img {
        width: 36px;
        height: 24px;
        min-width: 36px;
        min-height: 24px;
        object-fit: cover;
    }
}

.home-header__btn-contact {
    position: relative;
    padding: 10px 36px;
    border: 1px solid var(--aip-secondary, #1ca7e1);
    border-radius: 9999px;
    color: #111111;
    background-color: transparent;
    transition: all 0.3s ease;
    font-weight: 700;
}

.home-header__btn-contact:hover {
    background-color: #e6f0f3;
}

@media (max-width: 768px) {
    .home-header__btn-contact {
        padding: 8px 16px;
    }
}