
/* ═══════════════════════════════════════════════════════════════
   HERO SLIDER — banner slideshow tự chuyển (kiểu ms-slide)
   Crossfade + Ken Burns, chữ trượt vào, mũi tên, chấm, thanh tiến độ.
   Biến tuỳ chỉnh (đặt trên .hs):
     --hs-top       : khoảng chừa cho header cố định (mặc định 88px)
     --hs-duration  : thời gian mỗi slide (JS tự đặt từ data-autoplay)
   ═══════════════════════════════════════════════════════════════ */
.hs {
    --hs-top: 88px;
    --hs-duration: 6000ms;
    position: relative;
    width: 100%;
    height: clamp(480px, 82vh, 780px);
    overflow: hidden;
    background: #0b1623;
    color: #fff;
    isolation: isolate;
    touch-action: pan-y;
}
.hs:focus-visible {
    outline: 3px solid var(--accent-alt, #ffb703);
    outline-offset: -3px;
}

/* ── Slide ───────────────────────────────────────────────────── */
.hs-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    transition:
        opacity 1.1s ease,
        visibility 0s linear 1.1s;
}
.hs-slide.is-leaving {
    z-index: 1;
}
.hs-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    transition:
        opacity 1.1s ease,
        visibility 0s;
}
.hs-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transform: scale(1.04);
}
/* Ken Burns: slide lẻ zoom vào, slide chẵn zoom ra (giữ nguyên khi đang mờ dần) */
.hs-slide.is-active img,
.hs-slide.is-leaving img {
    animation: hs-zoom-in calc(var(--hs-duration) + 1200ms) ease-out both;
}
.hs-slide:nth-child(even).is-active img,
.hs-slide:nth-child(even).is-leaving img {
    animation-name: hs-zoom-out;
}
@keyframes hs-zoom-in {
    from {
        transform: scale(1.04) translate3d(0, 0, 0);
    }
    to {
        transform: scale(1.16) translate3d(-1.6%, -1%, 0);
    }
}
@keyframes hs-zoom-out {
    from {
        transform: scale(1.16) translate3d(1.6%, 1%, 0);
    }
    to {
        transform: scale(1.04) translate3d(0, 0, 0);
    }
}

.hs-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(10, 22, 38, 0.9) 0%,
            rgba(10, 22, 38, 0.58) 46%,
            rgba(10, 22, 38, 0.12) 100%
        ),
        linear-gradient(to top, rgba(10, 22, 38, 0.65), transparent 38%);
}

/* ── Nội dung chữ ────────────────────────────────────────────── */
.hs-caption {
    position: relative;
    z-index: 2;
    height: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: var(--hs-top) 1.5rem 5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
.hs-caption > * {
    max-width: 42rem;
}
.hs-slide.is-active .hs-caption > *,
.hs-slide.is-leaving .hs-caption > * {
    animation: hs-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hs-slide.is-active .hs-eyebrow,
.hs-slide.is-leaving .hs-eyebrow {
    animation-delay: 0.3s;
}
.hs-slide.is-active .hs-title,
.hs-slide.is-leaving .hs-title {
    animation-delay: 0.45s;
}
.hs-slide.is-active .hs-desc,
.hs-slide.is-leaving .hs-desc {
    animation-delay: 0.6s;
}
.hs-slide.is-active .hs-actions,
.hs-slide.is-leaving .hs-actions {
    animation-delay: 0.75s;
}
@keyframes hs-rise {
    from {
        opacity: 0;
        transform: translate3d(0, 28px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.hs-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.1rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-alt, #ffb703);
}
.hs-eyebrow::before {
    content: "";
    width: 2.4rem;
    height: 2px;
    background: currentColor;
}
.hs-title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4.6vw, 3.6rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.hs-desc {
    margin: 0 0 1.9rem;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
}
.hs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}
.hs-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.7rem;
    border-radius: 999px;
    border: 1.5px solid var(--accent-main, #c1121f);
    background: var(--accent-main, #c1121f);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}
.hs-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(193, 18, 31, 0.45);
}
.hs-btn.ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
}
.hs-btn.ghost:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

/* ── Mũi tên ─────────────────────────────────────────────────── */
.hs-nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 52px;
    height: 52px;
    margin-top: -26px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.9);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        background 0.25s ease;
}
.hs-nav svg {
    width: 22px;
    height: 22px;
}
.hs-prev {
    left: 1.25rem;
}
.hs-next {
    right: 1.25rem;
}
.hs:hover .hs-nav,
.hs:focus-within .hs-nav {
    opacity: 1;
    transform: scale(1);
}
.hs-nav:hover {
    background: var(--accent-main, #c1121f);
    border-color: var(--accent-main, #c1121f);
}

/* ── Chấm điều hướng + bộ đếm + thanh tiến độ ───────────────── */
.hs-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.75rem;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
}
.hs-dot {
    position: relative;
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition:
        width 0.35s ease,
        background 0.35s ease;
}
.hs-dot::after {
    content: "";
    position: absolute;
    inset: -10px; /* vùng bấm rộng hơn */
}
.hs-dot.is-active {
    width: 34px;
    background: var(--accent-alt, #ffb703);
}
.hs-count {
    position: absolute;
    right: 1.75rem;
    bottom: 1.5rem;
    z-index: 5;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.75);
}
.hs-count .cur {
    color: #fff;
    font-size: 1.25rem;
}
.hs-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
}
.hs-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent-alt, #ffb703);
    transform-origin: left;
    transform: scaleX(0);
    animation: hs-progress var(--hs-duration) linear forwards;
}
@keyframes hs-progress {
    to {
        transform: scaleX(1);
    }
}

/* Tạm dừng (rê chuột, tab ẩn, ngoài màn hình…) */
.hs.is-paused .hs-progress span,
.hs.is-paused .hs-slide img {
    animation-play-state: paused;
}
.hs.hs-single .hs-nav,
.hs.hs-single .hs-dots,
.hs.hs-single .hs-count,
.hs.hs-single .hs-progress {
    display: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hs {
        --hs-top: 72px;
        height: clamp(440px, 78vh, 620px);
    }
    .hs-caption {
        padding-bottom: 4.5rem;
    }
    .hs-nav,
    .hs-count {
        display: none;
    }
    .hs-btn {
        padding: 0.75rem 1.3rem;
        font-size: 0.9rem;
    }
}

/* Người dùng bật "giảm chuyển động" */
@media (prefers-reduced-motion: reduce) {
    .hs-slide {
        transition-duration: 0.01s;
    }
    .hs-slide img,
    .hs-caption > *,
    .hs-progress span {
        animation: none !important;
    }
    .hs-progress span {
        transform: scaleX(1);
    }
}
