
/* ==========================================
   THE ONLY BAKER - PREMIUM LOGO PRELOADER
========================================== */

.bakery-preloader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    width: 100%;
    height: 100vh;
    height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff7ed;
    overflow: hidden;

    opacity: 1;
    visibility: visible;

    transition:
        opacity .65s ease,
        visibility .65s ease;
}

.bakery-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.bakery-loader-content {
    position: relative;
    width: min(92%, 550px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bakery-logo-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: bakery-float 2.8s ease-in-out infinite;
}

.bakery-loader-logo {
    position: relative;
    z-index: 2;
    display: block;

    width: 100%;
    max-width: 470px;
    height: auto;
    max-height: 260px;

    object-fit: contain;
    object-position: center;

    animation: bakery-logo-reveal 1s ease both;

    filter: drop-shadow(
        0 12px 20px rgba(96, 49, 22, .12)
    );
}

.bakery-glow {
    position: absolute;
    width: 65%;
    height: 70%;
    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(224, 172, 104, .23),
        transparent 70%
    );

    filter: blur(25px);
    animation: bakery-glow 2.4s ease-in-out infinite;
}

.bakery-sparkle {
    position: absolute;
    z-index: 3;
    color: #c99652;
    font-size: 24px;
    pointer-events: none;

    animation: bakery-sparkle 1.8s ease-in-out infinite;
}

.sparkle-1 {
    top: 8%;
    left: 10%;
}

.sparkle-2 {
    top: 15%;
    right: 10%;
    animation-delay: .4s;
}

.sparkle-3 {
    bottom: 12%;
    left: 7%;
    animation-delay: .8s;
}

.sparkle-4 {
    bottom: 10%;
    right: 8%;
    animation-delay: 1.2s;
}

.bakery-loader-tagline {
    margin: 12px 0 0;
    color: #9a643f;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1.6;
}

.bakery-loader-message {
    margin: 16px 0 24px;
    color: #78513c;

    font-size: 15px;
    font-weight: 500;
}

.bakery-dots::after {
    content: "...";
    display: inline-block;
    width: 18px;
    overflow: hidden;
    vertical-align: bottom;
    text-align: left;

    animation: bakery-dots 1.4s steps(4, end) infinite;
}

.bakery-progress {
    width: 230px;
    max-width: 80%;
    height: 5px;

    overflow: hidden;
    border-radius: 50px;
    background: #ead8c4;
}

.bakery-progress-fill {
    display: block;
    width: 35%;
    height: 100%;
    border-radius: inherit;

    background: linear-gradient(
        90deg,
        #a76a3d,
        #e8b875,
        #a76a3d
    );

    animation: bakery-progress 1.5s ease-in-out infinite;
}

/* ANIMATIONS */

@keyframes bakery-logo-reveal {
    from {
        opacity: 0;
        transform: scale(.88);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bakery-float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes bakery-glow {
    0%, 100% {
        opacity: .5;
        transform: scale(.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

@keyframes bakery-sparkle {
    0%, 100% {
        opacity: .25;
        transform: scale(.7) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.2) rotate(25deg);
    }
}

@keyframes bakery-progress {
    from {
        transform: translateX(-110%);
    }

    to {
        transform: translateX(300%);
    }
}

@keyframes bakery-dots {
    from {
        width: 0;
    }

    to {
        width: 18px;
    }
}

/* TABLET */

@media (max-width: 768px) {
    .bakery-loader-content {
        width: 90%;
        max-width: 440px;
    }

    .bakery-loader-logo {
        max-width: 380px;
        max-height: 220px;
    }
}

/* MOBILE */

@media (max-width: 480px) {
    .bakery-loader-content {
        width: 94%;
        max-width: 350px;
    }

    .bakery-loader-logo {
        width: 100%;
        max-width: 330px;
        max-height: 190px;
        object-fit: contain;
    }

    .bakery-loader-tagline {
        margin-top: 8px;
        font-size: 9px;
        letter-spacing: 2px;
    }

    .bakery-loader-message {
        font-size: 13px;
        margin: 15px 0 20px;
    }

    .bakery-progress {
        width: 190px;
    }

    .bakery-sparkle {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bakery-logo-wrapper,
    .bakery-loader-logo,
    .bakery-glow,
    .bakery-sparkle,
    .bakery-progress-fill,
    .bakery-dots::after {
        animation: none;
    }

    .bakery-preloader {
        transition: none;
    }
}

.bakery-preloader.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
