/**
 * ACBAR header-top bar — contact, links, ticker, language, social, account
 */
:root {
    --acbar-top-bg: #1a2332;
    --acbar-top-bg-alt: #212b3c;
    --acbar-top-text: rgba(255, 255, 255, 0.92);
    --acbar-top-muted: rgba(255, 255, 255, 0.65);
    --acbar-top-border: rgba(255, 255, 255, 0.1);
    --acbar-top-accent: #27883b;
    --acbar-top-accent-hover: #27883b;
    --acbar-top-donate: #c2410c;
}

/* Stack header-top above nav without overlapping */
#header.header {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    z-index: 1000;
}

#header .header-nav {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    background: #fff;
}

#header .acbar-header-top {
    background: linear-gradient(
        180deg,
        var(--acbar-top-bg-alt) 0%,
        var(--acbar-top-bg) 100%
    );
    color: var(--acbar-top-text);
    text-align: start;
    width: 100%;
    overflow: visible;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    padding: 0;
    border-bottom: 1px solid var(--acbar-top-border);
}

#header .acbar-header-top.is-lang-open {
    z-index: 1100;
}

#header .acbar-header-top .header-wrap {
    padding-top: 0;
    padding-bottom: 0;
}

/* News ticker */
#header .acbar-header-top__ticker--mobile {
    display: none;
    width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid var(--acbar-top-border);
}

#header .acbar-header-top__ticker--desktop {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    padding: 0 12px;
}

#header .acbar-header-top__ticker-text {
    font-weight: 600;
    font-size: 13px;
    color: var(--acbar-top-text);
}

#header .acbar-header-top__ticker .scrolling-wrapper {
    overflow: hidden;
}

#header .acbar-header-top__ticker {
    overflow: hidden;
}

/* Main bar */
#header .acbar-header-top__bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    width: 100%;
    min-height: 44px;
}

#header .acbar-header-top__start {
    display: flex;
    align-items: center;
    gap: 12px 20px;
    flex: 0 1 auto;
    min-width: 0;
}

#header .acbar-header-top__quick-links,
#header .acbar-header-top__social,
#header .acbar-header-top__account {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#header .acbar-header-top__quick-link,
#header .acbar-header-top__account-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--acbar-top-muted);
    text-decoration: none;
    white-space: nowrap;
    padding: 6px 4px;
    border-radius: 4px;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}

#header .acbar-header-top__quick-link:hover,
#header .acbar-header-top__quick-link:focus,
#header .acbar-header-top__account-link:hover,
#header .acbar-header-top__account-link:focus {
    color: #fff;
    text-decoration: none;
}

#header .acbar-header-top__account-link i {
    font-size: 13px;
    opacity: 0.85;
}

#header .acbar-header-top__quick-link--donate {
    color: #fff;
    background: #27883b;
    border: 1px solid #27883b;
    padding: 6px 12px;
}

#header .acbar-header-top__quick-link--donate:hover,
#header .acbar-header-top__quick-link--donate:focus {
    color: #fff;
    background: #1f7331;
    border-color: #1f7331;
}

#header .acbar-header-top__end {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-inline-start: auto;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}

#header .acbar-header-top__end-scroll {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: visible;
}

/* Social */
#header .acbar-header-top__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--acbar-top-text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--acbar-top-border);
    text-decoration: none;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

#header .acbar-header-top__social-link:hover,
#header .acbar-header-top__social-link:focus {
    background: var(--acbar-top-accent);
    border-color: var(--acbar-top-accent);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

#header .acbar-header-top__social-link svg {
    display: block;
}

/* Language */
#header .acbar-header-top__lang {
    position: relative;
    flex-shrink: 0;
    z-index: 2;
}

#header .acbar-header-top__lang .acbar-lang-dropdown {
    position: relative;
    display: inline-block;
    margin: 0;
    float: none;
    vertical-align: top;
}

#header .acbar-header-top__lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: var(--acbar-top-text) !important;
    text-decoration: none !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--acbar-top-border) !important;
    border-radius: 6px !important;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

#header .acbar-header-top__lang-btn:hover,
#header .acbar-header-top__lang-btn:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.14) !important;
    text-decoration: none !important;
}

#header
    .acbar-header-top__lang
    .acbar-lang-dropdown.is-open
    .acbar-lang-dropdown__caret {
    transform: rotate(180deg);
}

#header .acbar-header-top__lang .acbar-lang-dropdown__caret {
    transition: transform 0.2s ease;
    font-size: 12px;
    opacity: 0.85;
}

#header .acbar-header-top__lang .acbar-lang-dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    inset-inline-end: auto;
    margin: 0;
    padding: 6px 0;
    min-width: 100%;
    width: max-content;
    max-width: min(220px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    list-style: none;
    text-align: start;
    z-index: 10;
}

#header .acbar-header-top__lang .acbar-lang-dropdown__menu[hidden] {
    display: none !important;
}

#header
    .acbar-header-top__lang
    .acbar-lang-dropdown.is-open
    .acbar-lang-dropdown__menu {
    display: block !important;
}

[dir="rtl"] #header .acbar-header-top__lang .acbar-lang-dropdown__menu {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

#header .acbar-header-top__lang .acbar-lang-dropdown__menu > li {
    margin: 0;
    padding: 0;
}

#header .acbar-header-top__lang .acbar-lang-dropdown__menu > li > a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b !important;
    text-decoration: none;
    white-space: nowrap;
    background: #fff;
}

#header .acbar-header-top__lang .acbar-lang-dropdown__menu > li > a:hover,
#header .acbar-header-top__lang .acbar-lang-dropdown__menu > li > a:focus {
    background: #f1f5f9 !important;
    color: #27883b !important;
}

/* Account / auth */
#header .acbar-header-top__account-link {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
}

#header .acbar-header-top__account-link:hover,
#header .acbar-header-top__account-link:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--acbar-top-border);
}

#header .acbar-header-top__account-link--register {
    color: #fff;
    /* background: var(--acbar-top-accent); */
    /* border-color: var(--acbar-top-accent); */
}

#header .acbar-header-top__account-link--register:hover,
#header .acbar-header-top__account-link--register:focus {
    /* background: var(--acbar-top-accent-hover); */
    /* border-color: var(--acbar-top-accent-hover); */
    color: #fff;
}

#header .acbar-header-top__account-link--user {
    color: #fff;
}

#header .acbar-header-top__avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

#header .acbar-header-top__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    font-size: 12px;
}

/* Tablet / mobile — single row, no wrap into nav bar */
@media (max-width: 1023px) {
    #header .acbar-header-top__ticker--desktop {
        display: none !important;
    }

    #header .acbar-header-top__ticker--mobile {
        display: block;
        margin-inline: calc(-1 * clamp(16px, 2.5vw, 48px));
        padding-inline: clamp(16px, 2.5vw, 48px);
    }

    #header .acbar-header-top .header-wrap {
        padding-inline: clamp(12px, 2.5vw, 24px);
    }

    #header .acbar-header-top__bar {
        flex-wrap: nowrap;
        align-items: center;
        gap: 12px;
        padding: 6px 0 8px;
        min-height: 40px;
        overflow: visible;
    }

    #header .acbar-header-top__start {
        width: auto;
        flex: 0 1 auto;
        min-width: 0;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 0;
    }

    #header .acbar-header-top__end {
        width: auto;
        flex: 0 0 auto;
        margin-inline-start: auto;
        overflow: visible;
    }

    #header .acbar-header-top__end-scroll {
        width: auto;
        overflow: visible;
        padding-bottom: 0;
        flex-wrap: nowrap;
    }

    #header .acbar-header-top__lang .dropdown-menu {
        z-index: 1200;
    }
}

@media (max-width: 767px) {
    #header .acbar-header-top__quick-link span {
        font-size: 12px;
    }

    #header .acbar-header-top__quick-links {
        gap: 2px 10px;
    }

    #header .acbar-header-top__social-link {
        width: 30px;
        height: 30px;
    }

    #header .acbar-header-top__lang-btn {
        padding: 5px 10px !important;
        font-size: 12px !important;
    }

    #header .acbar-header-top__account-link {
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* Desktop ticker row */
@media (min-width: 992px) {
    #header .acbar-header-top__bar--with-ticker .acbar-header-top__start {
        flex: 0 0 auto;
        max-width: 38%;
    }

    #header .acbar-header-top__bar--with-ticker .acbar-header-top__end {
        flex: 0 0 auto;
        max-width: 42%;
    }
}

@media (min-width: 1200px) {
    .alert-top-header-mobile {
        display: none !important;
    }
}

@media (max-width: 1199px) {
    .alert-top-header-desktop {
        display: none !important;
    }
}
