/* =========================
   CARRINHO - ESTILOS
   ========================= */

/* Seletor de quantidade */
.qty-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    color: #495057;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e9ecef;
    color: var(--primary-color, #2a7a4b);
}

.qty-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 2px solid #dee2e6;
    border-right: 2px solid #dee2e6;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Botão Adicionar ao Carrinho */
.btn-add-cart {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    background: var(--primary-color, #2a7a4b);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-add-cart:hover:not(:disabled) {
    background: var(--primary-dark, #1f5c38);
    transform: translateY(-1px);
}

.btn-add-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-add-cart .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-add-cart.loading .spinner {
    display: inline-block;
}

.btn-add-cart.loading .btn-icon {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Área de ação do carrinho (qty + botão) */
.cart-action-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Toast notifications */
.cart-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 340px;
}

.cart-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.cart-toast.success {
    background: #198754;
}

.cart-toast.error {
    background: #dc3545;
}

.cart-toast i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Animação bounce no contador do carrinho */
@keyframes cartBounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.5); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.cart-count.bounce {
    animation: cartBounce 0.4s ease;
}

/* Responsive */
@media (max-width: 576px) {
    .cart-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .cart-action-area {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-add-cart {
        justify-content: center;
    }
}
