/* =============================================
   PAGE-LOADER.CSS — Éco'Mam
   ============================================= */

#ecomam-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #faf6e4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: all;
}

#ecomam-loader.loader--hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Anneau tournant autour du logo ── */
.loader__logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader__logo {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(181,131,62,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.loader__logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

/* Masquer complètement le fallback — le logo image suffit */
.loader__logo-fallback {
    display: none !important;
}

.loader__ring {
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #b5833e;
    border-right-color: #eec9ae;
    animation: loader-spin 0.9s linear infinite;
}

@keyframes loader-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Texte Éco'Mam — pulse lettre par lettre ── */
.loader__text {
    font-family: 'Schoolbell', cursive;
    font-size: 2.2rem;
    color: #b5833e;
    display: flex;
    gap: 1px;
    letter-spacing: 0.02em;
}

.loader__text span {
    display: inline-block;
    opacity: 0;
    transform: scale(0.5) translateY(8px);
    animation: loader-letter-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Apparition décalée lettre par lettre */
.loader__text span:nth-child(1) { animation-delay: 0.00s; }
.loader__text span:nth-child(2) { animation-delay: 0.07s; }
.loader__text span:nth-child(3) { animation-delay: 0.14s; }
.loader__text span:nth-child(4) { animation-delay: 0.21s; }
.loader__text span:nth-child(5) { animation-delay: 0.28s; color: #54a66a; } /* M */
.loader__text span:nth-child(6) { animation-delay: 0.35s; }
.loader__text span:nth-child(7) { animation-delay: 0.42s; }

@keyframes loader-letter-pulse {
    0%   { opacity: 0; transform: scale(0.5) translateY(8px); }
    60%  { opacity: 1; transform: scale(1.15) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Sous-titre ── */
.loader__subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem;
    color: #c4a882;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: -1rem;
    opacity: 0;
    animation: loader-fade 0.4s ease 0.5s forwards;
}

@keyframes loader-fade {
    to { opacity: 1; }
}

/* ── Barre de progression ── */
.loader__bar-wrap {
    width: 140px;
    height: 3px;
    background: #eec9ae44;
    border-radius: 4px;
    overflow: hidden;
}

.loader__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #b5833e, #54a66a);
    border-radius: 4px;
    animation: loader-bar 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes loader-bar {
    0%   { width: 0%; }
    70%  { width: 80%; }
    100% { width: 100%; }
}

/* ── Points animés ── */
.loader__dots {
    display: flex;
    gap: 7px;
    margin-top: -0.8rem;
}

.loader__dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: loader-dot 1s ease-in-out infinite;
}

.loader__dots span:nth-child(1) { background: #b5833e; animation-delay: 0s;   }
.loader__dots span:nth-child(2) { background: #54a66a; animation-delay: 0.2s; }
.loader__dots span:nth-child(3) { background: #eec9ae; animation-delay: 0.4s; }

@keyframes loader-dot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%            { transform: scale(1.3); opacity: 1;   }
}