/* ==========================================================
   SINGLE PRODUCT PAGE — Native color swatch selector
   ========================================================== */

.wooco-swatches-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0 8px;
}

/* Each item is a wooco_component_product_selection_item so WPC's
   existing click handler and wooco_item_selected logic work as-is */
.wooco-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.wooco-swatch-btn {
    box-sizing: border-box;
    cursor: pointer;
    padding: 0;
    display: block;
    flex-shrink: 0;
    transition:
        transform     0.2s ease,
        box-shadow    0.2s ease,
        outline       0.15s ease,
        outline-offset 0.15s ease;
}

.wooco-swatch-btn:hover {
    /* Scale and shadow come from inline CSS generated from settings */
}

/* Selected state: outline is set via inline CSS from settings,
   but we zero the border so the outline ring stands alone */
.wooco_item_selected .wooco-swatch-btn {
    /* outline and outline-offset come from wp_add_inline_style */
}

.wooco-swatch-label {
    text-align: center;
    color: #555;
    line-height: 1.2;
    display: block;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Out-of-stock swatch state */
.wooco-swatch-oos {
    cursor: not-allowed;
    position: relative;
}

.wooco-swatch-oos .wooco-swatch-btn {
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.wooco-swatch-oos-overlay {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    /* background-color and opacity injected via inline CSS from settings */
}

/* OOS tooltip */
.wooco-swatch-tooltip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.3;
    z-index: 100;
    /* color, background, and position offsets injected via inline CSS from settings */
}

.wooco-swatch-oos:hover .wooco-swatch-tooltip {
    opacity: 1;
}


/* ==========================================================
   ARCHIVE / PRODUCT-CARD SWATCHES
   ========================================================== */

.wt-archive-swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    position: relative;
    z-index: 2;
}

.wt-archive-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wt-archive-swatch {
    transition:
        transform     0.2s ease,
        box-shadow    0.2s ease,
        outline       0.15s ease,
        outline-offset 0.15s ease,
        opacity       0.15s ease;
    flex-shrink: 0;
}

.wt-archive-swatch:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 3px;
}

.wt-archive-swatch-label {
    text-align: center;
    color: #666;
    display: block;
    line-height: 1.2;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
