/* ============================================================
   FILTRO COLOR: swatches circulares
   ============================================================
   Aplica solo a los items dentro del filtro de atributo "color"
   usando el selector data-wp-key="attribute/color-{slug}".
   El input[type=checkbox] se oculta visualmente pero sigue
   siendo funcional para la Interactivity API de WooCommerce.
   ============================================================ */

/* Contenedor del swatch */
[data-wp-key^="attribute/color-"] .wc-block-product-filter-checkbox-list__input-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ocultar el input visualmente pero mantenerlo funcional */
[data-wp-key^="attribute/color-"] .wc-block-product-filter-checkbox-list__input {
    opacity: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
    margin: 0;
    border-radius: 50%;
    
}

/* Ocultar el SVG de checkmark nativo */
[data-wp-key^="attribute/color-"] .wc-block-product-filter-checkbox-list__mark {
    display: none !important;
    
}

/* Círculo de color (pseudo-elemento del wrapper) */
[data-wp-key^="attribute/color-"] .wc-block-product-filter-checkbox-list__input-wrapper::before {
    content: "";
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--ja-swatch-color, #cccccc);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    opacity: 1 !important;

}

/* Estado seleccionado: anillo exterior del color del swatch */
[data-wp-key^="attribute/color-"] .wc-block-product-filter-checkbox-list__input-wrapper:has(input:checked)::before {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ja-swatch-color, #cccccc);
    transform: translate(-50%, -50%) scale(0.85);
}

/* Hover */
[data-wp-key^="attribute/color-"] .wc-block-product-filter-checkbox-list__label:hover
    .wc-block-product-filter-checkbox-list__input-wrapper::before {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Alinear label horizontalmente */
[data-wp-key^="attribute/color-"] .wc-block-product-filter-checkbox-list__label {
    display: flex;
    align-items: center;
    gap: 8px;
}
