/**
 * Whole-Food Toggle — shared styles used by all ranking & comparison tools.
 * Enqueued as a dependency wherever the toggle appears.
 *
 * @since 1.6.1
 */

/* ── Toggle container ───────────────────────────────────────────────── */
.mipb-wf-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 6px 12px;
    background: #f0faf0;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
}

/* ── Hidden native checkbox ─────────────────────────────────────────── */
.mipb-wf-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* ── Custom slider track ────────────────────────────────────────────── */
.mipb-wf-slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: #ccc;
    transition: background .25s;
    flex-shrink: 0;
}

/* ── Slider knob ────────────────────────────────────────────────────── */
.mipb-wf-slider::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .25s;
}

/* ── Checked state ──────────────────────────────────────────────────── */
.mipb-wf-checkbox:checked + .mipb-wf-slider {
    background: #2e7d32;
}
.mipb-wf-checkbox:checked + .mipb-wf-slider::after {
    transform: translateX(16px);
}

/* ── Focus ring ─────────────────────────────────────────────────────── */
.mipb-wf-checkbox:focus-visible + .mipb-wf-slider {
    outline: 2px solid #2e7d32;
    outline-offset: 2px;
}

/* ── Label text ─────────────────────────────────────────────────────── */
.mipb-wf-label-text {
    font-size: .85rem;
    color: #333;
    font-weight: 500;
}

/* ── Mobile: full-width ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .mipb-wf-toggle {
        width: 100%;
        justify-content: center;
    }
}
