/* Activación: clase galo-product-add-to-cart en el widget Add To Cart. */
.galo-product-add-to-cart {
    --galo-product-ink: #061130;
    --galo-product-paper: #fff6f4;
    --galo-product-border: #d3bfbc;
    --galo-product-hover: #f7e7e3;
    --galo-product-focus: #576697;
}

/* Ancho completo del widget; el espaciado exterior sigue en Elementor. */
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart {
    width: 100%;
}

/* Sin JavaScript se conservan el campo y el formulario de WooCommerce. */
.galo-product-quantity-button[hidden] { display: none !important; }

/* Diseño estático desde el primer render, sin depender del arranque del JS. */
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart {
    --button-spacing: 0px; /* Evita sumar el margen nativo de Elementor al gap. */
    width: 100%;
    margin: 0;
}
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart:not(.variations_form),
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .woocommerce-variation-add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* El clearfix de WooCommerce crea ítems vacíos en flex y añade gaps laterales. */
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart::before,
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart::after,
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .woocommerce-variation-add-to-cart::before,
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .woocommerce-variation-add-to-cart::after {
    content: none;
    display: none;
}

/* Marco de cantidad, con el input nativo entre los dos botones. */
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .quantity.galo-product-quantity {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    box-sizing: border-box;
    min-width: 116px;
    width: auto;
    max-width: 100%;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--galo-product-border);
    border-radius: 0;
    background: transparent;
    overflow: visible;
}
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .quantity.galo-product-quantity input.qty {
    appearance: textfield;
    -moz-appearance: textfield;
    flex: 1 1 42px;
    box-sizing: border-box;
    width: 42px;
    min-width: 42px;
    max-width: 80px;
    height: 42px;
    margin: 0;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--galo-product-ink);
    font: 400 16px/1.4 "Nunito Sans", Arial, sans-serif;
    text-align: center;
    box-shadow: none;
    transition: none;
}
.galo-product-quantity input.qty::-webkit-inner-spin-button,
.galo-product-quantity input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Restar y sumar: botones reales, con SVG de 16 px. */
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .galo-product-quantity-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    box-sizing: border-box;
    width: 36px;
    min-width: 0;
    height: 42px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--galo-product-ink);
    line-height: 1;
    box-shadow: none;
    transform: none;
    cursor: pointer;
    transition: background-color .15s ease;
}
.galo-product-quantity-button svg {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    fill: none;
    pointer-events: none;
}
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .galo-product-quantity-button:disabled {
    opacity: .4;
    cursor: default;
}

/* Se estiliza el submit existente, sin sustituir texto, datos ni validaciones. */
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 180px;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    max-width: 384px;
    min-height: 48px;
    height: auto;
    margin: 0;
    padding: 8px 16px;
    border: 1px solid var(--galo-product-ink);
    border-radius: 3px;
    background: var(--galo-product-ink);
    color: var(--galo-product-paper);
    font: 500 16px/1.4 "Nunito Sans", Arial, sans-serif;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
    transform: none;
    transition: background-color .15s ease;
}

/* Bolsa decorativa. ::after sigue disponible para el estado nativo de WooCommerce. */
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .single_add_to_cart_button::before {
    content: "";
    order: 1;
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: var(--galo-product-bag) center / contain no-repeat;
    mask: var(--galo-product-bag) center / contain no-repeat;
}
.galo-product-add-to-cart {
    --galo-product-bag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 10a4 4 0 0 1-8 0M3.103 6.034h17.794M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z'/%3E%3C/svg%3E");
}

/* Foco visible para teclado, sin animación de bordes ni pérdida de feedback. */
.elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart :is(.galo-product-quantity-button, .quantity.galo-product-quantity input.qty, .single_add_to_cart_button):focus-visible {
    outline: 2px solid var(--galo-product-focus);
    outline-offset: 2px;
    box-shadow: none;
}

/* Hover solo con cursor preciso. Los botones deshabilitados siguen nativos. */
@media (hover: hover) and (pointer: fine) {
    .elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .galo-product-quantity-button:not(:disabled):hover {
        background: var(--galo-product-hover);
        color: var(--galo-product-ink);
    }
    .elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart .single_add_to_cart_button:not(:disabled):not(.disabled):hover {
        background: #061130e6;
        color: var(--galo-product-paper);
    }
}
@media (prefers-reduced-motion: reduce) {
    .elementor-element.galo-product-add-to-cart.elementor-widget-woocommerce-product-add-to-cart form.cart :is(.galo-product-quantity-button, .single_add_to_cart_button) {
        transition: none;
    }
}
