/* ==========================================================================
   COMPONENTE: ESTATÍSTICAS / O QUE NOS MOVE (SECÇÃO 4)
   ========================================================================== */

.stats-section {
    position: relative;
    padding-top: clamp(64px, 8vw, 100px);
    padding-bottom: clamp(64px, 8vw, 100px);
    background-color: var(--color-base, #F1ECDE);
    overflow: hidden;
}

/* Padrão decorativo de pontos no fundo */
.stats-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(42, 28, 18, 0.1) 2px, transparent 2px);
    background-size: 32px 32px;
    background-position: center center;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
    -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 50%, #000 15%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 55% at 50% 50%, #000 15%, transparent 100%);
}

/* Efeito Glow / Blur Radial no Centro da secção */
.stats-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(320px, 80vw, 1000px);
    height: clamp(220px, 45vw, 380px);
    background: radial-gradient(50% 50% at 50% 50%, rgba(217, 106, 61, 0.15) 0%, rgba(42, 28, 18, 0.04) 60%, rgba(42, 28, 18, 0) 100%);
    filter: blur(48px);
    pointer-events: none;
    z-index: 1;
}

.stats-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: clamp(40px, 5vw, 64px);
}

/* ----------------------------------------
   CABEÇALHO
---------------------------------------- */
.stats-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
}

.stats-eyebrow {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--colors-terracota-700, #9C4826);
}

.stats-title {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: clamp(32px, 4vw, 36px);
    line-height: 1.2;
    letter-spacing: 0.05em;
    color: var(--colors-neutral-900, #151413);
    margin: 0;
}

/* ----------------------------------------
   GRELHA XADREZ (CHECKERBOARD)
---------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(24px, 3vw, 40px);
}

.stats-grid-item {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
}

/* ----------------------------------------
   IMAGENS
---------------------------------------- */
.stats-image-wrapper {
    border-radius: 12px;
    overflow: hidden;
    background-color: #E2DDD0;
}

.stats-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.stats-image-wrapper:hover .stats-image {
    transform: scale(1.05);
}

/* ----------------------------------------
   BLOCOS DE ESTATÍSTICA
---------------------------------------- */
.stats-block {
    background-color: transparent;
    /* Flutua no fundo */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stats-block-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    padding: 16px 0;
}

.stats-block-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stats-tag {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--colors-terracota-700, #9C4826);
    letter-spacing: 0.05em;
}

.stats-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.stats-icon img {
    width: 160%;
    max-width: 95px;
    max-height: 100%;
    object-fit: contain;
}

.stats-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-value {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: clamp(48px, 5vw, 56px);
    line-height: 1;
    color: var(--colors-neutral-900, #151413);
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(42, 28, 18, 0.15);
}

.stats-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.5;
    color: var(--colors-neutral-700, #4E4D4A);
    margin: 0;
}

/* ----------------------------------------
   RESPONSIVO
---------------------------------------- */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Mantemos o checkerboard no tablet realocando a ordem se necessário, 
           mas com 2 colunas, a ordem natural 1:Block, 2:Img, 3:Block, 4:Img funciona bem.
           Contudo, a linha 2 original era Img, Block, Img, Block. */
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 62px;
    }

    .stats-block-top {
        align-items: flex-end;
    }

    #o-que-nos-move>div>div>div:nth-child(3)>div>div.stats-block-top,
    #o-que-nos-move>div>div>div:nth-child(8)>div>div.stats-block-top {
        flex-direction: row-reverse;
    }

    #o-que-nos-move>div>div>div:nth-child(3)>div>div.stats-text-wrapper>div,
    #o-que-nos-move>div>div>div:nth-child(8)>div>div.stats-text-wrapper>div {
        text-align: end;
    }

    .stats-grid-item {
        aspect-ratio: auto;
        max-height: clamp(160px, 37vw, 280px);
    }

    .stats-grid-item:nth-child(1) {
        order: 1;
    }

    .stats-grid-item:nth-child(2) {
        order: 3;
    }

    .stats-grid-item:nth-child(3) {
        order: 2;
    }

    .stats-grid-item:nth-child(4) {
        order: 7;
    }

    .stats-grid-item:nth-child(5) {
        display: none;
        order: 6;
    }

    .stats-grid-item:nth-child(6) {
        order: 4;
    }

    .stats-grid-item:nth-child(7) {
        display: none;
        order: 8;
    }

    .stats-grid-item:nth-child(8) {
        order: 5;
    }

    .stats-value {
        font-size: 48px;
    }

    .stats-block-content {
        padding: 0;
        justify-content: flex-end;
    }
}