/* =============================
   ХЕДЕР ALPIN WORK
   Topbar + Logo/Banner + Nav + Search + Auth
============================= */

/* Додаткові змінні до глобальних (aw-layout.css) */
:root {
    --aw-bg-deep:   #003647;   /* topbar */
    --aw-bg-header: #022F3B;   /* logo + banner */
    --aw-bg-nav:    #00323f;   /* нижнє меню */

    /* ЛОГО */
    --aw-accent-gold: #E5C46A; /* ALPIN – м’яке золото */
    --aw-color-work:  #E8F4F5; /* WORK – майже білий з легким бірюзовим */

    /* МЕНЮ / КНОПКИ */
    --aw-color-menu-active: #CDAF54;  /* Активні пункти меню – глибоке золото */
    --aw-color-search-btn:  #000000;  /* Кнопка пошуку */

    --aw-text-light: #FFFFFF;
    --aw-text-muted: #c2d3dc;
}

/* ============================
   TOPBAR
============================ */

.aw-topbar {
    background: var(--aw-bg-deep);
    color: var(--aw-text-light);
    font-size: .85rem;
}

/* Внутрішній рядок topbar сидить у .aw-container */
.aw-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .4rem 0;     /* тільки вертикальний відступ, горизонтальний дає .aw-container */
    flex-wrap: wrap;
}

.aw-topbar-left {
    display: flex;
    align-items: center;
    gap: .8rem;
    flex-wrap: wrap;
}

.aw-topbar-left span {
    color: var(--aw-text-muted);
}

.aw-topbar-left a {
    color: var(--aw-text-light);
    text-decoration: none;
    white-space: nowrap;
    opacity: .9;
    transition: opacity .15s ease;
}

.aw-topbar-left a:hover {
    opacity: 1;
}

.aw-topbar-sep {
    width: 1px;
    height: 0.9rem;
    background: rgba(255,255,255,.25);
}

.aw-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Соцмережі в topbar */

.aw-header-socials {
    display: flex;
    flex-direction: row;
    gap: .4rem;
}

.aw-header-socials a {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aw-text-light);
    text-decoration: none;
    font-size: .7rem;
    border: 1px solid rgba(255,255,255,.18);
    transition:
        background .15s ease,
        transform .15s ease,
        opacity .15s ease;
    opacity: .9;
}

.aw-header-socials a:hover {
    background: var(--aw-color-menu-active);
    transform: translateY(-1px);
    opacity: 1;
}

/* ============================
   БЛОК АВТОРИЗАЦІЇ (DESKTOP, у TOPBAR)
============================ */

.aw-auth-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.aw-auth-main {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--aw-text-light);
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.aw-auth-main i {
    font-size: 0.9rem;
}

.aw-auth-main:hover {
    background: rgba(0, 0, 0, 0.34);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    opacity: 1;
}

.aw-auth-logout {
    font-size: 0.8rem;
    color: var(--aw-text-muted);
    text-decoration: none;
    white-space: nowrap;
    opacity: 0.85;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.aw-auth-logout:hover {
    opacity: 1;
    color: var(--aw-color-work);
}

/* ============================
   ЛОГО + БАНЕР
============================ */

.aw-header-main {
    background: var(--aw-bg-header);
    padding: 0.5rem 0 0.7rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Внутрішній блок у .aw-container */
.aw-header-main-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

/* ЛОГО */

.aw-logo-block {
    display: inline-flex;
    flex-direction: column;
    gap: .25rem;
    text-decoration: none;
}

.aw-logo-line {
    display: flex;
    align-items: baseline;
    gap: .55rem;
}

.aw-logo-alpin,
.aw-logo-work {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.aw-logo-alpin {
    color: var(--aw-accent-gold);
}

.aw-logo-work {
    color: var(--aw-color-work);
    font-weight: 600;
}

.aw-logo-underline {
    width: 92%;
    height: 3px;
    background: #CDAF54;
    border-radius: 999px;
}

/* БАНЕР */

.aw-header-banner {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: transparent;
    overflow: visible;
}

.aw-header-banner img {
    display: block;
    max-height: 70px;
    height: auto;
    width: auto;
    border-radius: .7rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.30);
}

@media (min-width: 1200px) {
    .aw-header-banner img {
        max-height: 80px;
    }
}

@media (max-width: 768px) {
    .aw-header-banner {
        justify-content: center;
    }
    .aw-header-banner img {
        max-height: 60px;
    }
}

/* ============================
   ГОЛОВНЕ МЕНЮ – STICKY
============================ */

.aw-main-nav {
    background: var(--aw-bg-nav);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    position: sticky;
    top: 0;
    z-index: 1100;
    transition:
        background-color .25s ease,
        box-shadow .25s ease;
}

/* Внутрішній рядок меню у .aw-container */
.aw-main-nav-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.3rem 0; /* тільки вертикаль, горизонталь дає .aw-container */
}

.aw-main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2.4rem;
    flex: 1 1 auto;
    text-transform: uppercase;
    font-size: .95rem;
    letter-spacing: .08em;
}

.aw-main-menu .menu-item {
    position: relative;
    display: flex;
    align-items: center;
}

.aw-main-menu .menu-item > a {
    color: var(--aw-text-light);
    text-decoration: none;
    white-space: nowrap;
    padding: .55rem 0 .4rem;
    transition: color .15s ease;
}

.aw-main-menu .menu-item > a:hover {
    color: #E5D6A0;
}

/* Активний пункт */

.aw-main-menu .menu-item.active > a {
    color: var(--aw-color-menu-active);
    font-weight: 600;
}

.aw-main-menu .menu-item.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 80%;
    border-radius: 999px;
    background: var(--aw-color-menu-active);
}

.aw-menu-caret {
    margin-left: .25rem;
    font-size: .8rem;
    color: var(--aw-color-menu-active);
}

/* Трохи компактніше меню на 993–1180px, щоб усе влазило */
@media (min-width: 993px) and (max-width: 1180px) {
    .aw-main-menu {
        gap: 1.6rem;
        font-size: .9rem;
    }
}

/* Додаткове "повітря" по боках на 993–1200px (включно з ~1080px) */
@media (min-width: 993px) and (max-width: 1200px) {
    .aw-topbar-inner,
    .aw-header-main-inner,
    .aw-main-nav-inner {
        padding-inline: var(--aw-page-gutter, 16px);
    }
}

/* ============================
   БУРГЕР (FA-ІКОНКА)
============================ */

.aw-nav-toggle {
    display: none; /* показуємо тільки в @media */
    border: none;
    background: rgba(0, 0, 0, 0.22);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.15),
        0 6px 14px rgba(0,0,0,0.45);
    padding: 0;
    position: relative;
    z-index: 1200;
}

.aw-nav-toggle:hover {
    background: rgba(0, 0, 0, 0.32);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.2),
        0 8px 18px rgba(0,0,0,0.55);
}

.aw-nav-toggle:focus-visible {
    outline: 2px solid #E5C46A;
    outline-offset: 2px;
}

.aw-nav-toggle i {
    font-size: 1rem;
}

/* ============================
   ДРОПДАУН (DESKTOP)
============================ */

.aw-main-menu .has-dropdown {
    position: relative;
}

.aw-main-menu .has-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
    background: transparent;
    pointer-events: auto;
}

/* панель */

.aw-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: .1rem;
    background: rgba(3, 28, 38, 0.88);
    border-radius: 14px;
    padding: .35rem 0;
    min-width: 260px;
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04);
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transform-origin: top left;
    pointer-events: none;
    transition:
        opacity .16s ease-out,
        transform .16s ease-out;
    z-index: 50;
}

@media (min-width: 993px) {
    .aw-main-menu .has-dropdown:hover > .aw-dropdown,
    .aw-main-menu .has-dropdown:focus-within > .aw-dropdown,
    .aw-main-menu .has-dropdown > .aw-dropdown:hover {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }
}

.aw-dropdown a {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem 1rem .45rem 1.2rem;
    font-size: .9rem;
    color: var(--aw-text-light);
    text-decoration: none;
    opacity: .9;
    transition:
        background .12s ease,
        opacity .12s ease,
        transform .12s ease;
}

.aw-dropdown a:hover {
    background: rgba(255, 255, 255, 0.06);
    opacity: 1;
    transform: translateX(2px);
}

/* ============================
   ПОШУК
============================ */

/* елемент меню з пошуком — тиснемо його вправо, але дозволяємо стискатись */
.aw-main-menu .aw-mobile-search-item {
    margin-left: auto;
    display: flex;
    align-items: stretch;
    flex: 0 1 260px;        /* базова ширина, але можна стискати */
}

/* форма пошуку — головне: min-width:0 */
.aw-header-search {
    display: flex;
    align-items: stretch;
    background: #022834;
    border-radius: .35rem;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.aw-header-search input {
    border: none;
    outline: none;
    padding: .55rem .75rem;
    flex: 1 1 auto;
    background: transparent;
    color: var(--aw-text-light);
    font-size: .9rem;
}

.aw-header-search input::placeholder {
    color: rgba(255,255,255,.55);
}

.aw-header-search button {
    border: none;
    padding: 0 .9rem;
    background: var(--aw-color-search-btn);
    cursor: pointer;
    font-size: 1.1rem;
    color: #fff;
}

/* ============================
   МАЛИЙ ЛОГОТИП (МОБІЛКА)
============================ */

.aw-nav-mobile-brand {
    display: none;
    align-items: center;
    margin-right: .5rem;
}

.aw-nav-mobile-brand a {
    display: inline-flex;
    align-items: baseline;
    gap: .25rem;
    text-decoration: none;
}

.aw-nav-mobile-alpin,
.aw-nav-mobile-work {
    font-size: 1.1rem;
    letter-spacing: .14em;
    font-weight: 700;
    text-transform: uppercase;
}

.aw-nav-mobile-alpin {
    color: var(--aw-accent-gold);
}

.aw-nav-mobile-work {
    color: var(--aw-text-light);
    font-weight: 600;
}

/* ============================
   МОБІЛЬНА АВТОРИЗАЦІЯ (біля лого)
============================ */

.aw-nav-auth-mobile {
    display: none;
}

@media (max-width: 992px) {
    .aw-nav-auth-mobile {
        display: inline-flex;
        align-items: center;
        margin-right: 0.35rem;
    }

    .aw-nav-auth-mobile a {
        width: 34px;
        height: 34px;
        border-radius: 999px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--aw-text-light);
        background: rgba(0, 0, 0, 0.26);
        border: 1px solid rgba(255, 255, 255, 0.22);
        box-shadow:
            0 0 0 1px rgba(0,0,0,0.3),
            0 4px 10px rgba(0,0,0,0.45);
        transition:
            background 0.15s ease,
            transform 0.15s ease,
            box-shadow 0.15s ease,
            opacity 0.15s ease;
    }

    .aw-nav-auth-mobile a:hover {
        background: rgba(0, 0, 0, 0.36);
        transform: translateY(-1px);
        box-shadow:
            0 0 0 1px rgba(0,0,0,0.4),
            0 6px 14px rgba(0,0,0,0.6);
    }

    .aw-nav-auth-mobile i {
        font-size: 1rem;
        line-height: 1;
    }
}

/* ============================
   АДАПТИВ (МОБІЛКА) — НАВІГАЦІЯ
============================ */

@media (max-width: 992px) {

    /* ховаємо topbar і великий хедер */
    .aw-topbar,
    .aw-header-main {
        display: none;
    }

    /* даємо повітря по боках шапці, як у основних блоків */
    .aw-main-nav {
        padding-inline: var(--aw-page-gutter, 12px);
    }

    /* верхній рядок: логотип + auth + бургер */
    .aw-main-nav-inner {
        padding: .4rem 0 .5rem;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: .5rem;
    }

    .aw-nav-mobile-brand {
        display: inline-flex;
        align-items: center;
        margin-right: auto;
    }

    .aw-nav-mobile-alpin,
    .aw-nav-mobile-work {
        font-size: 1.05rem;
        letter-spacing: .14em;
        font-weight: 700;
        text-transform: uppercase;
    }

    .aw-nav-mobile-alpin {
        color: var(--aw-accent-gold);
    }

    .aw-nav-mobile-work {
        color: var(--aw-text-light);
        font-weight: 600;
    }

    /* бургер тільки на мобілці */
    .aw-nav-toggle {
        display: inline-flex;
        margin-right: 0;
    }

    /* меню-картка на новому рядку, 100% ширини */
    .aw-main-menu {
        display: none;
        flex: 0 0 100%;
        flex-direction: column;
        width: 100%;
        gap: 0.1rem;
        margin: 0;
        margin-top: .25rem;
        background: rgba(2, 40, 52, 0.96);
        border-radius: .75rem;
        padding: .25rem .75rem .4rem;
    }

    .aw-main-nav.aw-main-nav--mobile-open .aw-main-menu {
        display: flex;
    }

    .aw-main-menu .menu-item {
        width: 100%;
        justify-content: flex-start;
    }

    .aw-main-menu .menu-item > a {
        padding: .22rem 0;
        width: 100%;
        font-size: .9rem;
        line-height: 1.3;
    }

    /* дропдауни як акордеон */

    .aw-main-menu .has-dropdown {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .aw-main-menu .has-dropdown > a {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .aw-dropdown {
        position: static;
        margin-top: .05rem;
        background: rgba(0, 24, 33, 0.9);
        border-radius: .55rem;
        box-shadow: none;
        padding: .15rem 0;
        min-width: 0;
        max-height: 0;
        opacity: 0;
        transform: translateY(-4px);
        overflow: hidden;
        pointer-events: none;
        transition:
            max-height .24s ease,
            opacity .2s ease,
            transform .2s ease;
    }

    .aw-main-menu .has-dropdown.aw-dropdown-open > .aw-dropdown {
        max-height: 320px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .aw-dropdown a {
        padding: .18rem .2rem;
        font-size: .82rem;
        opacity: .9;
        transform: none;
    }

    .aw-main-menu .has-dropdown.aw-dropdown-open .aw-menu-caret {
        transform: rotate(180deg);
    }

    /* пошук внизу меню, на всю ширину */
    .aw-main-menu .aw-mobile-search-item {
        margin-left: 0;
        flex: 0 0 auto;
    }

    .aw-header-search {
        display: none;
        margin-top: .35rem;
        width: 100%;
        min-width: 0;
        background: #011b24;
    }

    .aw-main-menu .aw-mobile-search-item .aw-header-search {
        display: flex;
        width: 100%;
    }

    .aw-main-menu .aw-mobile-search-item {
        margin-top: .2rem;
    }
}

/* ============================
   Домик "Головна" в меню
============================ */

.aw-menu-home .aw-nav-home {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline: 0.75rem;
}

.aw-menu-home .aw-nav-home i {
    font-size: 18px;
    line-height: 1;
}

.aw-main-menu .menu-item.aw-menu-home.active .aw-nav-home i {
    color: var(--aw-color-menu-active, #CDAF54);
}

.aw-main-menu .menu-item.aw-menu-home .aw-nav-home:hover i {
    color: var(--aw-color-menu-active, #CDAF54);
}

/* Прихований текст для доступності */
.aw-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
