/* ──────────────────────────────────────────────────────────────
   Option-Group Control — Radio Button Group
   ──────────────────────────────────────────────────────────────
   Wiederverwendbare Radio-Button-Gruppe für 2–5 Optionen.
   Klassische runde Radio-Buttons, horizontal angeordnet.

   Nutzung:
     <div class="z-optgroup">
         <label class="z-optgroup-label">
             <input type="radio" name="my-group" value="a" checked> Option A
         </label>
         <label class="z-optgroup-label">
             <input type="radio" name="my-group" value="b"> Option B
         </label>
     </div>

   Farbe:  --z-control-active (#18B2CB) — gemeinsame Akzentfarbe
           für Radio-Buttons, Checkboxen und Switches.

   Abhängigkeiten:  Design-Tokens aus _layout.html
   ────────────────────────────────────────────────────────────── */

/* ── Container ─────────────────────────────────────────── */
.z-optgroup {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

/* ── Label (Radio + Text) ──────────────────────────────── */
.z-optgroup-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    color: var(--z-text-mid);
    transition: color 0.15s;
}

.z-optgroup-label:hover {
    color: var(--z-text);
}

/* ── Radio-Button Styling ──────────────────────────────── */
.z-optgroup-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 0.9rem;
    height: 0.9rem;
    border: 1.5px solid var(--z-border);
    border-radius: 50%;
    background: var(--z-bg-input);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    position: relative;
}

.z-optgroup-label input[type="radio"]:hover {
    border-color: var(--z-control-active, #18B2CB);
}

.z-optgroup-label input[type="radio"]:checked {
    border-color: var(--z-control-active, #18B2CB);
    background: var(--z-control-active, #18B2CB);
}

.z-optgroup-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: #fff;
}

/* Checked label text */
.z-optgroup-label:has(input:checked) {
    color: var(--z-text);
    font-weight: 500;
}

/* ── Disabled ──────────────────────────────────────────── */
.z-optgroup-label:has(input:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
}

.z-optgroup-label input[type="radio"]:disabled {
    cursor: not-allowed;
}
