/* =============================================
   FILE: assets/css/header.css
   ART-FOCUS STUDIO — artfocus-theme
   ============================================= */

/* =============================================
   RESET (scoped)
   ============================================= */
#artf-masthead *,
#artf-masthead *::before,
#artf-masthead *::after { box-sizing: border-box; }

#artf-masthead ul,
#artf-masthead li  { list-style: none !important; margin: 0 !important; padding: 0 !important; }
#artf-masthead li::before { content: none !important; }
#artf-masthead a   { text-decoration: none !important; }

/* =============================================
   HEADER SHELL
   ============================================= */
#artf-masthead {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9000;
    pointer-events: none;
    contain: layout style;
}

/* =============================================
   CONTAINER
   ============================================= */
.artf-container {
    padding: 0 40px;
}

@media (max-width: 1199px) {
    .artf-container { padding: 0; }
}

/* =============================================
   ROW (скляна капсула)
   ============================================= */
.artf-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 24px;
    margin-top: 10px;
    background: rgba(15, 15, 15, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    pointer-events: auto;
    transition: background 0.3s ease, border-color 0.3s ease, margin-top 0.3s ease;
    contain: layout style;
}

.artf-row.is-scrolled {
    margin-top: 4px;
    background: rgba(8, 8, 8, 0.94);
    border-color: rgba(255, 255, 255, 0.09);
}

/* =============================================
   ЛОГОТИП
   ============================================= */
.artf-logo {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.artf-logo-main {
    font-family: 'Unbounded', sans-serif;
    font-weight: 900;
    font-size: 22px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    letter-spacing: 1px;
    white-space: nowrap;
}

.artf-logo-sub {
    font-family: 'Unbounded', sans-serif;
    font-size: 7px;
    letter-spacing: 1.6px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    white-space: nowrap;
}

.artf-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
    line-height: 0;
}

@media (max-width: 768px) {
    .artf-logo-main { font-size: 18px; }
    .artf-logo-sub  { font-size: 6.5px; }
    .artf-icon      { padding: 0 4px; }
    .artf-icon svg  {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        max-width: 18px !important;
    }
}

/* =============================================
   ДЕСКТОП (≥ 1200px)
   ============================================= */
@media (min-width: 1200px) {
    .artf-burger     { display: none !important; }
    .artf-overlay    { display: none !important; }
    .artf-phone-desk { display: inline-flex !important; }
    .artf-mob-phone  { display: none !important; }

    /* Canvas — стандартний flex рядок */
    .artf-canvas {
        display: flex !important;
        align-items: center;
        background: none !important;
        position: static !important;
        transform: none !important;
        visibility: visible !important;
        padding: 0 !important;
        height: auto !important;
        width: auto !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
    }
    .artf-canvas-header { display: none !important; }
    .artf-close         { display: none !important; }

    .artf-menu-scroll {
        overflow: visible !important;
        padding: 0 !important;
        flex: none !important;
    }

    /* Горизонтальне меню */
    .artf-menu {
        display: flex !important;
        flex-direction: row !important;
        gap: 2px;
        align-items: center;
    }

    .artf-menu > li > a {
        font-family: 'Unbounded', var(--font-heading);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.82) !important;
        padding: 8px 13px;
        border-radius: 8px;
        display: block;
        white-space: nowrap;
        transition: color 0.18s, background 0.18s;
        line-height: 1;
    }

    .artf-menu > li > a:hover {
        color: #fff !important;
        background: rgba(255, 255, 255, 0.08);
    }

    .artf-menu li { position: relative; }

    /* Dropdown */
    .artf-menu .sub-menu {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        transform: translateY(6px);
        background: rgba(10, 10, 10, 0.98);
        min-width: 290px;
        padding: 8px !important;
        border-radius: 14px;
        opacity: 0;
        visibility: hidden;
        border: 1px solid rgba(255, 255, 255, 0.09);
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.6);
        pointer-events: none;
        z-index: 10000;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    }

    /* Прозорий bridge щоб не зникало при переміщенні мишки */
    .artf-menu .sub-menu::before {
        content: "";
        position: absolute;
        top: -18px;
        left: 0;
        width: 100%;
        height: 18px;
        background: transparent;
    }

    .artf-menu li:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
        transition-delay: 0s;
    }

    .artf-menu .sub-menu li a {
        display: block;
        font-family: 'Unbounded', var(--font-heading);
        font-size: 11.5px !important;
        font-weight: 500 !important;
        text-transform: none !important;
        padding: 10px 14px !important;
        color: rgba(255, 255, 255, 0.72) !important;
        border-radius: 8px;
        line-height: 1.45;
        border: none !important;
        transition: background 0.15s, color 0.15s;
    }

    .artf-menu .sub-menu li + li {
        border-top: 1px solid rgba(255, 255, 255, 0.055) !important;
    }

    .artf-menu .sub-menu li a:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        color: #fff !important;
    }
}

/* =============================================
   ТЕЛЕФОН — ДЕСКТОП
   ============================================= */
.artf-phone-desk {
    display: none;
    font-family: 'Unbounded', var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    color: #fff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    padding: 10px 17px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.artf-phone-desk:hover {
    background: #fff;
    color: #000 !important;
    border-color: #fff;
}

/* =============================================
   МОБІЛЬНЕ МЕНЮ (≤ 1199px)
   ============================================= */
@media (max-width: 1199px) {

    .artf-row {
        padding: 10px 16px;
        margin: 8px 12px 0;
        border-radius: 14px;
    }

    .artf-phone-desk { display: none !important; }

    /* --- Бургер --- */
    .artf-burger {
        position: relative;
        width: 32px;
        height: 22px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
        flex-shrink: 0;
        z-index: 9001;
    }

    .artf-burger span {
        display: block;
        width: 100%;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transform-origin: center;
        transition:
            transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
            opacity   0.25s ease,
            width     0.3s ease;
    }

    .artf-burger .artf-b2 {
        width: 70%;
        margin-left: auto;
    }

    .artf-burger.is-active .artf-b1 {
        transform: translateY(10px) rotate(45deg);
        width: 100%;
    }
    .artf-burger.is-active .artf-b2 {
        opacity: 0;
        transform: scaleX(0);
    }
    .artf-burger.is-active .artf-b3 {
        transform: translateY(-10px) rotate(-45deg);
        width: 100%;
    }

    /* --- Overlay --- */
    .artf-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0);
        z-index: 9998;
        pointer-events: none;
        transition: background 0.35s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .artf-overlay.is-open {
        background: rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }

    /* --- Canvas (повноекранне меню) --- */
    .artf-canvas {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        background: #080808 !important;
        z-index: 9999 !important;
        transform: translateX(100%) !important;
        visibility: hidden !important;
        transition:
            transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0s linear 0.38s !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        overflow: hidden !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .artf-canvas.is-open {
        transform: translateX(0) !important;
        visibility: visible !important;
        transition:
            transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0s !important;
    }

    /* --- Canvas header (рядок з хрестиком) --- */
    .artf-canvas-header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        padding: 16px 20px !important;
        flex-shrink: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    /* --- Кнопка закриття --- */
    .artf-close {
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: rgba(255, 255, 255, 0.5) !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 12px !important;
        cursor: pointer !important;
        transition: color 0.2s, background 0.2s, border-color 0.2s !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
    }

    .artf-close:hover,
    .artf-close:active {
        color: #fff !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
    }

    /* Блокування scroll body */
    body.artf-locked {
        overflow: hidden !important;
        touch-action: none;
    }

    /* --- Scroll area --- */
    .artf-menu-scroll {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        scrollbar-width: none !important;
        padding: 8px 0 !important;
    }
    .artf-menu-scroll::-webkit-scrollbar { display: none; }

    /* --- Меню список --- */
    .artf-menu {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        align-items: stretch !important;
        gap: 0 !important;
    }

    /* --- Пункт верхнього рівня --- */
    .artf-menu > li {
        width: 100% !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        position: relative !important;
    }
    .artf-menu > li:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    .artf-menu > li > a {
        font-family: 'Unbounded', var(--font-heading) !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        letter-spacing: 1.2px !important;
        text-transform: uppercase !important;
        padding: 0 52px !important;
        height: 60px !important;
        color: rgba(255, 255, 255, 0.88) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        background: transparent !important;
        transition: color 0.18s, background 0.18s !important;
        width: 100% !important;
        box-sizing: border-box !important;
        position: relative !important;
    }

    .artf-menu > li > a:hover,
    .artf-menu > li > a:active {
        color: #fff !important;
        background: rgba(255, 255, 255, 0.03) !important;
    }

    /* Стрілка accordion */
    .artf-menu > li.menu-item-has-children > a::after {
        content: '' !important;
        position: absolute !important;
        right: 20px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 22px !important;
        height: 22px !important;
        background-image: url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 22 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 9l4 4 4-4' stroke='rgba(255,255,255,0.3)' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .artf-menu > li.menu-item-has-children.is-sub-open > a::after {
        transform: translateY(-50%) rotate(180deg) !important;
    }

    /* --- Підменю accordion --- */
    .artf-menu .sub-menu {
        display: block !important;
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: rgba(255, 255, 255, 0.02) !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        min-width: unset !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding: 0 !important;
        pointer-events: none !important;
    }

    .artf-menu li.is-sub-open > .sub-menu {
        max-height: 800px !important;
        pointer-events: auto !important;
    }

    .artf-menu .sub-menu li {
        border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
        border-bottom: none !important;
    }

    .artf-menu .sub-menu li a {
        font-family: 'Unbounded', var(--font-heading) !important;
        font-size: 10.5px !important;
        font-weight: 500 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.8px !important;
        height: 48px !important;
        padding: 0 24px 0 40px !important;
        color: rgba(255, 255, 255, 0.4) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        background: transparent !important;
        border: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        transition: color 0.18s, background 0.18s !important;
        gap: 10px !important;
    }

    .artf-menu .sub-menu li a::before {
        content: '—' !important;
        color: rgba(200, 169, 110, 0.4) !important;
        font-size: 9px !important;
        flex-shrink: 0 !important;
    }

    .artf-menu .sub-menu li a:hover,
    .artf-menu .sub-menu li a:active {
        color: rgba(255, 255, 255, 0.85) !important;
        background: rgba(255, 255, 255, 0.03) !important;
    }

    /* --- Телефон внизу мобільного меню --- */
    .artf-mob-phone {
        flex-shrink: 0 !important;
        padding: 16px 20px !important;
        padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px)) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
        background: #080808 !important;
    }

    .artf-mob-phone a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 54px !important;
        font-family: 'Unbounded', var(--font-heading) !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        letter-spacing: 0.3px !important;
        color: #fff !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
        transition: border-color 0.2s, background 0.2s !important;
    }

    .artf-mob-phone a:hover,
    .artf-mob-phone a:active {
        border-color: rgba(255, 255, 255, 0.45) !important;
        background: rgba(255, 255, 255, 0.08) !important;
    }

}