/* ═══ NIO Hero Slider ═══════════════════════════════════════ */

.nio-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #000;
    cursor: grab;                    /* курсор-рука, як у NIO Models */
    -webkit-user-select: none; user-select: none;
    /* Шрифт навмисно не задано тут — успадковується від глобального шрифту Elementor (Onest) */
}
.nio-hero.is-grabbing { cursor: grabbing; }

/* ── Слайди ── */
.nio-hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .9s ease;
    pointer-events: none;
}
.nio-hero__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.nio-hero__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Постер як фон (адаптивний) — показується, поки відео не відмалює перший кадр */
    background-image: var(--poster-d);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #000;
}
@media (max-width: 1024px) {
    .nio-hero__video { background-image: var(--poster-m, var(--poster-d)); }
}

/* ── Нижний блок: лого/текст/кнопка + табы в одном flex-столбце ── */
.nio-hero__bottom {
    position: absolute;
    left: 80px;                      /* відступ донора */
    right: auto;
    bottom: 50px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 560px;
}

/* контент (лого/текст/кнопка) — стопка для кросс-фейда */
.nio-hero__contents {
    position: relative;
    width: 100%;
}
.nio-hero__content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    color: #fff;
    pointer-events: none;
}
.nio-hero__content--dark { color: #111; }

/* Назва моделі текстом (запасний варіант) */
.nio-hero__title {
    margin: 0 0 18px;
    font-size: clamp(30px, 3vw, 46px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: .01em;
    color: inherit;
}

/* Назва моделі зображенням / SVG — як на nio.com */
.nio-hero__title-img {
    display: block;
    width: auto !important;
    height: clamp(48px, 5vw, 72px) !important;  /* десктоп/планшет: не більше 72px */
    max-width: min(80vw, 460px);
    margin: 0 0 18px;
    object-fit: contain;
}

.nio-hero__subtitle {
    margin: 0;
    font-size: clamp(13px, 1vw, 15px);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: .02em;
    color: inherit;
    opacity: .92;
}

/* Лёгкий подъём текста при активации слайда (кросс-фейд между слайдами) */
.nio-hero__content {
    transform: translateY(16px);
    opacity: 0;
    transition: opacity .9s ease .25s, transform .9s ease .25s;
}
.nio-hero__content.is-active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ── Кнопки ── */
.nio-hero__btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 28px;                /* відступ над кнопкою (керується контролом) */
}

.nio-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;                    /* точні розміри донора */
    padding: 0 14px;
    font-size: 12px;
    font-weight: 400;
    line-height: 17px;
    letter-spacing: normal;
    text-decoration: none;
    border-radius: 0;                /* без закруглень — як на nio.com */
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
    cursor: pointer;
}

/* На темному відео (світлий текст): прозора з рамкою → заливка при наведенні */
.nio-hero__btn--solid,
.nio-hero__btn--ghost {
    background: transparent;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, .65);
}
.nio-hero__btn--solid:hover,
.nio-hero__btn--ghost:hover {
    background: #fff;
    color: #111 !important;
    border-color: #fff;
}

/* На світлому відео (темний текст) */
.nio-hero__content--dark .nio-hero__btn--solid,
.nio-hero__content--dark .nio-hero__btn--ghost {
    color: #111 !important;
    border-color: rgba(0, 0, 0, .55);
}
.nio-hero__content--dark .nio-hero__btn--solid:hover,
.nio-hero__content--dark .nio-hero__btn--ghost:hover {
    background: #111;
    color: #fff !important;
    border-color: #111;
}

/* ── Прогрес-бари: в потоке под контентом (часть нижнего блока) ── */
.nio-hero__nav {
    position: static;
    margin-top: 40px;                /* відступ над табами (керується контролом) */
    display: flex;
    gap: 8px;
}

.nio-hero__bar {
    position: relative;
    width: 28px;
    height: 2px;
    padding: 10px 0;          /* увеличенная зона клика */
    background: none;
    border: none;
    cursor: pointer;
    box-sizing: content-box;
}
.nio-hero__bar::before {
    content: '';
    position: absolute;
    left: 0; top: 10px;
    width: 100%; height: 2px;
    background: rgba(255,255,255,.35);
    border-radius: 2px;
}

.nio-hero__bar-fill {
    position: absolute;
    left: 0; top: 10px;
    width: 0; height: 2px;
    background: #fff;
    border-radius: 2px;
    z-index: 1;
}
.nio-hero__bar.is-active .nio-hero__bar-fill { width: 100%; }

/* Анимация заполнения при автоплее (длительность задаёт JS) */
.nio-hero--autoplay .nio-hero__bar.is-active .nio-hero__bar-fill {
    width: 0;
    animation: nioHeroFill linear forwards;
    animation-duration: var(--nio-hero-ms, 8000ms);
}
@keyframes nioHeroFill { from { width: 0; } to { width: 100%; } }

/* ── Планшет ── */
@media (max-width: 1024px) {
    .nio-hero__bottom { left: 16px; }
    /* висота назв ≤ 72px — успадковується від десктопного правила */
}

/* ── Мобільна версія ── */
@media (max-width: 767px) {
    .nio-hero__bottom {
        left: 8px;
        right: 8px;
        max-width: none;
    }
    /* кнопка лишається компактною (як на доноре), не на всю ширину */
    .nio-hero__title-img { height: clamp(40px, 9vw, 56px) !important; }  /* моб: не більше 56px */
    .nio-hero__bar { width: 24px; }
}
