/* =============================================================
   Nexus – Archive / Shop Swatches CSS
   ============================================================= */

.nexus-archive-swatches {
    margin: 8px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nexus-archive-attribute {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

/* ---------------------------------------------------------------
   Base archive swatch (compact — 24px default)
   ------------------------------------------------------------- */
.nexus-archive-swatch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;        /* overridden per-container via JS */
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition:
        border-color  0.15s ease,
        outline-color 0.15s ease,
        transform     0.12s ease,
        box-shadow    0.15s ease;
    flex-shrink: 0;
}

.nexus-archive-swatch:hover {
    border-color: #555;
    transform: scale(1.12);
    box-shadow: 0 1px 5px rgba(0,0,0,.18);
}

.nexus-archive-swatch.selected {
    border-color: #111;
    box-shadow: 0 0 0 2px #111;
    transform: scale(1.05);
}

.nexus-archive-swatch:focus-visible {
    outline-color: #005fcc;
    border-color: #005fcc;
}

/* ---------------------------------------------------------------
   Colour inner
   ------------------------------------------------------------- */
.nexus-archive-swatch .nexus-swatch__color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

/* ---------------------------------------------------------------
   Image inner
   ------------------------------------------------------------- */
.nexus-archive-swatch img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------------------------------------------------------------
   Label inner
   ------------------------------------------------------------- */
.nexus-archive-attribute[data-type="label"] .nexus-archive-swatch {
    width: auto !important;
    height: auto !important;
    border-radius: 3px;
    border: 1.5px solid #ccc;
    background: #fff;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #444;
}

.nexus-archive-attribute[data-type="label"] .nexus-archive-swatch:hover {
    border-color: #333;
    background: #f5f5f5;
}

.nexus-archive-attribute[data-type="label"] .nexus-archive-swatch.selected {
    border-color: #111;
    background: #111;
    color: #fff;
}

/* ---------------------------------------------------------------
   Tooltip
   ------------------------------------------------------------- */
.nexus-archive-swatch[data-tooltip="1"]::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    background: rgba(17,17,17,.85);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 100;
}

.nexus-archive-swatch[data-tooltip="1"]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------------------------------------------------------------
   Out-of-stock overlay badge on swatch
   ------------------------------------------------------------- */
.nexus-archive-swatch.out-of-stock {
    cursor: not-allowed;
}

/* Blur style */
body.nexus-disabled-blur .nexus-archive-swatch.out-of-stock {
    opacity: 0.3;
    pointer-events: none;
}

/* Strikethrough style */
body.nexus-disabled-strikethrough .nexus-archive-swatch.out-of-stock::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - 1px),
        rgba(180,0,0,.7) 50%,
        transparent calc(50% + 1px)
    );
    z-index: 5;
    pointer-events: none;
}

/* Hide style */
body.nexus-disabled-hide .nexus-archive-swatch.out-of-stock {
    display: none !important;
}

/* ---------------------------------------------------------------
   Ajax price update
   ------------------------------------------------------------- */
.nexus-archive-price-placeholder {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-top: 4px;
    min-height: 20px;
    animation: nexusFadeIn 0.2s ease;
}

/* ---------------------------------------------------------------
   Card image swap animation
   ------------------------------------------------------------- */
.nexus-image-swap-out {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.nexus-image-swap-in {
    opacity: 1;
    transition: opacity 0.2s ease;
}
