/* === CARRINHO POPUP (DESKTOP E MOBILE) === */
.cart-popup {
    position: fixed; /* Trava na tela, rolando ou não */
    top: -100%; /* Escondido lá no teto igual ao login */
    right: 5%; /* Fica no canto direito no PC */
    width: 90%;
    max-width: 350px; /* Um pouco mais largo que o login para os produtos caberem bem */
    background-color: var(--cor-branco);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 12px;
    z-index: 9999;
    
    /* A mesma animação suave do login */
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    display: flex;
    flex-direction: column;
}

/* Quando recebe o clique, ele desce */
.cart-popup.active {
    top: 120px; 
}

/* === ESTRUTURA INTERNA DO CARRINHO === */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.cart-header h3 {
    color: var(--cor-verde-escuro);
    font-size: 1.1rem;
    margin: 0;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #888;
    cursor: pointer;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

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

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: #f9f9f9;
    padding: 5px;
}

.cart-item-info {
    flex: 1;
    margin-left: 15px;
    padding-right: 25px;
}

.cart-item-info h4 {
    font-size: 0.9rem;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.cart-item-info p {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cor-verde-primario);
    margin: 0;
}

.btn-remover {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background-color: #ff4d4d;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    transition: background 0.3s;
}

.btn-remover:hover {
    background-color: #cc0000;
}

.cart-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

/* === AJUSTE PARA CENTRALIZAR NO MOBILE (IDÊNTICO AO LOGIN) === */
@media (max-width: 768px) {
    .cart-popup {
        right: 50%;
        transform: translateX(50%);
    }
}