:root {
    --bnv-sp-bg: #ffffff;
    --bnv-sp-primary: #15803d;
    --bnv-sp-accent: #f59e0b;
    --bnv-sp-text: #1e293b;
    --bnv-sp-duration: 380ms;
}

/* ==========================================================================
   1. MÀN HÌNH LOADING WEBSITE (PRELOADER OVERLAY)
   ========================================================================== */
#bnv-preloader-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bnv-sp-bg);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity var(--bnv-sp-duration) cubic-bezier(0.4, 0, 0.2, 1),
                visibility var(--bnv-sp-duration) cubic-bezier(0.4, 0, 0.2, 1),
                transform var(--bnv-sp-duration) cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
    will-change: opacity, transform;
}

#bnv-preloader-overlay.bnv-is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Hiệu ứng Màn kéo ngang (Curtain Wipe) */
body.bnv-trans-curtain #bnv-preloader-overlay.bnv-is-hidden {
    transform: translateY(-100%);
    opacity: 1 !important;
}

.bnv-loader-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

/* Khung chứa Logo & Vòng xoay */
.bnv-logo-stage {
    position: relative;
    width: 116px;
    height: 116px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.bnv-preloader-logo {
    max-width: 72px !important;
    max-height: 72px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    z-index: 3;
    animation: bnvLogoPulse 1.8s ease-in-out infinite;
}

@keyframes bnvLogoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

/* KIỂU 1: VÒNG XOAY KÉP ÁNH KIM (PULSE & DUAL RING) */
.bnv-anim-ring .bnv-ring-outer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--bnv-sp-primary);
    border-right-color: var(--bnv-sp-primary);
    animation: bnvSpin 1.1s linear infinite;
}
.bnv-anim-ring .bnv-ring-inner {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: var(--bnv-sp-accent);
    border-left-color: var(--bnv-sp-accent);
    animation: bnvSpinReverse 1.4s linear infinite;
}

@keyframes bnvSpin {
    to { transform: rotate(360deg); }
}
@keyframes bnvSpinReverse {
    to { transform: rotate(-360deg); }
}

/* KIỂU 2: THANH TIẾN TRÌNH HIỆN ĐẠI (PROGRESS BAR) */
.bnv-progress-track {
    width: 190px;
    height: 5px;
    background: rgba(148, 163, 184, 0.25);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 6px;
    position: relative;
}
.bnv-progress-bar {
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, var(--bnv-sp-primary), var(--bnv-sp-accent));
    border-radius: 99px;
    animation: bnvProgressSlide 1.15s ease-in-out infinite;
}
@keyframes bnvProgressSlide {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(240%); }
}

/* KIỂU 3: SÓNG LAN TỎA ĐA TẦNG (RIPPLE WAVE) */
.bnv-anim-ripple .bnv-ripple-circle {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2.5px solid var(--bnv-sp-primary);
    opacity: 0;
    animation: bnvRippleWave 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.bnv-anim-ripple .bnv-ripple-circle.delay-1 {
    border-color: var(--bnv-sp-accent);
    animation-delay: -1s;
}
@keyframes bnvRippleWave {
    0% { transform: scale(0.5); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* KIỂU 4: BA CHẤM NHẢY SINH ĐỘNG (BOUNCING DOTS) */
.bnv-dots-wrap {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.bnv-dots-wrap span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bnv-sp-primary);
    animation: bnvDotBounce 0.6s infinite alternate;
}
.bnv-dots-wrap span:nth-child(2) {
    background: var(--bnv-sp-accent);
    animation-delay: 0.2s;
}
.bnv-dots-wrap span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes bnvDotBounce {
    from { transform: translateY(0); opacity: 0.5; }
    to { transform: translateY(-9px); opacity: 1; }
}

/* Dòng chữ Loading bên dưới Logo */
.bnv-loading-text {
    margin-top: 14px;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bnv-sp-text);
    letter-spacing: 0.03em;
}

/* ==========================================================================
   2. HIỆU ỨNG CHUYỂN TRANG MƯỢT MÀ (PAGE TRANSITION EFFECTS)
   ========================================================================== */
body.bnv-page-ready #main-content,
body.bnv-page-ready main {
    transition: opacity var(--bnv-sp-duration) ease, transform var(--bnv-sp-duration) ease;
}

/* Kiểu Slide Up */
body.bnv-trans-slide.bnv-page-leaving #main-content,
body.bnv-trans-slide.bnv-page-leaving main {
    opacity: 0;
    transform: translateY(18px);
}
body.bnv-trans-slide.bnv-page-entering {
    animation: bnvSlideIn var(--bnv-sp-duration) cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bnvSlideIn {
    from { opacity: 0.2; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Kiểu Zoom Subtle */
body.bnv-trans-zoom.bnv-page-leaving #main-content,
body.bnv-trans-zoom.bnv-page-leaving main {
    opacity: 0;
    transform: scale(0.975);
}
body.bnv-trans-zoom.bnv-page-entering {
    animation: bnvZoomIn var(--bnv-sp-duration) cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bnvZoomIn {
    from { opacity: 0.2; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Kiểu Fade Smooth */
body.bnv-trans-fade.bnv-page-leaving #main-content,
body.bnv-trans-fade.bnv-page-leaving main {
    opacity: 0;
}