/**
 * RLabs Swatches - estilos base.
 * Prefijo .rlsw- en todo para evitar colisiones con Astra / tema hijo.
 * Especificidad reforzada en selectores clave porque Astra suele
 * traer sus propios estilos de tabla/botón en .variations y .cart.
 */

.rlsw-variations.variations {
    border: none;
}

.rlsw-variations.variations td.label {
    vertical-align: top;
    padding-top: 8px;
}

.rlsw-swatch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

button.rlsw-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 0;
    margin: 0;
    position: relative;
    transition: border-color 0.15s ease;
}

button.rlsw-swatch--selected {
    border-color: #333;
}

button.rlsw-swatch--unavailable {
    opacity: 0.35;
    cursor: not-allowed;
    position: relative;
}

button.rlsw-swatch--outofstock {
    position: relative;
    cursor: not-allowed;
    opacity: 0.55;
    border-color: #ddd;
}

button.rlsw-swatch--outofstock:hover {
    border-color: #ddd;
}

.rlsw-swatch-outofstock-x {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.rlsw-swatch-outofstock-x::before,
.rlsw-swatch-outofstock-x::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 8%;
    right: 8%;
    height: 2px;
    background-color: #d32f2f;
}

.rlsw-swatch-outofstock-x::before {
    transform: rotate(45deg);
}

.rlsw-swatch-outofstock-x::after {
    transform: rotate(-45deg);
}

/* Color */
button.rlsw-swatch--color {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    padding: 3px;
}

.rlsw-swatch-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Imagen */
button.rlsw-swatch--image {
    width: 48px;
    height: 48px;
    overflow: hidden;
}

.rlsw-swatch-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botón de texto */
button.rlsw-swatch--button {
    min-width: 42px;
    height: 34px;
    padding: 0 10px;
}

.rlsw-swatch-label {
    font-size: 13px;
    font-weight: 600;
}

/* Mensaje de zona / entrega */
.rlsw-zone-info {
    margin: 10px 0;
    font-size: 13px;
}

.rlsw-availability-message {
    color: #b32d2e;
    font-weight: 600;
}

.rlsw-delivery-message {
    color: #2e7d32;
}

/* Loop / catálogo */
.rlsw-loop-swatches {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.rlsw-loop-swatch-group {
    display: flex;
    gap: 4px;
}

.rlsw-loop-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
}

.rlsw-loop-swatch-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.rlsw-loop-swatch-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}
