/**
 * Estilos para controles de quantidade
 * Compatível com o design Ella
 */

.ella-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

@media (min-width: 768px) {
    .ella-quantity-wrapper {
        justify-content: flex-start;
    }
}

.ella-quantity-label {
    font-weight: 600;
    color: #022A60;
    margin: 0;
    font-size: 1rem;
}

.ella-quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid #022A60;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
}

.ella-quantity-btn {
    background-color: #022A60;
    color: #FDB813;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.ella-quantity-btn:hover {
    background-color: #FDB813;
    color: #022A60;
}

.ella-quantity-btn:active {
    background-color: #FDB813;
    color: #022A60;
}

.ella-quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #022A60;
    background-color: #fff;
    outline: none;
    -moz-appearance: textfield;
}

.ella-quantity-input::-webkit-outer-spin-button,
.ella-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ella-quantity-input:focus {
    background-color: #f8f9fa;
}

/* Estados dos botões */
.ella-quantity-minus:disabled,
.ella-quantity-plus:disabled {
    background-color: #022A60;
    color: #FDB813;
    cursor: default;
}

.ella-quantity-minus:disabled:hover,
.ella-quantity-plus:disabled:hover {
    background-color: #022A60;
    color: #FDB813;
    cursor: not-allowed;
}

/* Estilos específicos para o carrinho */
.woocommerce-cart-form .ella-quantity-wrapper {
    justify-content: center;
    gap: 0;
}

.woocommerce-cart-form .product-quantity .ella-quantity-wrapper {
    display: inline-flex;
}

/* Responsividade */
@media (max-width: 767px) {
    .ella-quantity-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .ella-quantity-label {
        font-size: 0.9rem;
    }
    
    .ella-quantity-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .ella-quantity-input {
        width: 50px;
        height: 35px;
        font-size: 14px;
    }
    
    /* No carrinho, manter horizontal mesmo no mobile */
    .woocommerce-cart-form .ella-quantity-wrapper {
        flex-direction: row;
    }
}

/* Estilos para os blocos do WooCommerce (wc-block-components-quantity-selector) */
.wc-block-components-quantity-selector,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector {
    display: flex !important;
    align-items: center !important;
    border: 2px solid #022A60 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background-color: #fff !important;
    width: fit-content !important;
}

.wc-block-components-quantity-selector__input,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__input,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__input {
    width: 60px !important;
    height: 40px !important;
    border: none !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #022A60 !important;
    background-color: #fff !important;
    outline: none !important;
    -moz-appearance: textfield !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wc-block-components-quantity-selector__input::-webkit-outer-spin-button,
.wc-block-components-quantity-selector__input::-webkit-inner-spin-button,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__input::-webkit-outer-spin-button,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.wc-block-components-quantity-selector__input:focus,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__input:focus {
    background-color: #f8f9fa !important;
}

.wc-block-components-quantity-selector__button,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button,
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
    background-color: #022A60 !important;
    color: #FDB813 !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    user-select: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    opacity: 1 !important;
}

/* Garantir que o conteúdo dos botões (símbolos) seja amarelo */
.wc-block-components-quantity-selector__button *,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button *,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button * {
    color: #FDB813 !important;
}

.wc-block-components-quantity-selector__button:hover:not(:disabled),
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button:hover:not(:disabled),
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button:hover:not(:disabled) {
    background-color: #FDB813 !important;
    color: #022A60 !important;
}

/* No hover, o conteúdo dos botões deve ficar azul */
.wc-block-components-quantity-selector__button:hover:not(:disabled) *,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button:hover:not(:disabled) *,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button:hover:not(:disabled) * {
    color: #022A60 !important;
}

.wc-block-components-quantity-selector__button:active:not(:disabled),
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button:active:not(:disabled),
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button:active:not(:disabled) {
    background-color: #FDB813 !important;
    color: #022A60 !important;
}

/* No active, o conteúdo dos botões deve ficar azul */
.wc-block-components-quantity-selector__button:active:not(:disabled) *,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button:active:not(:disabled) *,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button:active:not(:disabled) * {
    color: #022A60 !important;
}

.wc-block-components-quantity-selector__button:disabled,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button:disabled,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button:disabled,
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled {
    background-color: #022A60 !important;
    color: #FDB813 !important;
    cursor: default !important;
    opacity: 1 !important;
}

/* Conteúdo dos botões desabilitados deve ser amarelo */
.wc-block-components-quantity-selector__button:disabled *,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button:disabled *,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button:disabled * {
    color: #FDB813 !important;
}

.wc-block-components-quantity-selector__button:disabled:hover,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button:disabled:hover,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button:disabled:hover,
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled:hover {
    background-color: #022A60 !important;
    color: #FDB813 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* Conteúdo dos botões desabilitados no hover mantém amarelo */
.wc-block-components-quantity-selector__button:disabled:hover *,
.wc-block-cart-item__quantity .wc-block-components-quantity-selector__button:disabled:hover *,
.wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button:disabled:hover * {
    color: #FDB813 !important;
}

/* Responsividade para blocos WooCommerce */
@media (max-width: 767px) {
    .wc-block-components-quantity-selector__button,
    .wc-block-cart-item__quantity .wc-block-components-quantity-selector__button,
    .wc-block-mini-cart__quantity .wc-block-components-quantity-selector__button {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
    
    .wc-block-components-quantity-selector__input,
    .wc-block-cart-item__quantity .wc-block-components-quantity-selector__input,
    .wc-block-mini-cart__quantity .wc-block-components-quantity-selector__input {
        width: 50px !important;
        height: 35px !important;
        font-size: 14px !important;
    }
}
