/* ═══════════════════════════════════════════════════════════════
   FEF Country Based Pricing — Frontend Currency Selector
   Modeled on the .fef-dm-* dropmenu pattern so it feels native to
   FEF. Palette matches the rest of the plugin (slate + blue).
   ═══════════════════════════════════════════════════════════════ */

.fef-cbp {
    position: relative;
    display: inline-block;
    font-size: 14px;
    line-height: 1.4;
    --fef-cbp-blue: #2563eb;
    --fef-cbp-ink: #1e293b;
    --fef-cbp-muted: #64748b;
    --fef-cbp-border: #e2e8f0;
    --fef-cbp-hover: #f1f5f9;
}

/* ── Trigger ── */
.fef-cbp-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: #fff;
    color: var(--fef-cbp-ink);
    border: 1px solid var(--fef-cbp-border);
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    outline: none;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.fef-cbp-trigger:hover { border-color: #cbd5e1; }
.fef-cbp-trigger:focus-visible { border-color: var(--fef-cbp-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.fef-cbp-trigger[disabled] { cursor: default; opacity: .9; }

.fef-cbp-flag { font-size: 18px; line-height: 1; }
.fef-cbp-label { display: inline-flex; flex-direction: column; align-items: flex-start; }
.fef-cbp-country { font-weight: 600; font-size: 13px; }
.fef-cbp-currency { font-size: 12px; color: var(--fef-cbp-muted); }
.fef-cbp-inline .fef-cbp-label { flex-direction: row; align-items: center; gap: 6px; }
.fef-cbp-inline .fef-cbp-currency::before { content: "·"; margin-right: 6px; color: #cbd5e1; }

.fef-cbp-caret {
    margin-left: 2px;
    color: var(--fef-cbp-muted);
    font-size: 11px;
    transition: transform .2s ease;
}
.fef-cbp.fef-cbp-open .fef-cbp-caret { transform: rotate(180deg); }
.fef-cbp-locked .fef-cbp-caret { display: none; }

/* ── Panel ── */
.fef-cbp-panel {
    position: absolute;
    z-index: 9999;
    top: 100%;
    left: 0;
    margin-top: 8px;
    min-width: 240px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--fef-cbp-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.fef-cbp-panel-right { left: auto; right: 0; }
.fef-cbp.fef-cbp-open .fef-cbp-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fef-cbp-panel-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 8px 10px 6px;
    margin: 0;
}

/* ── Options ── */
.fef-cbp-list { list-style: none; margin: 0; padding: 0; }
.fef-cbp-item { margin: 0; padding: 0; }
.fef-cbp-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 7px;
    padding: 9px 10px;
    color: var(--fef-cbp-ink);
    cursor: pointer;
    font: inherit;
    transition: background .15s ease;
}
.fef-cbp-opt:hover { background: var(--fef-cbp-hover); }
.fef-cbp-opt-flag { font-size: 18px; line-height: 1; width: 22px; text-align: center; }
.fef-cbp-opt-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fef-cbp-opt-name { font-weight: 500; font-size: 14px; }
.fef-cbp-opt-cur { font-size: 12px; color: var(--fef-cbp-muted); }
.fef-cbp-opt-check { color: var(--fef-cbp-blue); font-size: 13px; opacity: 0; }
.fef-cbp-item.is-active .fef-cbp-opt { background: #eff6ff; }
.fef-cbp-item.is-active .fef-cbp-opt-check { opacity: 1; }

/* Busy state while switching */
.fef-cbp.is-busy .fef-cbp-trigger { opacity: .6; pointer-events: none; }
.fef-cbp-spin {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--fef-cbp-blue);
    border-radius: 50%;
    animation: fef-cbp-spin .8s linear infinite;
}
@keyframes fef-cbp-spin { to { transform: rotate(360deg); } }

/* Locked notice (restriction on) */
.fef-cbp-note {
    font-size: 12px;
    color: var(--fef-cbp-muted);
    padding: 8px 10px 4px;
    border-top: 1px solid var(--fef-cbp-border);
    margin-top: 4px;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .fef-cbp-panel {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) translateY(-6px);
        width: calc(100vw - 32px);
    }
    .fef-cbp.fef-cbp-open .fef-cbp-panel { transform: translateX(-50%) translateY(0); }
}

/* Elementor entrance-animation visibility fix (mirrors dropmenu module) */
.elementor-widget-fef_country_selector.elementor-invisible,
.elementor-widget-fef_country_selector.elementor-invisible > .elementor-widget-container,
.elementor-widget-fef_country_selector .fef-cbp,
.elementor-widget-fef_country_selector .fef-cbp-trigger {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════════
   PLACEMENT MODES — sticky corner, rollout edge-tab, floating bar
   ═══════════════════════════════════════════════════════════════ */

/* Leading icon + compact trigger */
.fef-cbp-icon { display: inline-flex; align-items: center; font-size: 16px; line-height: 1; color: var(--fef-cbp-blue); }
.fef-cbp-icon svg { width: 1em; height: 1em; fill: currentColor; }
.fef-cbp-compact-code { font-weight: 600; font-size: 13px; }

/* Panel that opens UPWARD (sticky bottom corners) */
.fef-cbp-up .fef-cbp-panel { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 8px; transform: translateY(6px); }
.fef-cbp-up.fef-cbp-open .fef-cbp-panel { transform: translateY(0); }

/* ── Sticky (floating corner) ── */
.fef-cbp-sticky {
    position: fixed;
    z-index: 99990;
    display: inline-block;
}
.fef-cbp-sticky .fef-cbp-trigger { box-shadow: 0 6px 20px rgba(15,23,42,.18); }
.fef-cbp-pos-top-left     { top: var(--fef-cbp-y,20px);    left: var(--fef-cbp-x,20px); }
.fef-cbp-pos-top-right    { top: var(--fef-cbp-y,20px);    right: var(--fef-cbp-x,20px); }
.fef-cbp-pos-bottom-left  { bottom: var(--fef-cbp-y,20px); left: var(--fef-cbp-x,20px); }
.fef-cbp-pos-bottom-right { bottom: var(--fef-cbp-y,20px); right: var(--fef-cbp-x,20px); }

/* ── Rollout (edge tab that slides a panel out) ── */
.fef-cbp-rollout {
    position: fixed;
    z-index: 99990;
    top: var(--fef-cbp-y, 40%);
}
.fef-cbp-rollout .fef-cbp-trigger {
    box-shadow: 0 6px 20px rgba(15,23,42,.18);
    border-radius: 10px;
}
.fef-cbp-edge-right { right: 0; }
.fef-cbp-edge-left  { left: 0; }
/* Tuck the tab against the edge; nudge it out on hover/open */
.fef-cbp-edge-right .fef-cbp-trigger { border-top-right-radius: 0; border-bottom-right-radius: 0; transform: translateX(4px); transition: transform .2s ease; }
.fef-cbp-edge-left  .fef-cbp-trigger { border-top-left-radius: 0;  border-bottom-left-radius: 0;  transform: translateX(-4px); transition: transform .2s ease; }
.fef-cbp-edge-right:hover .fef-cbp-trigger,
.fef-cbp-edge-right.fef-cbp-open .fef-cbp-trigger { transform: translateX(0); }
.fef-cbp-edge-left:hover .fef-cbp-trigger,
.fef-cbp-edge-left.fef-cbp-open .fef-cbp-trigger { transform: translateX(0); }
/* Panel opens beside the tab */
.fef-cbp-edge-right .fef-cbp-panel { top: 0; right: 100%; left: auto; margin: 0 8px 0 0; transform: translateX(6px); }
.fef-cbp-edge-left  .fef-cbp-panel { top: 0; left: 100%;  right: auto; margin: 0 0 0 8px; transform: translateX(-6px); }
.fef-cbp-edge-right.fef-cbp-open .fef-cbp-panel,
.fef-cbp-edge-left.fef-cbp-open .fef-cbp-panel { transform: translateX(0); }

/* ── Bar (full-width fixed) ── */
.fef-cbp-bar {
    position: fixed;
    left: 0; right: 0;
    z-index: 99990;
    display: flex;
    justify-content: center;
    padding: 8px 16px;
    background: #fff;
    box-shadow: 0 0 24px rgba(15,23,42,.12);
}
.fef-cbp-bar-top    { top: 0; border-bottom: 1px solid var(--fef-cbp-border); }
.fef-cbp-bar-bottom { bottom: 0; border-top: 1px solid var(--fef-cbp-border); }
.fef-cbp-bar .fef-cbp-trigger { border: none; }
.fef-cbp-bar.fef-cbp-bar-bottom .fef-cbp-panel { top: auto; bottom: 100%; margin-bottom: 12px; }
.fef-cbp-bar .fef-cbp-panel { left: 50%; transform: translateX(-50%) translateY(-6px); }
.fef-cbp-bar.fef-cbp-open .fef-cbp-panel { transform: translateX(-50%) translateY(0); }

/* Keep fixed placements clear of small screens */
@media (max-width: 480px) {
    .fef-cbp-sticky .fef-cbp-panel,
    .fef-cbp-rollout .fef-cbp-panel { min-width: 200px; }
}