/*
 * GM Unidade de Medida para WooCommerce
 * Versão 1.2.5
 */


/* =========================================================
   CONTAINER
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit,
.elementor .quantity.gmwu-has-unit,
.quantity.gmwu-has-unit {
    position: relative;
}


/* =========================================================
   INPUT - SOMENTE QUANDO HÁ UNIDADE
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit input.qty,
.elementor .quantity.gmwu-has-unit input.qty,
.quantity.gmwu-has-unit input.qty {
    box-sizing: border-box !important;

    /*
     * Número alinhado à esquerda.
     */
    text-align: left !important;

    /*
     * Início do número.
     */
    padding-left: 16px !important;

    /*
     * Espaço reservado para os botões personalizados.
     */
    padding-right: 25px !important;

    /*
     * Remove spinner nativo SOMENTE quando
     * o plugin está ativo naquele input.
     */
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}


/* =========================================================
   REMOVE SPINNER NATIVO
   SOMENTE QUANDO EXISTE UNIDADE
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit input.qty::-webkit-outer-spin-button,
.woocommerce .quantity.gmwu-has-unit input.qty::-webkit-inner-spin-button,
.elementor .quantity.gmwu-has-unit input.qty::-webkit-outer-spin-button,
.elementor .quantity.gmwu-has-unit input.qty::-webkit-inner-spin-button,
.quantity.gmwu-has-unit input.qty::-webkit-outer-spin-button,
.quantity.gmwu-has-unit input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;

    margin: 0 !important;

    background: transparent !important;
    background-color: transparent !important;

    border: 0 !important;
    box-shadow: none !important;
}


/* =========================================================
   UNIDADE
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .gmwu-unit,
.elementor .quantity.gmwu-has-unit .gmwu-unit,
.quantity.gmwu-has-unit .gmwu-unit {
    position: absolute !important;

    z-index: 6 !important;

    display: block;

    margin: 0 !important;

    width: auto !important;
    height: auto !important;

    pointer-events: none !important;
    user-select: none !important;

    white-space: nowrap !important;

    font-family: 'Poppins', sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;

    color: #042B18 !important;

    /*
     * O JS calcula a posição definitiva.
     */
    left: 0;
    top: 0;
}


/* =========================================================
   UNIDADE VAZIA
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .gmwu-unit:empty,
.elementor .quantity.gmwu-has-unit .gmwu-unit:empty,
.quantity.gmwu-has-unit .gmwu-unit:empty,
.gmwu-unit.gmwu-unit--hidden-input {
    display: none !important;
}


/* =========================================================
   STEPPER PERSONALIZADO
   SOMENTE É CRIADO PELO JS QUANDO EXISTE UNIDADE
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .gmwu-stepper,
.elementor .quantity.gmwu-has-unit .gmwu-stepper,
.quantity.gmwu-has-unit .gmwu-stepper {
    position: absolute !important;

    z-index: 8 !important;

    right: 8px !important;
    top: 50% !important;

    transform: translateY(-50%) !important;

    width: 12px !important;
    height: 26px !important;

    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;

    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 0 !important;

    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    border: none !important;
    box-shadow: none !important;
}


/* =========================================================
   BOTÕES DO STEPPER
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .gmwu-step-button,
.elementor .quantity.gmwu-has-unit .gmwu-step-button,
.quantity.gmwu-has-unit .gmwu-step-button {
    appearance: none !important;
    -webkit-appearance: none !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 12px !important;
    height: 12px !important;

    min-width: 0 !important;
    min-height: 0 !important;

    max-width: 12px !important;
    max-height: 12px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: none !important;
    border-radius: 0 !important;

    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    box-shadow: none !important;
    outline: none !important;

    cursor: pointer !important;

    font-size: 0 !important;
    line-height: 0 !important;
}


/* =========================================================
   HOVER / FOCUS / ACTIVE
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .gmwu-step-button:hover,
.woocommerce .quantity.gmwu-has-unit .gmwu-step-button:focus,
.woocommerce .quantity.gmwu-has-unit .gmwu-step-button:active,
.elementor .quantity.gmwu-has-unit .gmwu-step-button:hover,
.elementor .quantity.gmwu-has-unit .gmwu-step-button:focus,
.elementor .quantity.gmwu-has-unit .gmwu-step-button:active,
.quantity.gmwu-has-unit .gmwu-step-button:hover,
.quantity.gmwu-has-unit .gmwu-step-button:focus,
.quantity .gmwu-step-button:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    border: none !important;

    box-shadow: none !important;
    outline: none !important;
}


/* =========================================================
   REMOVE ::AFTER HERDADO
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .gmwu-step-button::after,
.elementor .quantity.gmwu-has-unit .gmwu-step-button::after,
.quantity .gmwu-step-button::after {
    content: none !important;

    display: none !important;
}


/* =========================================================
   SETA PARA CIMA
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .gmwu-step-up::before,
.elementor .quantity.gmwu-has-unit .gmwu-step-up::before,
.quantity .gmwu-step-up::before {
    content: '' !important;

    display: block !important;

    width: 0 !important;
    height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;

    border-left: 3px solid transparent !important;
    border-right: 3px solid transparent !important;

    border-bottom: 4px solid #042B18 !important;
    border-top: 0 !important;

    box-shadow: none !important;
}


/* =========================================================
   SETA PARA BAIXO
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .gmwu-step-down::before,
.elementor .quantity.gmwu-has-unit .gmwu-step-down::before,
.quantity .gmwu-step-down::before {
    content: '' !important;

    display: block !important;

    width: 0 !important;
    height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;

    border-left: 3px solid transparent !important;
    border-right: 3px solid transparent !important;

    border-top: 4px solid #042B18 !important;
    border-bottom: 0 !important;

    box-shadow: none !important;
}


/* =========================================================
   PLUS / MINUS DE TERCEIROS

   Só alteramos quando a quantity possui unidade.
   Assim produtos sem unidade permanecem intactos.
   ========================================================= */

.woocommerce .quantity.gmwu-has-unit .plus,
.woocommerce .quantity.gmwu-has-unit .minus,
.elementor .quantity.gmwu-has-unit .plus,
.elementor .quantity.gmwu-has-unit .minus,
.quantity.gmwu-has-unit .plus,
.quantity.gmwu-has-unit .minus {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    box-shadow: none !important;
}


/* =========================================================
   STICKY DO ELEMENTOR

   Não utilizamos visibility:visible na unidade.
   Portanto placeholders ocultos pelo Elementor
   continuam ocultos.
   ========================================================= */

.elementor-sticky__spacer .gmwu-unit,
.elementor-sticky__spacer .gmwu-stepper {
    pointer-events: none !important;
}