/**
 * FLAME & CO. — Styles du loader (burger CSS pur)
 */

/* ═══ LOADER SCÈNE ═══ */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 40%, #1a0a0a 0%, #0a0a0a 55%, #050505 100%);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

#page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-scene {
    text-align: center;
    width: min(360px, 90vw);
    padding: 1.5rem;
}

/* ═══ MARQUE ═══ */
.loader-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.loader-brand-flame {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E63946, #F77F00);
    border-radius: 12px;
    font-size: 1.35rem;
    color: #fff;
    animation: loaderFlamePulse 1.2s ease-in-out infinite;
}

.loader-brand-logo {
    height: 44px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.loader-brand-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 7vw, 2.75rem);
    letter-spacing: 0.12em;
    color: #fff;
}

/* ═══ ASSEMBLAGE BURGER ═══ */
.burger-assembly {
    position: relative;
    width: 260px;
    height: 240px;
    margin: 0 auto 1.5rem;
}

.loader-burger-glow {
    position: absolute;
    inset: 10% 0;
    background: radial-gradient(ellipse, rgba(247, 127, 0, 0.25) 0%, transparent 70%);
    filter: blur(24px);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.burger-assembly.is-complete .loader-burger-glow {
    opacity: 1;
    animation: loaderGlowPulse 1.5s ease-in-out infinite;
}

.burger-stack {
    position: relative;
    width: 240px;
    height: 200px;
    margin: 0 auto;
    z-index: 2;
}

.stack-item {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    flex-shrink: 0;
}

/* Pain du bas */
.bun-bottom-item { bottom: 0; width: 220px; z-index: 1; }

.bun-bottom-shape {
    width: 220px;
    height: 38px;
    background: linear-gradient(180deg, #D4953A 0%, #B8732A 45%, #8B5A1E 100%);
    border-radius: 6px 6px 50% 50%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45),
                inset 0 -3px 6px rgba(0, 0, 0, 0.25);
}

/* Steak */
.layer-patty { bottom: 36px; width: 200px; z-index: 2; }

.patty-shape {
    width: 200px;
    height: 22px;
    background: linear-gradient(180deg, #6B3A1F 0%, #4A2510 50%, #3D1A0A 100%);
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.08);
}

/* Salade */
.layer-lettuce { bottom: 54px; width: 215px; z-index: 3; }

.lettuce-shape {
    width: 215px;
    height: 26px;
    background: linear-gradient(180deg, #8BC34A 0%, #689F38 40%, #558B2F 100%);
    border-radius: 45% 45% 20% 20% / 70% 70% 30% 30%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
}

.lettuce-shape::before,
.lettuce-shape::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 60%;
    background: inherit;
    border-radius: 50%;
    top: -20%;
    filter: brightness(1.1);
}

.lettuce-shape::before { left: 5%; transform: rotate(-15deg); }
.lettuce-shape::after  { right: 5%; transform: rotate(15deg); }

/* Tomate */
.layer-tomato { bottom: 76px; width: 205px; z-index: 4; }

.tomato-shape {
    width: 205px;
    height: 14px;
    background: linear-gradient(180deg, #EF5350 0%, #C62828 100%);
    border-radius: 999px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    position: relative;
}

.tomato-ring {
    position: absolute;
    inset: 3px 20%;
    border: 2px solid rgba(255, 200, 200, 0.35);
    border-radius: 999px;
}

/* Fromage */
.layer-cheese { bottom: 88px; width: 210px; z-index: 5; }

.cheese-shape {
    width: 210px;
    height: 12px;
    background: linear-gradient(180deg, #FFD54F 0%, #FFB300 60%, #FF8F00 100%);
    border-radius: 4px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cheese-drip {
    position: absolute;
    bottom: -8px;
    width: 14px;
    height: 10px;
    background: #FFB300;
    border-radius: 0 0 50% 50%;
}

.cheese-drip-l { left: 18%; }
.cheese-drip-r { right: 22%; }

/* Pain du haut */
.bun-top-item { bottom: 98px; width: 220px; z-index: 6; }

.bun-top-shape {
    width: 220px;
    height: 52px;
    background: linear-gradient(180deg, #F5D061 0%, #E8A849 35%, #C8842A 100%);
    border-radius: 50% 50% 12px 12px;
    box-shadow: 0 -4px 12px rgba(255, 200, 100, 0.15),
                inset 0 6px 10px rgba(255, 255, 255, 0.25),
                0 6px 16px rgba(0, 0, 0, 0.35);
    position: relative;
}

.bun-top-shape .seed {
    position: absolute;
    width: 5px;
    height: 3px;
    background: #FFF8E1;
    border-radius: 50%;
    opacity: 0.85;
}

.bun-top-shape .seed:nth-child(1) { top: 28%; left: 22%; transform: rotate(-20deg); }
.bun-top-shape .seed:nth-child(2) { top: 18%; left: 42%; transform: rotate(10deg); }
.bun-top-shape .seed:nth-child(3) { top: 32%; left: 58%; transform: rotate(-8deg); }
.bun-top-shape .seed:nth-child(4) { top: 22%; left: 72%; transform: rotate(15deg); }
.bun-top-shape .seed:nth-child(5) { top: 38%; left: 35%; transform: rotate(-5deg); }
.bun-top-shape .seed:nth-child(6) { top: 15%; left: 65%; transform: rotate(25deg); }

/* Ombre sous le burger */
.burger-shadow-loader {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 16px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.5) 0%, transparent 70%);
    filter: blur(6px);
    z-index: 1;
}

/* ═══ INGRÉDIENTS QUI TOMBENT ═══ */
.loader-drop {
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
}

/* État initial géré par GSAP ; fallback CSS ci-dessous dans animations.css */

/* ═══ TAGLINE & PROGRESSION ═══ */
.loader-tagline {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
}

.loader-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 2px;
    vertical-align: baseline;
}

.loader-dots i {
    display: block;
    width: 4px;
    height: 4px;
    background: #F77F00;
    border-radius: 50%;
    animation: loaderDotBounce 1.2s ease-in-out infinite;
}

.loader-dots i:nth-child(2) { animation-delay: 0.2s; }
.loader-dots i:nth-child(3) { animation-delay: 0.4s; }

.loader-progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.loader-progress {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #E63946, #F77F00, #FFD60A);
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(247, 127, 0, 0.5);
}

.loader-percent {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    color: #F77F00;
    min-width: 36px;
    letter-spacing: 0.05em;
}

/* Shake à l'impact — géré par GSAP sur les shapes internes */

@keyframes loaderFlamePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(247, 127, 0, 0); }
    50%      { transform: scale(1.08); box-shadow: 0 0 20px rgba(247, 127, 0, 0.4); }
}

@keyframes loaderGlowPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.05); }
}

@keyframes loaderDotBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40%           { transform: translateY(-5px); opacity: 1; }
}

@keyframes loaderImpact {
    0%   { transform: scaleY(1); }
    30%  { transform: scaleY(0.88); }
    60%  { transform: scaleY(1.04); }
    100% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
    .loader-brand-flame,
    .loader-dots i,
    .burger-assembly.is-complete .loader-burger-glow {
        animation: none !important;
    }

    .loader-drop {
        opacity: 1 !important;
    }
}
