/* Modal do Carrinho - Garagem do Lanche */
/* Mantendo paleta de cores: #e63946 (vermelho), #fffaf0 (creme) */

/* Overlay do modal */
.modal-carrinho-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-carrinho-overlay.active {
    display: flex;
}

/* Container do carrinho */
.carrinho-container {
    background: #fff;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header do carrinho */
.carrinho-header {
    background: #e63946;
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.carrinho-header h2 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.carrinho-fechar {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.carrinho-fechar:hover {
    opacity: 0.8;
}

/* Lista de itens */
.carrinho-itens {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #fffaf0;
}

/* Item do carrinho */
.carrinho-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.carrinho-item-info {
    flex: 1;
}

.carrinho-item-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1rem;
}

.carrinho-item-info .customizacoes {
    font-size: 0.85rem;
    color: #666;
    margin: 3px 0;
}

.carrinho-item-info .observacoes {
    font-size: 0.85rem;
    color: #e63946;
    font-style: italic;
    margin: 3px 0;
}

.carrinho-item-info .preco-unitario {
    font-size: 0.9rem;
    color: #333;
    margin: 5px 0 0 0;
    font-weight: 600;
}

/* Controles de quantidade */
.carrinho-item-controles {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.quantidade-controle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffaf0;
    border-radius: 20px;
    padding: 3px;
}

.quantidade-controle button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #e63946;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.quantidade-controle button:hover {
    background: #c5303b;
}

.quantidade-controle span {
    min-width: 25px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
}

.carrinho-item-controles .subtotal {
    font-weight: bold;
    color: #e63946;
    font-size: 1rem;
    margin: 0;
}

.carrinho-item-controles .btn-remover {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.carrinho-item-controles .btn-remover:hover {
    opacity: 1;
}

/* Carrinho vazio */
.carrinho-vazio {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.carrinho-vazio p {
    margin: 10px 0;
}

/* Footer do carrinho */
.carrinho-footer {
    background: white;
    padding: 20px;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

.carrinho-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.carrinho-total span:first-child {
    font-size: 1.1rem;
    color: #333;
}

.carrinho-total span:last-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e63946;
}

.btn-finalizar-pedido {
    width: 100%;
    padding: 15px;
    background: #e63946;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-finalizar-pedido:hover:not(:disabled) {
    background: #c5303b;
}

.btn-finalizar-pedido:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-limpar-carrinho {
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px solid #e63946;
    color: #e63946;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.btn-limpar-carrinho:hover {
    background: #e63946;
    color: white;
}

/* Badge flutuante do carrinho */
.carrinho-badge-fixo {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #e63946;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.2s;
}

.carrinho-badge-fixo:hover {
    transform: scale(1.1);
}

.carrinho-badge-fixo .badge-icon {
    font-size: 1.5rem;
}

.carrinho-badge-fixo .badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: #e63946;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsividade */
@media (max-width: 480px) {
    .carrinho-container {
        max-height: 90vh;
    }
    
    .carrinho-header h2 {
        font-size: 1.1rem;
    }
    
    .carrinho-item {
        flex-direction: column;
    }
    
    .carrinho-item-controles {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
