/* ================================================================
 * assets/css/variantes.css
 * Sistema de Variaciones de Productos (mig 052).
 * --------------------------------------------------------------
 * Pills y swatches para selección de variantes en la ficha pública.
 * Compatible con Bootstrap 5 + tokens de marca del proyecto.
 * ================================================================ */

.ws-variantes__grupo.is-disabled .ws-variantes__pill,
.ws-variantes__grupo.is-disabled .ws-variantes__swatch {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.ws-variantes__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 36px;
    padding: 0.375rem 0.875rem;
    border: 1.5px solid #dee2e6;
    border-radius: 999px;
    background: #fff;
    color: var(--ws-gris, #353535);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.ws-variantes__pill:hover:not(:disabled) {
    border-color: var(--ws-azul, #137fd9);
    color: var(--ws-azul, #137fd9);
}

.ws-variantes__pill.active {
    border-color: var(--ws-azul, #137fd9);
    background: var(--ws-azul, #137fd9);
    color: #fff;
    box-shadow: 0 0 0 0.15rem rgba(19, 127, 217, 0.2);
}

/* La regla :hover general tiene mayor especificidad por el :not() y
   pintaría el texto azul sobre fondo azul. La activa en hover mantiene
   texto blanco y oscurece el fondo para dar feedback. */
.ws-variantes__pill.active:hover:not(:disabled) {
    border-color: var(--ws-azul-hover, #0f6cb3);
    background: var(--ws-azul-hover, #0f6cb3);
    color: #fff;
}

.ws-variantes__pill:disabled,
.ws-variantes__pill[disabled] {
    text-decoration: line-through;
    background: #f8f9fa;
    color: #adb5bd;
}

.ws-variantes__swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.ws-variantes__swatch:hover:not(:disabled) {
    transform: scale(1.08);
}

.ws-variantes__swatch.active {
    border-color: var(--ws-azul, #137fd9);
    box-shadow: 0 0 0 0.2rem rgba(19, 127, 217, 0.25);
}

.ws-variantes__swatch.active::after {
    content: "\F26B"; /* bi-check */
    font-family: "bootstrap-icons";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.ws-variantes__swatch:disabled,
.ws-variantes__swatch[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ================================================================
 * Stepper de cantidad del detalle (ws-detalle-stepper)
 * Píldora "− N +" con tope = stock disponible + hint de disponibles.
 * Tokens de marca: --ws-azul, --ws-azul-hover, --ws-gris-claro,
 * --ws-gris-medio, --ws-fondo, --ws-superficie.
 * ================================================================ */
.ws-detalle-stepper-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.ws-detalle-stepper__titulo {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ws-gris, #353535);
}

.ws-detalle-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    background: var(--ws-superficie, #fff);
    border: 1.5px solid var(--ws-gris-claro, #e9ecef);
    border-radius: 999px;
    padding: 0.2rem;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.ws-detalle-stepper:focus-within {
    border-color: var(--ws-azul, #137fd9);
}

.ws-detalle-stepper__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--ws-fondo, #f7f7f7);
    color: var(--ws-gris, #353535);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.ws-detalle-stepper__btn:not(:disabled):hover {
    background: var(--ws-azul, #137fd9);
    color: #fff;
}

.ws-detalle-stepper__btn:not(:disabled):active {
    transform: scale(0.93);
}

.ws-detalle-stepper__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ws-detalle-stepper__input {
    width: 3ch;
    min-width: 3ch;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ws-gris, #353535);
    padding: 0;
}

.ws-detalle-stepper__input:focus {
    outline: none;
}

.ws-detalle-stepper__hint {
    color: var(--ws-gris-medio, #6c757d);
}

/* Stepper apagado (producto con variantes sin selección): atenuar todo */
.ws-detalle-stepper-wrap[data-ws-stepper-off="1"] .ws-detalle-stepper {
    opacity: 0.55;
}

/* Chip de variante en el carrito (chip gris con borde sutil) */
.ws-variantes-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    margin-top: 0.25rem;
    background: #f1f3f5;
    color: var(--ws-gris-medio, #6c757d);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
}
.ws-variantes-chip::before {
    content: "\F46E"; /* bi-tag */
    font-family: "bootstrap-icons";
    font-size: 0.75rem;
}