/* TicketsFest Україна Header Component — extracted in v9.7.1 */
body { margin: 0; padding: 0; background-color: #f8fafc; min-height: 100vh; -webkit-font-smoothing: antialiased; }
    .tfe-header-wrap * { box-sizing: border-box; }

    :root {
        --h-primary:    #1d4ed8;
        --h-primary-dk: #1e40af;
        --h-text:       #0f172a;
        --h-muted:      #64748b;
        --h-bg-glass:   rgba(255,255,255,0.92);
        --h-border:     rgba(203,213,225,0.6);
        --h-light-blue: #eff6ff;
        --h-shadow:     0 4px 24px -4px rgba(15,23,42,0.10), 0 1px 4px rgba(15,23,42,0.04);
    }

    /* ─────────────────────────────────────────
     * HEADER SHELL
     * Використовуємо обгортку .tfe-header-outer
     * для sticky, а сам pill — дочірній елемент.
     * Це виправляє iOS-баг з env(safe-area-inset-top)
     * в sticky-контексті.
     * ───────────────────────────────────────── */
    .tfe-header-outer {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: calc(14px + env(safe-area-inset-top)) 3% 0;
        pointer-events: none;
    }
    .tfe-header-wrap {
        background: var(--h-bg-glass);
        /* blur(20px) було надто важким для GPU на мобільних.
           blur(8px) дає візуальний ефект без frame drops при скролі. */
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        /* will-change ізолює header у власний compositing layer,
           браузер більше не перемальовує весь документ при скролі */
        will-change: transform;
        border-radius: 60px;
        border: 1px solid var(--h-border);
        height: 68px;
        box-shadow: var(--h-shadow);
        transition: box-shadow 0.3s ease, background 0.3s ease;
        pointer-events: all;
        max-width: 1240px;
        margin: 0 auto;
    }
    .tfe-header-wrap.is-scrolled {
        box-shadow: 0 8px 32px -8px rgba(15,23,42,0.15), 0 1px 4px rgba(15,23,42,0.06);
        background: rgba(255,255,255,0.97);
    }
    .tfe-header-inner {
        width: 100%;
        height: 100%;
        padding: 0 28px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    /* ─────────────────────────────────────────
     * LOGO
     * ───────────────────────────────────────── */
    .tfe-logo {
        display: flex;
        align-items: center;
        text-decoration: none;
        z-index: 1001;
        transition: opacity 0.2s, transform 0.2s;
        flex-shrink: 0;
    }
    .tfe-logo:hover { opacity: 0.82; transform: translateY(-1px); }
    .tfe-logo img { height: 36px; width: auto; display: block; }
    .tfe-logo-text {
        font-family: 'Inter', 'DM Sans', sans-serif;
        font-weight: 900;
        font-size: 21px;
        color: var(--h-text);
        letter-spacing: -0.03em;
        white-space: nowrap;
        line-height: 1;
    }
    .tfe-logo-accent { color: var(--h-primary); }

    /* ─────────────────────────────────────────
     * DESKTOP NAV
     * ───────────────────────────────────────── */
    .tfe-nav-container { display: none; }

    @media (min-width: 1025px) {
        .tfe-nav-container {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .tfe-desktop-nav ul {
            display: flex;
            gap: 2px;
            list-style: none;
            margin: 0;
            padding: 0;
            align-items: center;
        }
        .tfe-desktop-nav a {
            text-decoration: none;
            color: var(--h-text);
            font-family: 'Inter', 'DM Sans', sans-serif;
            font-weight: 600;
            font-size: 14px;
            padding: 9px 16px;
            border-radius: 50px;
            transition: background 0.18s, color 0.18s;
            white-space: nowrap;
            display: block;
        }
        .tfe-desktop-nav a:hover {
            background: rgba(29,78,216,0.07);
            color: var(--h-primary);
        }
        .tfe-desktop-nav .current-menu-item > a,
        .tfe-desktop-nav .current-page-ancestor > a,
        .tfe-desktop-nav .current-page-item > a {
            background: var(--h-primary);
            color: #fff;
            box-shadow: 0 4px 12px rgba(29,78,216,0.25);
        }

        /* Lang switcher */
        .tfe-lang-switcher {
            display: flex;
            gap: 3px;
            background: #f1f5f9;
            padding: 4px;
            border-radius: 30px;
            flex-shrink: 0;
        }
        .tfe-lang-item {
            text-decoration: none;
            font-size: 11px;
            font-weight: 800;
            color: #64748b;
            padding: 6px 11px;
            border-radius: 20px;
            transition: background 0.18s, color 0.18s;
            letter-spacing: 0.02em;
        }
        .tfe-lang-item:hover { color: var(--h-primary); background: rgba(29,78,216,0.06); }
        .tfe-lang-item.is-active {
            background: #fff;
            color: var(--h-primary);
            box-shadow: 0 2px 6px rgba(0,0,0,0.07);
        }
    }

    /* ─────────────────────────────────────────
     * BURGER — анімація в X при відкритті
     * ───────────────────────────────────────── */
    .tfe-burger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        background: var(--h-light-blue);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
        padding: 0;
        transition: background 0.2s;
        flex-shrink: 0;
    }
    .tfe-burger:hover { background: #dbeafe; }
    .tfe-burger span {
        display: block;
        height: 2px;
        background-color: var(--h-primary);
        border-radius: 3px;
        transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
        transform-origin: center;
    }
    .tfe-burger span:nth-child(1) { width: 18px; }
    .tfe-burger span:nth-child(2) { width: 22px; }
    .tfe-burger span:nth-child(3) { width: 14px; }

    /* Анімація в X */
    .tfe-burger.is-open span:nth-child(1) { width: 20px; transform: translateY(7px) rotate(45deg); }
    .tfe-burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .tfe-burger.is-open span:nth-child(3) { width: 20px; transform: translateY(-7px) rotate(-45deg); }

    @media (min-width: 1025px) { .tfe-burger { display: none; } }

    /* ─────────────────────────────────────────
     * MOBILE OVERLAY — slide-in з правого боку
     * ───────────────────────────────────────── */
    .tfe-mobile-overlay {
        position: fixed;
        top: 0;
        right: 0;
        width: min(360px, 100%);
        height: 100dvh;
        background: #fff;
        z-index: 99998;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.35s ease, visibility 0.35s;
        display: flex;
        flex-direction: column;
        box-shadow: -20px 0 60px rgba(15,23,42,0.12);
    }
    .tfe-mobile-overlay.is-active {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        transform: translateX(0);
    }

    /* Backdrop — темна підкладка за overlay (без blur — важкий для мобільного GPU) */
    .tfe-mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,0.5);
        z-index: 99997;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s;
    }
    .tfe-mobile-backdrop.is-active {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    /* Overlay header */
    .tfe-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: calc(20px + env(safe-area-inset-top)) 24px 20px;
        border-bottom: 1px solid #f1f5f9;
        flex-shrink: 0;
    }
    .tfe-menu-title {
        font-family: 'Inter', sans-serif;
        font-weight: 900;
        font-size: 18px;
        color: var(--h-text);
        letter-spacing: -0.02em;
    }

    .tfe-mobile-lang { display: flex; gap: 6px; }
    .tfe-mobile-lang a {
        text-decoration: none;
        font-size: 12px;
        font-weight: 800;
        color: #94a3b8;
        padding: 5px 9px;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        transition: 0.18s;
        letter-spacing: 0.02em;
    }
    .tfe-mobile-lang a:hover { color: var(--h-primary); border-color: #bfdbfe; }
    .tfe-mobile-lang a.is-active {
        color: var(--h-primary);
        border-color: var(--h-primary);
        background: var(--h-light-blue);
    }

    .tfe-close-btn {
        width: 40px; height: 40px;
        background: #f1f5f9;
        border-radius: 50%;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--h-text);
        transition: background 0.2s, transform 0.2s;
        padding: 0;
        flex-shrink: 0;
        margin-left: 10px;
    }
    .tfe-close-btn:hover { background: #e2e8f0; transform: rotate(90deg); }
    .tfe-close-btn svg { width: 18px; height: 18px; }

    /* Nav list */
    .tfe-mobile-list {
        flex-grow: 1;
        overflow-y: auto;
        padding: 12px 24px;
        -webkit-overflow-scrolling: touch;
    }
    .tfe-mobile-list ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    .tfe-mobile-list li { border-bottom: 1px solid #f1f5f9; }
    .tfe-mobile-list li:last-child { border-bottom: none; }
    .tfe-mobile-list a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 18px;
        font-weight: 700;
        color: var(--h-text);
        padding: 15px 0;
        text-decoration: none;
        transition: color 0.18s, padding-left 0.18s;
    }
    .tfe-mobile-list a::after {
        content: '';
        display: block;
        width: 6px;
        height: 6px;
        border-right: 2px solid #cbd5e1;
        border-top: 2px solid #cbd5e1;
        transform: rotate(45deg);
        flex-shrink: 0;
        transition: border-color 0.18s, transform 0.18s;
        margin-right: 4px;
    }
    .tfe-mobile-list a:hover {
        color: var(--h-primary);
        padding-left: 6px;
    }
    .tfe-mobile-list a:hover::after {
        border-color: var(--h-primary);
        transform: rotate(45deg) translate(2px, -2px);
    }
    .tfe-mobile-list .current-menu-item > a { color: var(--h-primary); }

    /* Footer */
    .tfe-mobile-footer {
        padding: 20px 24px calc(24px + env(safe-area-inset-bottom));
        border-top: 1px solid #f1f5f9;
        display: flex;
        flex-direction: column;
        gap: 14px;
        flex-shrink: 0;
    }
    .tfe-social-row { display: flex; gap: 10px; }
    .tfe-social-icon {
        width: 40px; height: 40px;
        border-radius: 50%;
        background: var(--h-light-blue);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--h-primary);
        text-decoration: none;
        transition: background 0.2s, transform 0.2s, color 0.2s;
        flex-shrink: 0;
        border: 1px solid #dbeafe;
    }
    .tfe-social-icon:hover { background: var(--h-primary); color: #fff; transform: translateY(-2px); border-color: var(--h-primary); }
    .tfe-social-icon svg { width: 17px; height: 17px; }

    .tfe-contact-email {
        font-weight: 700;
        color: var(--h-primary);
        font-size: 15px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: opacity 0.2s;
    }
    .tfe-contact-email:hover { opacity: 0.75; }

    .tfe-legal-info {
        font-size: 11px;
        color: #94a3b8;
        line-height: 1.7;
    }
    .tfe-legal-name {
        font-weight: 700;
        color: #64748b;
        display: block;
        margin-bottom: 2px;
    }

    /* ─────────────────────────────────────────
     * RESPONSIVE
     * ───────────────────────────────────────── */
    @media (max-width: 768px) {
        .tfe-header-outer { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: 4%; padding-right: 4%; }
        .tfe-header-wrap  { height: 60px; }
        .tfe-header-inner { padding: 0 16px; }
        .tfe-logo img     { height: 30px; }
        .tfe-logo-text    { font-size: 19px; }
    }
    @media (max-width: 360px) {
        .tfe-mobile-overlay { width: 100%; }
    }
