/*
 * Page Loading — loader exibido em /ofertas/ antes da renderização da home
 * Movido de mobile-view/includes/page-loading.php (v4.77.5)
 *
 * LEI #3 — background e color sempre pareados
 * Todos os valores de dimensão/cor vêm de design-tokens.css
 */

#pageLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999999999;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--transition-base, 250ms ease);
}

#pageLoader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================
   Conteudo central (icones + texto)
   ========================================================== */

.loaderContent {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-5, 20px) 0 var(--space-8, 32px) 0;
    transform: translateY(-64px);
    z-index: 2;
}

.loaderContent p {
    margin: 0;
    padding: 0 var(--space-6, 24px);
    font-size: var(--font-xl, 22px);
    line-height: 1.3;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    background: transparent;
    min-height: 1.3em;
}

.loaderContent span {
    font-size: var(--font-2xl, 28px);
    line-height: 1.1;
    color: var(--text-primary);
}

/* Spinner circular (reserva — caso seja usado no futuro) */
.page-loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid color-mix(in srgb, var(--main-color) 20%, transparent);
    border-top-color: var(--main-color);
    border-radius: var(--radius-full);
    animation: pageLoaderSpin 0.9s linear infinite;
}

@keyframes pageLoaderSpin {
    to { transform: rotate(360deg); }
}

/* ==========================================================
   Animacao do icone
   ========================================================== */

.iconAnimation {
    position: relative;
    width: 96px;
    height: 96px;
    margin-bottom: var(--space-6, 24px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
}

.iconAnimation i {
    position: absolute;
    bottom: 0;
    font-size: 48px;
    color: var(--main-color);
    opacity: 0;
    animation: floatIcon 3s ease-in-out forwards;
}

@keyframes floatIcon {
    0%   { transform: translateY(0) scale(1) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    40%  { transform: translateY(-60px) scale(1.1) rotate(30deg); opacity: 0.85; }
    70%  { transform: translateY(-10px) scale(1) rotate(360deg); opacity: 0.5; }
    100% { transform: translateY(100px) scale(0.8) rotate(720deg); opacity: 0; }
}

/* ==========================================================
   Pontinhos animados no final da string "Carregando"
   ========================================================== */

.typing-dots::after {
    content: '';
    animation: pageLoaderDots 1.2s infinite steps(3);
}

@keyframes pageLoaderDots {
    0%   { content: ''; }
    33%  { content: '.'; }
    66%  { content: '..'; }
    100% { content: '...'; }
}

/* ==========================================================
   Fundo abstrato (shapes, blobs, circulos, linhas)
   ========================================================== */

.bg-abstract {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.shape {
    position: absolute;
    border-radius: var(--radius-lg, 16px);
    filter: blur(8px);
    opacity: 0.35;
    animation: pageLoaderFloat 10s infinite ease-in-out;
    pointer-events: none;
}

.shape1 {
    width: 250px;
    height: 80px;
    background: linear-gradient(45deg, var(--main-color), var(--main-color-light));
    top: 10%;
    left: -120px;
    animation-delay: 0s;
}

.shape2 {
    width: 200px;
    height: 60px;
    background: linear-gradient(135deg, var(--main-color), var(--main-color-lighter));
    top: 40%;
    left: -160px;
    animation-delay: 2s;
}

.shape3 {
    width: 220px;
    height: 60px;
    background: linear-gradient(120deg, var(--main-color), var(--main-color-light));
    top: 70%;
    left: -200px;
    animation-delay: 4s;
}

.shape4 {
    width: 150px;
    height: 50px;
    background: linear-gradient(120deg, var(--main-color), var(--main-color-lighter));
    top: 85%;
    left: -140px;
    animation-delay: 6s;
}

@keyframes pageLoaderFloat {
    0%   { transform: translateX(0) rotate(0deg); opacity: 0.2; }
    50%  { transform: translateX(120vw) rotate(360deg); opacity: 0.4; }
    100% { transform: translateX(0) rotate(720deg); opacity: 0.2; }
}

/* Bolhas grandes */
.blob {
    position: absolute;
    border-radius: var(--radius-full, 50%);
    opacity: 0.2;
    background: var(--main-color-light);
    pointer-events: none;
}

.blob1 {
    width: 320px;
    height: 320px;
    top: -100px;
    left: -100px;
}

.blob2 {
    width: 360px;
    height: 360px;
    bottom: -120px;
    right: -120px;
}

/* Circulos decorativos */
.circle {
    position: absolute;
    border-radius: var(--radius-full, 50%);
    z-index: 1;
    pointer-events: none;
}

.circle1 {
    width: 100px;
    height: 100px;
    background: var(--main-color);
    top: -48px;
    left: -16px;
}

.circle2 {
    width: 40px;
    height: 40px;
    background: var(--main-color-lighter);
    top: 200px;
    left: 75%;
}

.circle3 {
    width: 60px;
    height: 60px;
    border: 4px solid var(--main-color);
    background: transparent;
    bottom: 80px;
    right: 15%;
}

/* Linhas diagonais */
.line {
    position: absolute;
    width: 60px;
    height: 3px;
    background: var(--main-color);
    opacity: 0.4;
    transform: rotate(45deg);
    pointer-events: none;
}

.line1 {
    top: 30%;
    left: 30%;
}

.line2 {
    bottom: 25%;
    right: 35%;
}

/* ==========================================================
   Copyright (rodape do loader)
   ========================================================== */

#pageLoader .copyright {
    position: absolute;
    left: 50%;
    bottom: var(--space-5, 20px);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

#pageLoader .copyright svg {
    width: 40px;
    height: 40px;
}

#pageLoader .copyright svg path {
    fill: var(--main-color);
}

#pageLoader .copyright span {
    font-size: var(--font-xs, 11px);
    color: var(--main-color);
}

#pageLoader .copyright-link {
    color: var(--main-color);
    font-size: var(--font-xs, 11px);
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.04em;
}
