/**
 * WooCommerce Checkout Quantity Manager - Estilos
 */

/* Container dos controles de quantidade */
.wcqm-quantity-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    flex-wrap: nowrap;
}

/* Grupo de botões de quantidade */
.wcqm-qty-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

/* Botões de aumentar/diminuir */
.wcqm-qty-btn {
    background: #f7f7f7;
    border: none;
    color: #333;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 12px;
    transition: all 0.3s ease;
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcqm-qty-btn:hover:not(:disabled) {
    background: #A7D763;
    color: #fff;
}

.wcqm-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wcqm-qty-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Display de quantidade */
.wcqm-qty-display {
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    width: 50px;
    height: 35px;
    font-size: 14px;
    font-weight: 600;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    user-select: none;
}

/* Botão de remover (lixeira) */
.wcqm-qty-remove {
    background: #dc3545;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.wcqm-qty-remove:hover:not(:disabled) {
    background: #c82333;
    transform: scale(1.05);
}

.wcqm-qty-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wcqm-qty-remove:active:not(:disabled) {
    transform: scale(0.95);
}

/* Ícone da lixeira */
.wcqm-qty-remove::before {
    content: "🗑️";
    font-size: 16px;
}

/* Mensagem de carrinho vazio */
.wcqm-empty-cart {
    animation: wcqmFadeIn 0.5s ease-in;
}

@keyframes wcqmFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.processing .wcqm-qty-btn,
.processing .wcqm-qty-remove {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsividade */
@media (max-width: 768px) {
    .wcqm-quantity-controls {
        display: inline-flex;
        flex-wrap: nowrap;
    }
    
    .wcqm-qty-wrapper {
        display: inline-flex;
    }
}

/* Estilo para a linha do produto no checkout */
.woocommerce-checkout-review-order-table .product-name {
    display: block;
}

.woocommerce-checkout-review-order-table .product-name .wcqm-quantity-controls {
    display: inline-flex;
    margin-left: 10px;
    vertical-align: middle;
}

/* Ajustes para tema padrão WooCommerce */
.woocommerce table.shop_table .wcqm-quantity-controls {
    margin: 0;
    display: inline-flex;
}

/* Estilo para informações do produto */
.wcqm-product-info {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    font-weight: normal;
}

/* Animação de atualização */
@keyframes wcqmPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.wcqm-updating {
    animation: wcqmPulse 1s infinite;
}

/* Estilo do botão "Ver Créditos" */
.wcqm-empty-cart .button {
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wcqm-empty-cart .button:hover {
    background: #005177 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip para botões desabilitados */
.wcqm-qty-btn[disabled],
.wcqm-qty-remove[disabled] {
    position: relative;
}

.wcqm-qty-btn[disabled]::after,
.wcqm-qty-remove[disabled]::after {
    content: "Aguarde...";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.wcqm-qty-btn[disabled]:hover::after,
.wcqm-qty-remove[disabled]:hover::after {
    opacity: 1;
}

/* Compatibilidade com temas populares */

/* Storefront */
.storefront .wcqm-quantity-controls {
    margin-top: 8px;
}

/* Astra */
.ast-separate-container .wcqm-quantity-controls {
    margin-top: 10px;
}

/* OceanWP */
.oceanwp-theme .wcqm-quantity-controls {
    margin-top: 8px;
}

/* Flatsome */
.flatsome-theme .wcqm-quantity-controls {
    margin-top: 10px;
}
