/* ── Search Mode Button Bar ─────────────────────────────────── */
.cfesa-sm-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding: 6px;
    background: #f1f3f5;
    border-radius: 14px;
    width: fit-content;
}

.cfesa-sm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.cfesa-sm-btn:hover {
    background: #e2e6ea;
    color: #222;
}

.cfesa-sm-btn--active {
    background: #ffffff;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    font-weight: 600;
}

.cfesa-sm-btn__icon {
    font-size: 16px;
    line-height: 1;
}

.cfesa-sm-btn__label {
    letter-spacing: 0.01em;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .cfesa-sm-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .cfesa-sm-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ── Location Search (searchable country list) ──────────────── */
.cfesa-loc-cascade {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.cfesa-loc-cascade .is-hidden {
    display: none !important;
}

/* Native <select> stays in the DOM (source of truth) but is hidden from view. */
.cfesa-loc-native {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    pointer-events: none;
}

/* Top trigger / selected-label display ("change location"). */
.cfesa-loc-trigger {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #d8dde2;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #1a1a2e;
    line-height: 1.2;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cfesa-loc-trigger:hover {
    border-color: #b9c0c7;
}

.cfesa-loc-cascade.is-open .cfesa-loc-trigger {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12);
}

.cfesa-loc-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8a909a;
}

.cfesa-loc-trigger-label.is-selected {
    color: #1a1a2e;
    font-weight: 600;
}

.cfesa-loc-trigger-caret {
    flex: 0 0 auto;
    font-size: 12px;
    color: #8a909a;
    transition: transform 0.2s ease;
}

.cfesa-loc-cascade.is-open .cfesa-loc-trigger-caret {
    transform: rotate(180deg);
}

/* Dropdown panel. */
.cfesa-loc-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #e0e4e8;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.cfesa-loc-search-wrap {
    padding: 10px;
    border-bottom: 1px solid #eef0f3;
}

.cfesa-loc-search {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d8dde2;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.cfesa-loc-search:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12);
}

.cfesa-loc-options {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.cfesa-loc-option {
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #2b2f38;
    cursor: pointer;
    transition: background 0.12s ease;
}

.cfesa-loc-option:hover {
    background: #f1f4ff;
}

.cfesa-loc-option.is-active {
    background: #e7ecff;
    color: #1a1a2e;
    font-weight: 600;
}

.cfesa-loc-option.is-hidden {
    display: none;
}

.cfesa-loc-noresults {
    padding: 14px 12px;
    text-align: center;
    font-size: 13px;
    color: #8a909a;
}

.cfesa-loc-clear {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #888;
    line-height: 1;
}

.cfesa-loc-clear:hover {
    color: #d33;
}