@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap');

/* Modal Carrinho */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    font-family: 'Lexend', sans-serif;
}

.modal-overlay.ativo {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.modal-carrinho {
    background-color: #ffffff;
    width: 700px;
    height: calc(100vh - 80px);
    max-height: 1767px;
    position: fixed;
    top: 80px;
    right: 0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modal-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    flex-shrink: 0;
}

.modal-titulo {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.modal-fechar {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-fechar:hover {
    background-color: #f0f0f0;
    color: #000;
}

.modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.carrinho-vazio {
    text-align: center;
    padding: 5rem 2rem;
    color: #666;
}

.carrinho-vazio p {
    font-size: 24px;
    margin-bottom: 1rem;
}

.item-carrinho {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.item-carrinho:last-child {
    border-bottom: none;
}

.item-imagem {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f5f5f5;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.item-nome {
    font-size: 16px;
    font-weight: 500;
    color: #000;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.item-detalhes {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px 0;
}

.item-preco {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.item-controles {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.quantidade-controle {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px;
}

.btn-quantidade {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-quantidade:hover {
    background-color: #f0f0f0;
    color: #000;
}

.quantidade-numero {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    min-width: 24px;
    text-align: center;
}

.btn-remover {
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    padding: 6px;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.btn-remover:hover {
    color: #dc3545;
}

.carrinho-resumo {
    padding: 2rem;
    border-top: 1px solid #e0e0e0;
    background-color: #fafafa;
    flex-shrink: 0;
}

.subtotal {
    margin-bottom: 1.5rem;
}

.subtotal-titulo {
    font-size: 18px;
    font-weight: 500;
    color: #000;
    margin: 0 0 6px 0;
}

.subtotal-info {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
}

.subtotal-valor {
    font-size: 24px;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.carrinho-acoes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-iniciar-compra {
    background-color: #28a745;
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Lexend', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-iniciar-compra:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.btn-continuar-comprando {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Lexend', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-continuar-comprando:hover {
    background-color: #333333;
}

/* Contador do Carrinho no Header */
.contador-carrinho {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.contador-carrinho.ativo {
    opacity: 1;
    transform: scale(1);
}

.contador-carrinho.animacao {
    animation: pulseCounter 0.6s ease;
}

@keyframes pulseCounter {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Responsividade */
@media (max-width: 1024px) {
    .modal-carrinho {
        width: 600px;
    }
    
    .modal-header {
        padding: 2rem 2rem 1.5rem;
    }
    
    .modal-titulo {
        font-size: 24px;
    }
    
    .modal-fechar {
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
    
    .modal-body {
        padding: 2rem;
    }
    
    .item-carrinho {
        gap: 1.5rem;
        padding: 1.5rem 0;
    }
    
    .item-imagem {
        width: 100px;
        height: 100px;
    }
    
    .item-nome {
        font-size: 18px;
    }
    
    .item-detalhes {
        font-size: 14px;
    }
    
    .item-preco {
        font-size: 20px;
    }
    
    .carrinho-resumo {
        padding: 2rem;
    }
    
    .subtotal-titulo {
        font-size: 20px;
    }
    
    .subtotal-valor {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .modal-carrinho {
        width: 100vw;
        height: 100vh;
        top: 0;
        right: 0;
        max-height: none;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-titulo {
        font-size: 20px;
    }
    
    .modal-fechar {
        top: 1rem;
        right: 1rem;
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .item-carrinho {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .item-imagem {
        width: 80px;
        height: 80px;
        align-self: flex-start;
    }
    
    .item-info {
        padding: 0;
    }
    
    .item-nome {
        font-size: 16px;
    }
    
    .item-detalhes {
        font-size: 12px;
    }
    
    .item-preco {
        font-size: 18px;
    }
    
    .item-controles {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }
    
    .quantidade-controle {
        gap: 8px;
        padding: 6px;
    }
    
    .btn-quantidade {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .quantidade-numero {
        font-size: 16px;
        min-width: 24px;
    }
    
    .carrinho-resumo {
        padding: 1.5rem;
    }
    
    .subtotal-titulo {
        font-size: 18px;
    }
    
    .subtotal-info {
        font-size: 14px;
    }
    
    .subtotal-valor {
        font-size: 24px;
    }
    
    .carrinho-acoes {
        gap: 12px;
    }
    
    .btn-iniciar-compra,
    .btn-continuar-comprando {
        padding: 16px 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 1rem;
    }
    
    .modal-titulo {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .carrinho-resumo {
        padding: 1rem;
    }
    
    .btn-iniciar-compra,
    .btn-continuar-comprando {
        padding: 14px 20px;
        font-size: 14px;
    }
}