/*
 * Los selectores llevan .kohler-swatches-wrap por delante y !important en las
 * propiedades de layout a propósito. Element Pack convierte la tabla de
 * variaciones en un flex en columna (".variations{display:flex}" más adelante
 * en la hoja combinada), y sin esto cada muestra se estiraba a todo el ancho y
 * quedaban apiladas como una lista. El tema también pinta todo <button> con un
 * borde carmesí, que es de donde salían los recuadros rosados.
 */

.kohler-swatches-wrap {
    display: block !important;
    width: 100%;
}

.kohler-swatches-wrap .kohler-swatches-label {
    font-size: 0.95em;
    color: #6b6b6b;
    min-height: 1.3em;
    margin: 0 0 8px;
    line-height: 1.3;
}

.kohler-swatches-wrap .kohler-swatches-current {
    color: #222;
}

.kohler-swatches-wrap .kohler-swatches {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start;
    gap: 6px !important;
    margin: 0 0 4px;
    padding: 0;
    list-style: none;
}

.kohler-swatches-wrap .kohler-swatch {
    flex: 0 0 auto !important;
    width: 46px !important;
    height: 34px !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #d8d8d8 !important;
    border-radius: 4px !important;
    /* Con !important a proposito: una muestra sin imagen dejaba ver el fondo
       que el tema le da a cualquier <button> -rosa de marca, o azul marino
       segun el bloque-, y parecia un acabado mas. */
    background-color: #f2f2f2 !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: none !important;
    cursor: pointer;
    overflow: hidden;
    text-indent: -9999px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.kohler-swatches-wrap .kohler-swatch:hover {
    border-color: #9a9a9a !important;
}

.kohler-swatches-wrap .kohler-swatch:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Seleccionado: anillo blanco por dentro y borde oscuro por fuera, para que se
   distinga sobre acabados claros y oscuros por igual. */
.kohler-swatches-wrap .kohler-swatch.is-selected {
    border-color: #222 !important;
    box-shadow: inset 0 0 0 2px #fff !important;
}

/* Agotado (descontinuado sin stock): se atenúa y se cruza con una línea, para
   que se vea antes de hacer clic que ese acabado no se puede comprar. Sigue
   siendo clicable: WooCommerce muestra entonces "Out of stock". */
.kohler-swatches-wrap .kohler-swatch.is-agotado {
    opacity: 0.4;
    position: relative;
}
.kohler-swatches-wrap .kohler-swatch.is-agotado::after {
    content: "";
    position: absolute;
    left: -10%;
    top: 50%;
    width: 120%;
    border-top: 1px solid #555;
    transform: rotate(-35deg);
}
.kohler-swatches-wrap .kohler-swatch.is-agotado.is-selected {
    opacity: 0.6;
}

/* Acabados que no son un color -"Not Applicable"- se leen como texto: su
   imagen en el CDN son las letras "NA" dibujadas, que no informan nada. */
.kohler-swatches-wrap .kohler-swatch--text {
    width: auto !important;
    min-width: 46px !important;
    padding: 0 10px !important;
    background-image: none !important;
    background-color: #fff;
    color: #444 !important;
    font-size: 12px;
    line-height: 32px;
    text-indent: 0;
    white-space: nowrap;
}

.kohler-swatches-wrap.kohler-swatches--single .kohler-swatches-label {
    margin-bottom: 0;
}

/* El <select> original queda en el DOM, invisible: la propia JS de variaciones
   de WooCommerce lo sigue usando para resolver precio, stock e imagen. */
.kohler-swatches-wrap .kohler-swatches-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0 !important;
}
