/* ─────────────────────────────────────────────────────────
   Bulli Swatches v1.1
   Custom Variation-Auswahl
     - pa_color → Color-Chip (Hex aus ACF swatch_color)
     - pa_size  → Text-Pill
   ───────────────────────────────────────────────────────── */

/* Native Selects für unterstützte Attribute verstecken (EN + DE Varianten) */
.variations select[name="attribute_pa_color"],
.variations select[name="attribute_pa_farbe"],
.variations select[name="attribute_pa_size"],
.variations select[name="attribute_pa_grosse"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* "Eigenschaft löschen"-Link bei Swatch-Zellen ausblenden */
.variations td.value:has(.bulli-swatches) .reset_variations {
    display: none;
}

/* ── Container ─────────────────────────────────────────── */
.bulli-swatches {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Ausgewählter Farbname (JS füllt .bulli-swatch-name__label) ── */
.bulli-swatch-name {
    margin: 4px 0 8px;
    min-height: 1.3em;         /* kein Layout-Sprung, wenn leer */
    font-size: 0.92rem;
    line-height: 1.3;
    color: var(--bk-text, #333);
}
.bulli-swatch-name__label {
    font-weight: 600;
}

/* ── Basis-Swatch ──────────────────────────────────────── */
.bulli-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1.5px solid var(--bk-border, #e8e8e8);
    cursor: pointer;
    user-select: none;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
}

.bulli-swatch:hover {
    border-color: var(--bk-border-dark, #999);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.bulli-swatch:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* Aktive Auswahl: schwarze Outline */
.bulli-swatch.is-active {
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

/* Disabled */
.bulli-swatch.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}


/* ── Variante: Color ───────────────────────────────────── */
.bulli-swatch--color {
    --swatch: #ccc;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 4px;
}

.bulli-swatch__chip {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Fallback wenn kein Hex gepflegt ist */
.bulli-swatch--color.no-color .bulli-swatch__chip {
    background:
        linear-gradient(135deg,
            transparent 47%, #d33 47%, #d33 53%, transparent 53%),
        repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/10px 10px;
}


/* ── Variante: Text (z.B. Größen) ──────────────────────── */
.bulli-swatch--text {
    min-width: 44px;
    height: 36px;
    padding: 0 14px;
    border-radius: 6px;
}

.bulli-swatch__text {
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    font-size: var(--body-small, 0.88rem);
    font-weight: 600;
    color: #222;
    line-height: 1;
    white-space: nowrap;
}


/* ── Block für [product_color_swatches] (Label + Liste) ── */
.bulli-swatches-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.bulli-swatches-block__label {
    display: block;
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #555;
}

.bulli-swatches-block .bulli-swatches {
    margin: 0;
}


/* ── Display-Only (Loop-Items, [product_color_swatches]) ─
   Reine Anzeige — kein Hover, kein Klick, kein Active-State
   ────────────────────────────────────────────────────── */
.bulli-swatches--display .bulli-swatch {
    cursor: default;
    pointer-events: none;
}

.bulli-swatches--display .bulli-swatch:hover {
    border-color: var(--bk-border, #e8e8e8);
    box-shadow: none;
}

/* Kompakte Größe für Loop-Items */
.bulli-swatches--sm {
    gap: 6px;
}

.bulli-swatches--sm .bulli-swatch--color {
    width: 20px;
    height: 20px;
    padding: 2px;
    border-width: 1px;
}


/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .bulli-swatches {
        gap: 8px;
    }

    .bulli-swatch--color {
        width: 32px;
        height: 32px;
    }

    .bulli-swatch--text {
        height: 34px;
        padding: 0 12px;
        min-width: 40px;
    }
}
