/* Layout Principal do Carrinho */
.cart-main {
    margin-top: 20px;
    margin-bottom: 60px;
}

.cart-header-title {
    margin-bottom: 30px;
}
.cart-header-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}
.cart-header-title span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.cart-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* ESQUERDA: LISTA DE PRODUTOS */
.cart-items-section {
    flex: 2;
}

.cart-table-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 40px;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.cart-item-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 40px;
    gap: 15px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.item-produto-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.item-img {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border-radius: 8px;
    object-fit: contain;
    padding: 5px;
}
.item-titulo {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.item-preco, .item-total {
    font-size: 0.95rem;
    font-weight: 700;
}

.item-qtd-control {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    width: fit-content;
}
.item-qtd-control button {
    background: transparent;
    border: none;
    color: white;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}
.item-qtd-control button:hover {
    color: var(--primary-yellow);
}
.item-qtd-control input {
    background: transparent;
    border: none;
    color: white;
    width: 30px;
    text-align: center;
    font-weight: 600;
    outline: none;
}

.btn-remover {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}
.btn-remover:hover {
    color: var(--primary-red);
}

.link-continuar {
    display: inline-block;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.2s;
}
.link-continuar:hover {
    color: var(--primary-yellow);
}

/* DIREITA: RESUMO DO PEDIDO */
.cart-summary-section {
    flex: 1;
    min-width: 320px;
}

.summary-box {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 30px;
}

.summary-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #ccc;
}
.highlight-discount {
    color: #4CAF50;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.summary-total-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
}
.total-label {
    font-size: 1.1rem;
    font-weight: 700;
}
.total-values {
    text-align: right;
}
.total-main {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
}
.total-installments {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.btn-finalizar-compra {
    width: 100%;
    background: var(--primary-yellow);
    color: #000;
    border: none;
    padding: 15px;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 15px;
}
.btn-finalizar-compra:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 185, 11, 0.3);
}

.safe-buy {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.safe-buy i {
    font-size: 1rem;
}

/* Responsividade */
@media (max-width: 900px) {
    .cart-layout {
        flex-direction: column;
    }
    .cart-summary-section {
        width: 100%;
    }
    .cart-table-header {
        display: none; /* Esconde cabeçalho em telas pequenas */
    }
    .cart-item-row {
        grid-template-columns: 1fr;
        position: relative;
        gap: 10px;
    }
    .btn-remover {
        position: absolute;
        top: 20px;
        right: 0;
    }
    .item-qtd-control, .item-preco, .item-total {
        margin-left: 75px; /* Alinha com o texto pulando a imagem */
    }
}