/* =========================
   PÁGINA DO CARRINHO
   ========================= */

.carrinho-section {
    padding: 2rem 0 5rem;
    min-height: 60vh;
    background: #f8f9fa;
}

/* Layout dois colunas */
.carrinho-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: start;
}

/* =====================
   CARRINHO VAZIO
   ===================== */
.carrinho-vazio {
    text-align: center;
    padding: 5rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.carrinho-vazio-icon {
    font-size: 5rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
}

.carrinho-vazio h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.carrinho-vazio p {
    color: #6c757d;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

/* =====================
   LISTA DE ITENS
   ===================== */
.carrinho-itens-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.carrinho-itens-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge-count {
    background: var(--primary-color, #2a7a4b);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}

.btn-limpar-carrinho {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-limpar-carrinho:hover {
    background: #dc3545;
    color: white;
}

/* Item individual */
.item-carrinho {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.25rem 1.5rem 1.25rem 1.25rem;
    background: white;
    border-radius: 14px;
    margin-bottom: 0.85rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.055);
    border: 1px solid #efefef;
    border-left: 4px solid var(--primary-color, #2a7a4b);
    transition: box-shadow 0.2s, transform 0.15s, border-left-color 0.2s;
    position: relative;
}

.item-carrinho:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.11);
    transform: translateY(-2px);
    border-left-color: #1f5c38;
}

/* Imagem do item */
.item-imagem {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0faf4 0%, #f4f6f8 100%);
    flex-shrink: 0;
    border: 1px solid #e2f0e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-imagem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.item-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b2d8c1;
    font-size: 2.2rem;
}

/* Info do item */
.item-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-info h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.item-info h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.item-info h3 a:hover {
    color: var(--primary-color, #2a7a4b);
}

.badge-prof-mini {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #ff4500);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.item-preco-unit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: #aaa;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
    margin-top: 2px;
}

.item-preco-unit::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cde5d5;
}

/* Ações: qty + subtotal + remover */
.item-acoes {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
    min-width: 110px;
}

.item-subtotal {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color, #2a7a4b);
    background: #f0faf4;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.btn-remover-item {
    background: none;
    border: 1px solid #eee;
    color: #ccc;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 5px 9px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-remover-item::after {
    content: 'Remover';
    font-size: 0.75rem;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.2s, width 0.2s;
    white-space: nowrap;
}

.btn-remover-item:hover {
    color: #dc3545;
    border-color: #dc354530;
    background: #dc354510;
}

.btn-remover-item:hover::after {
    opacity: 1;
    width: 46px;
}

/* =====================
   RESUMO SIDEBAR
   ===================== */
.carrinho-resumo {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    position: sticky;
    top: 100px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-top: 4px solid var(--primary-color, #2a7a4b);
}

.carrinho-resumo h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.resumo-linha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    font-size: 0.92rem;
    color: #666;
    border-bottom: 1px dashed #f5f5f5;
}

.resumo-linha:last-of-type {
    border-bottom: none;
}

.resumo-desconto {
    color: #198754;
    font-weight: 500;
}

.resumo-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 1.25rem;
    margin-top: 0.75rem;
    border-top: 2px solid #e9ecef;
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
}

.btn-finalizar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary-color, #2a7a4b), #1f5c38);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 12px rgba(42,122,75,0.3);
}

.btn-finalizar:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(42,122,75,0.4);
}

.btn-finalizar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-continuar-comprar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    color: #666;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-continuar-comprar:hover {
    border-color: var(--primary-color, #2a7a4b);
    color: var(--primary-color, #2a7a4b);
    background: #f0faf4;
}

/* Nota de portes grátis */
.resumo-nota-portes {
    font-size: 0.8rem;
    color: var(--primary-color, #2a7a4b);
    text-align: center;
    padding: 0.5rem;
    background: #f0faf4;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 992px) {
    .carrinho-layout {
        grid-template-columns: 1fr;
    }

    .carrinho-resumo {
        position: static;
    }
}

@media (max-width: 576px) {
    .item-carrinho {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        padding: 1rem 1rem 1rem 0.85rem;
    }

    .item-acoes {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        padding-top: 0.75rem;
        border-top: 1px solid #f0f0f0;
        min-width: unset;
    }

    .item-imagem {
        width: 80px;
        height: 80px;
    }

    .btn-remover-item::after {
        display: none;
    }
}
