/* --- CSS para o Modal da Sacola - Design Aprimorado --- */

.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fundo escuro transparente */
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Alinha o modal na parte inferior */
    z-index: 1000; /* Garante que fique acima de todo o conteúdo */
    opacity: 0; /* Começa invisível */
    visibility: hidden; /* Esconde completamente */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 600px; /* Limita a largura para telas maiores */
    border-top-left-radius: 20px; /* Bordas arredondadas no topo */
    border-top-right-radius: 20px; /* Bordas arredondadas no topo */
    padding: 20px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(100%); /* Começa fora da tela */
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 85vh; /* Aumenta um pouco a altura máxima do modal */
    box-sizing: border-box; /* Garante que padding não afete a largura */
}

.cart-modal-overlay.show .cart-modal-content {
    transform: translateY(0); /* Desliza para cima */
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px; /* Espaço abaixo do cabeçalho */
    border-bottom: 1px solid #f0f0f0; /* Linha sutil para separar o cabeçalho */
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 26px; /* Aumenta o tamanho da fonte */
    color: #333;
    font-weight: bold; /* Deixa o texto mais negrito */
}

.close-modal-button {
    background: none;
    border: none;
    font-size: 28px; /* Aumenta o tamanho do ícone de fechar */
    color: #555; /* Cor mais suave */
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal-button:hover {
    color: #000; /* Cor mais escura ao passar o mouse */
}

.cart-items-list {
    flex-grow: 1;
    overflow-y: auto; /* Adiciona scroll se houver muitos itens */
    padding-right: 5px; /* Para evitar que a barra de rolagem cubra o conteúdo */
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee; /* Linha divisória entre os itens */
}

.cart-item:last-child {
    border-bottom: none; /* Remove a borda do último item */
}

.cart-item-image {
    width: 70px; /* Levemente menor para um visual mais compacto */
    height: 70px;
    border-radius: 12px; /* Mais arredondado */
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Sombra sutil na imagem */
}

.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-size: 17px;
    font-weight: 600; /* Um pouco mais negrito */
    color: #333;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
    font-weight: bold; /* Preço individual em negrito */
}

/* CONTROLES DE QUANTIDADE */
.cart-item-quantity-controls {
    display: flex;
    align-items: center;
    background-color: #f8f8f8; /* Fundo mais claro */
    border-radius: 25px; /* Mais arredondado */
    padding: 4px 8px; /* Mais preenchimento */
    width: fit-content;
    border: 1px solid #ddd; /* Borda sutil */
}

.cart-item-quantity-button {
    background-color: transparent; /* Fundo transparente */
    color: #FFC72C; /* Cor do tema */
    border: none;
    border-radius: 50%; /* Mantém o formato circular do ícone, mesmo sem fundo */
    width: 28px;
    height: 28px;
    font-size: 16px; /* Ícone um pouco maior */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cart-item-quantity-button:hover {
    background-color: #ffe08a; /* Fundo levemente amarelo ao passar o mouse */
    color: #fff; /* Texto branco ao passar o mouse */
}

.cart-item-quantity-button.cart-item-decrement {
    color: #777; /* Cor mais neutra para o decremento */
}
.cart-item-quantity-button.cart-item-decrement:hover {
    background-color: #e0e0e0;
    color: #333;
}


.cart-item-quantity-display {
    font-size: 17px; /* Um pouco maior */
    font-weight: bold;
    margin: 0 10px; /* Espaçamento menor */
    color: #333;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #aaa; /* Cor mais suave */
    font-size: 20px; /* Ícone maior */
    cursor: pointer;
    margin-left: 20px; /* Mais espaço à esquerda */
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.cart-item-remove:hover {
    color: #e74c3c; /* Vermelho ao passar o mouse */
}

/* RESUMO DA SACOLA (Subtotal, Descontos, Total) */
.cart-summary {
    padding-top: 15px;
    border-top: 1px dashed #ddd; /* Linha tracejada mais suave */
    margin-top: 15px;
    padding-bottom: 10px; /* Espaçamento no final */
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px; /* Mais espaçamento entre as linhas */
    font-size: 17px;
    color: #555;
}

.summary-line span:first-child {
    font-weight: 500; /* Etiqueta um pouco mais negrito */
}

.summary-line.total-line {
    font-size: 22px; /* Tamanho maior para o total */
    font-weight: bold;
    color: #333;
    margin-top: 15px; /* Mais espaço antes do total */
}

/* BOTÃO FINALIZAR PEDIDO */
.checkout-button {
    background-color: #FFC72C; /* Amarelo do tema */
    color: #fff; /* Texto branco */
    border: none;
    border-radius: 30px; /* Bem arredondado */
    padding: 15px 25px; /* Mais preenchimento */
    font-size: 19px; /* Texto maior */
    font-weight: bold;
    width: 100%;
    margin-top: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-transform: uppercase; /* Texto em maiúsculas */
    letter-spacing: 0.5px; /* Espaçamento entre letras */
}

.checkout-button:active {
    background-color: #e0b000; /* Amarelo um pouco mais escuro ao clicar */
    transform: translateY(1px); /* Pequeno efeito de clique */
}

/* ESTILO QUANDO A SACOLA ESTÁ VAZIA */
.cart-items-list p {
    text-align: center;
    color: #777;
    margin-top: 30px;
    font-size: 18px;
    font-style: italic;
}

/* Media Queries para ajuste em telas menores */
@media (max-width: 480px) {
    .cart-modal-content {
        padding: 15px;
    }

    .cart-modal-header h2 {
        font-size: 22px;
    }

    .close-modal-button {
        font-size: 24px;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-name {
        font-size: 15px;
    }

    .cart-item-price {
        font-size: 14px;
    }

    .cart-item-quantity-button {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .cart-item-quantity-display {
        font-size: 15px;
    }

    .cart-item-remove {
        font-size: 18px;
    }

    .summary-line {
        font-size: 15px;
    }

    .summary-line.total-line {
        font-size: 20px;
    }

    .checkout-button {
        font-size: 17px;
        padding: 12px 20px;
    }
}