/*--------------------------------------------------------------
14.0 - Site Loader (5.1.0 — premium config: 5 animation types)
--------------------------------------------------------------*/

.site-loader {
    position: fixed;
    inset: 0;
    z-index: 999991;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-theme-loader, #ef5455);
    --bx-loader-color: #fff;
    --bx-loader-speed: 1.5s;
}

.site-loader .loader-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 60px;
    color: var(--bx-loader-color);
}

.site-loader .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----- Type: dots (default — 5 jumping dots) ----- */
.site-loader--dots .loader-inner .dot {
    width: 8px;
    height: 8px;
    background-color: currentcolor;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: bx-dot-move var(--bx-loader-speed) infinite cubic-bezier(0.4, 0, 0.2, 1);
    animation-delay: 0.2s;
}

.site-loader--dots .loader-inner .dot1 { margin-left: -40px; animation-delay: 0.0s; }

.site-loader--dots .loader-inner .dot2 { margin-left: -20px; animation-delay: 0.1s; }

.site-loader--dots .loader-inner .dot3 { margin-left:  20px; animation-delay: 0.3s; }

.site-loader--dots .loader-inner .dot4 { margin-left:  40px; animation-delay: 0.4s; }

@keyframes bx-dot-move {
    0%, 100% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.4; }
    50%      { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* ----- Type: spinner (circular spinner with notch) ----- */
.site-loader--spinner .loader-inner .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: currentcolor;
    border-radius: 50%;
    animation: bx-spin var(--bx-loader-speed) linear infinite;
}

@keyframes bx-spin {
    to { transform: rotate(360deg); }
}

/* ----- Type: pulse (concentric pulsing circles) ----- */
.site-loader--pulse .loader-inner .pulse {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: currentcolor;
    position: relative;
    animation: bx-pulse-core var(--bx-loader-speed) ease-in-out infinite;
}

.site-loader--pulse .loader-inner .pulse::before,
.site-loader--pulse .loader-inner .pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: currentcolor;
    opacity: 0.3;
    animation: bx-pulse-ring var(--bx-loader-speed) ease-out infinite;
}

.site-loader--pulse .loader-inner .pulse::after { animation-delay: calc(var(--bx-loader-speed) / 2); }

@keyframes bx-pulse-core {
    0%, 100% { transform: scale(1);   opacity: 1;   }
    50%      { transform: scale(0.8); opacity: 0.7; }
}

@keyframes bx-pulse-ring {
    0%   { transform: scale(1);   opacity: 0.3; }
    100% { transform: scale(2.4); opacity: 0;   }
}

/* ----- Type: bars (4 bouncing bars) ----- */
.site-loader--bars .loader-inner {
    gap: 6px;
}

.site-loader--bars .loader-inner .bar {
    width: 6px;
    height: 32px;
    background: currentcolor;
    border-radius: 3px;
    animation: bx-bar-bounce var(--bx-loader-speed) ease-in-out infinite;
}

.site-loader--bars .loader-inner .bar:nth-child(1) { animation-delay: 0.0s; }

.site-loader--bars .loader-inner .bar:nth-child(2) { animation-delay: 0.15s; }

.site-loader--bars .loader-inner .bar:nth-child(3) { animation-delay: 0.30s; }

.site-loader--bars .loader-inner .bar:nth-child(4) { animation-delay: 0.45s; }

@keyframes bx-bar-bounce {
    0%, 80%, 100% { transform: scaleY(0.4); }
    40%           { transform: scaleY(1.0); }
}

/* ----- Type: logo (custom or theme logo, fade-pulse) ----- */
.site-loader--logo .loader-inner {
    width: auto;
    height: auto;
    max-width: 240px;
}

.site-loader--logo .site-loader__logo,
.site-loader--logo .custom-logo,
.site-loader--logo img {
    max-width: 200px;
    max-height: 80px;
    width: auto;
    height: auto;
    animation: bx-logo-pulse var(--bx-loader-speed) ease-in-out infinite;
}

.site-loader--logo .site-loader__text {
    font-size: 22px;
    font-weight: 600;
    color: currentcolor;
    letter-spacing: 0.05em;
    animation: bx-logo-pulse var(--bx-loader-speed) ease-in-out infinite;
}

@keyframes bx-logo-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%      { opacity: 0.6; transform: scale(0.95); }
}

/* ----- Lifecycle ----- */
.site-loader.loaded {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

.elementor-editor-active .site-loader,
.elementor-editor-preview .site-loader {
    display: none !important;
}

/* ----- Reduced motion: respect user preference ----- */
@media (prefers-reduced-motion: reduce) {
    .site-loader .dot,
    .site-loader .spinner,
    .site-loader .pulse,
    .site-loader .pulse::before,
    .site-loader .pulse::after,
    .site-loader .bar,
    .site-loader .site-loader__logo,
    .site-loader .custom-logo,
    .site-loader .site-loader__text {
        animation: none;
        opacity: 1;
    }
}
