/*
 * Campo de cantidad con - y + del pedido de Croster (/order.php).
 *
 * Lo monta assets/js/order-quantity.js sobre el slider (opcion con "Maximum
 * Allowed") o el campo sin botones (sin maximo) que devuelve el order.php de
 * Croster. Solo se carga en order.php (ver hooks.php).
 *
 * Paleta del Manual de Identidad 2024: navy #051c33, azul #005ff7.
 */

.hw-qty {
    --hw-qty-ink: #051c33;
    --hw-qty-blue: #005ff7;
    --hw-qty-text: #2a2e36;
    --hw-qty-muted: #6c7a93;
    --hw-qty-line: #d5dce5;
    --hw-qty-surface: #edf0f5;
    --hw-qty-red: #dd352e;
    display: block;
}

/* El nombre de la opcion igual en los dos casos (Croster usa <label> o <h5>). */
#product_config .hw-qty__title,
.hw-qty__title {
    display: block;
    margin: 0 0 10px;
    color: #2a2e36;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

/* style.min.css de Croster fija .product_config_container .control-label a 500 con !important. */
#product_config .product_config_container label.hw-qty__title {
    font-weight: 600 !important;
}

.hw-qty__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.hw-qty__control {
    display: inline-flex;
    align-items: stretch;
    height: 46px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--hw-qty-line);
    border-radius: 10px;
    transition: border-color 0.15s ease;
}

.hw-qty__control:focus-within {
    border-color: var(--hw-qty-blue);
}

.hw-qty.is-invalid .hw-qty__control {
    border-color: var(--hw-qty-red);
}

.hw-qty__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    margin: 0;
    padding: 0;
    color: var(--hw-qty-ink);
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    background: var(--hw-qty-surface);
    border: 0;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Solo con raton: en un movil el :hover se queda pegado al ultimo boton tocado. */
@media (hover: hover) {
    .hw-qty__btn:hover:not(:disabled) {
        color: #fff;
        background: var(--hw-qty-blue);
    }
}

.hw-qty__btn:active:not(:disabled) {
    color: #fff;
    background: var(--hw-qty-ink);
}

.hw-qty__btn:focus-visible {
    outline: 2px solid var(--hw-qty-blue);
    outline-offset: -2px;
}

.hw-qty__btn:disabled {
    color: #a9b4c4;
    background: #f4f6fb;
    cursor: not-allowed;
}

.hw-qty .hw-qty__input.form-control {
    width: 72px;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0 6px;
    color: var(--hw-qty-ink);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    background: #fff;
    border: 0;
    border-right: 1px solid var(--hw-qty-line);
    border-left: 1px solid var(--hw-qty-line);
    border-radius: 0;
    box-shadow: none;
}

.hw-qty .hw-qty__input.form-control:focus {
    box-shadow: inset 0 0 0 2px rgba(0, 95, 247, 0.25);
}

.hw-qty__unit {
    color: var(--hw-qty-text);
    font-size: 15px;
    font-weight: 500;
}

.hw-qty__hint {
    display: block;
    margin-top: 8px;
    color: var(--hw-qty-muted);
    font-size: 13px;
}

.hw-qty__error {
    display: block;
    margin-top: 4px;
    color: var(--hw-qty-red);
    font-size: 13px;
    font-weight: 500;
}

.hw-qty__error[hidden] {
    display: none;
}
