/**
 * Capsule Pills — available on all themes
 * Applied when options_style=capsule on any dropdown or radio field.
 */

.tf-capsule-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.tf-capsule-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 999px;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    line-height: 1.4;
    outline: none;
}

.tf-capsule-pill:hover:not(.tf-capsule-active) {
    border-color: #9ca3af;
    background: #f9fafb;
}

.tf-capsule-pill.tf-capsule-active {
    border-color: var(--primary-color, #0d6efd);
    background: var(--primary-color, #0d6efd);
    color: #fff;
}

/* Override hover colour inside modern-capsule theme */
.teraforms-form-wrapper.theme-modern-capsule .tf-capsule-pill:hover:not(.tf-capsule-active) {
    border-color: var(--primary-color, #9ca3af);
    color: var(--primary-color, #374151);
}

/* Full-width pills on narrow screens for select (non-radio) capsule groups */
@media (max-width: 480px) {
    .tf-capsule-group:not(.tf-capsule-radio)[data-options-count] .tf-capsule-pill {
        width: 100%;
    }
    .tf-capsule-group:not(.tf-capsule-radio)[data-options-count="1"] .tf-capsule-pill,
    .tf-capsule-group:not(.tf-capsule-radio)[data-options-count="2"] .tf-capsule-pill,
    .tf-capsule-group:not(.tf-capsule-radio)[data-options-count="3"] .tf-capsule-pill,
    .tf-capsule-group:not(.tf-capsule-radio)[data-options-count="4"] .tf-capsule-pill {
        width: auto;
    }
}
