.custom-swatches-container { font-family: inherit; margin-bottom: 25px; }
.swatch-item {
    border-radius: 4px;
    display: inline-block;
    position: relative;
    border: 1px solid #ddd;
    padding: 2px;
    transition: 0.2s;
    cursor: pointer;
    line-height: 0;
}
.swatch-item img { transition: transform 0.3s ease; display: block; object-fit: cover; }
.swatch-item:hover img { transform: scale(1.1); }

.swatch-item .wy-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
}
.swatch-item:hover .wy-tooltip {
    visibility: visible;
    opacity: 1;
}

.swatch-item.out-of-stock .line-1,
.swatch-item.out-of-stock .line-2 {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #000;
    z-index: 5;
    pointer-events: none;
}
.swatch-item.out-of-stock .line-1 { transform: rotate(45deg); }
.swatch-item.out-of-stock .line-2 { transform: rotate(-45deg); }
.swatch-item.out-of-stock img { opacity: 0.4; }

.swatch-filter-wrapper {
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
    width: fit-content;
}
.swatches-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   SWATCH CONTROLS & FILTER SYSTEM ALIGNMENT
   ========================================================================== */

/* Main layout wrapper bar for the interactive filters */
.swatch-controls-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px; /* Uniform horizontal grid spacing between layout blocks */
    margin-bottom: 20px;
}

/* Base structural label rules to ensure matching typographic scale */
.swatch-controls-wrapper .swatch-filter-wrapper,
.swatch-controls-wrapper .swatch-group-filter-wrapper {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    margin: 0;
    cursor: pointer;
}

/* Checkbox horizontal spacing alignment */
.swatch-controls-wrapper .swatch-filter-wrapper input[type="checkbox"] {
    margin: 0 8px 0 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* Normalizing the layout presentation of the native select field element */
.swatch-controls-wrapper .swatch-group-filter-wrapper select {
    margin-left: 8px;
    padding: 6px 32px 6px 12px; /* Leaves room for clean typography and custom icons */
    font-size: 14px;
    font-weight: normal;
    color: #444;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    line-height: 1.2;
    height: auto;
    box-shadow: none;
    transition: border-color 0.15s ease-in-out;
}

/* Subtle focus enhancement when the selector dropdown is active */
.swatch-controls-wrapper .swatch-group-filter-wrapper select:focus {
    border-color: #777;
    outline: none;
}