/* ==============================================
   ANIMAÇÕES E UTILITÁRIOS
   ============================================== */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.4s ease forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-success {
    color: var(--color-success, #28a745) !important;
}

/* ==============================================
   CONTAINER E HEADER GERAL
   ============================================== */
.container-pedidos {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px;
    font-family: "Oswald", sans-serif;
    flex: 1;
    display: flex;
    flex-direction: column;

    * {
        box-sizing: border-box;
    }
}

/* ==============================================
   DETALHE DO PEDIDO (Header e Status)
   ============================================== */
.detalhe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--bg-base-grey-dark);
    padding-bottom: 20px;

    .header-info {
        display: flex;
        flex-direction: column;
        gap: 5px;

        h1 {
            font-size: clamp(1.8rem, 3vw, 2.5rem);
            color: var(--text-dark);
            font-weight: 600;
            margin: 0;
            text-transform: uppercase;
        }

        span {
            font-size: 1.1rem;
            color: var(--text-grey);
        }
    }

    .pedido-status {
        padding: 8px 16px;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        border: 1px solid var(--bg-base-grey-dark);
        background-color: #fff;
        color: var(--text-dark);
        text-align: center;

        &.processing,
        &.pendente {
            color: #856404;
            background-color: #fff3cd;
            border-color: #ffeeba;
        }

        &.completed,
        &.concluido,
        &.entregue {
            color: #155724;
            background-color: #d4edda;
            border-color: #c3e6cb;
        }

        &.cancelled,
        &.cancelado {
            color: #721c24;
            background-color: #f8d7da;
            border-color: #f5c6cb;
        }
    }
}

/* ==============================================
   CARDS DE INFORMAÇÃO (Grid e Listas)
   ============================================== */
.detalhe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}

.detalhe-card {
    background-color: var(--bg-base-light);
    border: 1px solid var(--bg-base-grey-dark);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;

    &.no-padding {
        padding: 0;
    }

    .card-titulo {
        font-size: 1.2rem;
        color: var(--text-dark);
        margin: 0 0 20px 0;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--bg-base-grey);
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 600;

        &.com-padding {
            margin: 24px 24px 0 24px;
        }
    }

    .info-list {
        display: flex;
        flex-direction: column;
        gap: 15px;

        .info-item {
            display: flex;
            flex-direction: column;
            gap: 2px;

            span {
                font-size: 0.85rem;
                color: var(--text-grey);
                font-weight: 600;
                text-transform: uppercase;
            }

            strong {
                font-size: 1.05rem;
                color: var(--text-dark);
                font-weight: 500;
            }
        }
    }
}

/* ==============================================
   LISTA DE ITENS DO PEDIDO
   ============================================== */
.lista-itens-detalhe {
    display: flex;
    flex-direction: column;

    .item-pedido {
        display: flex;
        gap: 20px;
        padding: 24px;
        border-bottom: 1px solid var(--bg-base-grey);

        &:last-child {
            border-bottom: none;
        }

        .img-item {
            width: 100px;
            height: 100px;
            border-radius: 8px;
            overflow: hidden;
            flex-shrink: 0;
            background-color: var(--bg-base-light-alt);
            border: 1px solid var(--bg-base-grey);

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }

            .img-placeholder {
                width: 100%;
                height: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
                color: var(--text-grey);
                font-size: 0.75rem;
                text-align: center;
                background-color: var(--bg-base-grey);
            }
        }

        .info-item {
            display: flex;
            flex-direction: column;
            flex: 1;
            justify-content: center;
            gap: 8px;

            .topo-info h3 {
                font-size: 1.2rem;
                color: var(--text-dark);
                margin: 0;
                font-weight: 500;
            }

            .detalhes-secundarios {
                display: flex;
                gap: 15px;
                font-size: 0.85rem;
                color: var(--text-grey);

                strong {
                    color: var(--text-dark);
                }
            }

            .base-info {
                display: flex;
                justify-content: space-between;
                align-items: flex-end;
                margin-top: 5px;

                .qtd {
                    font-size: 1rem;
                    color: var(--text-grey);
                }

                .preco-item {
                    font-size: 1.3rem;
                    font-weight: 700;
                    color: var(--text-dark);
                    margin: 0;
                }
            }
        }

        @media (max-width: 600px) {
            flex-direction: column;

            .img-item {
                width: 100%;
                height: 180px;
            }

            .base-info {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }
        }
    }
}

/* ==============================================
   RESUMO DE VALORES
   ============================================== */
.resumo-card {
    .resumo-linha {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        font-size: 1.1rem;
        color: var(--text-grey);

        strong {
            color: var(--text-dark);
            font-weight: 500;
        }

        &.total {
            border-top: 1px solid var(--bg-base-grey-dark);
            margin-top: 10px;
            padding-top: 20px;
            font-size: 1.3rem;
            color: var(--text-dark);

            strong {
                font-size: 1.8rem;
                font-weight: 700;
                color: var(--color-success);
            }
        }
    }
}

/* ==============================================
   BOTÕES DE AÇÃO
   ============================================== */
.detalhe-acoes {
    display: flex;
    justify-content: flex-start;
    margin-top: 20px;

    .btn-voltar {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 8px 16px;
        background-color: var(--bg-base-dark);
        color: var(--text-light);
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        text-decoration: none;
        transition: 0.3s ease;
        border: none;

        & i {
            color: var(--text-light);
            transition: 0.3s ease;
        }

        &:hover {
            background-color: var(--text-yellow);
            color: var(--bg-base-dark);

            & i {
                color: var(--bg-base-dark);
            }
        }
    }
}

/* ==============================================
   PAGINAÇÃO (Estilo Catálogo da Loja)
   ============================================== */
.vit-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--bg-base-grey-dark);
    width: 100%;

    a {
        padding: 8px 16px;
        border: 1px solid var(--bg-base-grey-dark);
        border-radius: 8px;
        color: var(--text-dark);
        font-weight: 500;
        transition: all 0.3s ease;
        background-color: #fff;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 8px;

        &:hover:not(.disabled) {
            background-color: var(--bg-base-dark);
            color: var(--text-light);
            border-color: var(--bg-base-dark);
        }

        &.disabled {
            opacity: 0.5;
            pointer-events: none;
            background-color: var(--bg-base-grey);
            color: var(--text-grey);
        }
    }

    span {
        font-weight: 600;
        color: var(--text-dark);
        font-size: 0.95rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    @media (max-width: 640px) {
        flex-direction: column;
        gap: 15px;

        a {
            width: 100%;
            justify-content: center;
        }
    }
}