/* ============================================================
   BestiBest — Currency Switcher
   Floating top-right chip, dark glassmorphism.
   ============================================================ */

.bb-currency-switcher {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1;
}

/* Push down when WP admin bar is showing */
.admin-bar .bb-currency-switcher { top: calc(16px + 32px); }
@media (max-width: 782px) {
    .admin-bar .bb-currency-switcher { top: calc(12px + 46px); }
}

/* ===== Toggle (chip) ===== */
.bb-currency-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg, rgba(18, 18, 18, 0.85));
    backdrop-filter: var(--glass-blur, blur(12px) saturate(180%));
    -webkit-backdrop-filter: var(--glass-blur, blur(12px) saturate(180%));
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--text-main, #F5F5F7);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}
.bb-currency-switcher__toggle:hover {
    border-color: var(--accent-gold, #F5A623);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.bb-currency-switcher__toggle:focus-visible {
    outline: 2px solid var(--accent-gold, #F5A623);
    outline-offset: 2px;
}

.bb-currency-switcher__flag {
    font-size: 1.05rem;
    line-height: 1;
    /* Force emoji font on Windows where flag glyphs may otherwise show as letter codes */
    font-family: 'Twemoji Mozilla', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
.bb-currency-switcher__code {
    letter-spacing: 0.02em;
}
.bb-currency-switcher__arrow {
    font-size: 0.625rem;
    opacity: 0.65;
    transition: transform 0.2s ease;
    margin-left: 2px;
}
.bb-currency-switcher__toggle[aria-expanded="true"] .bb-currency-switcher__arrow {
    transform: rotate(180deg);
}

/* ===== Dropdown menu ===== */
.bb-currency-switcher__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    animation: bb-cs-fade-in 0.15s ease;
}
.bb-currency-switcher__menu[hidden] { display: none; }

@keyframes bb-cs-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bb-currency-switcher__menu li { margin: 0; padding: 0; }

.bb-currency-switcher__menu li button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-main, #F5F5F7);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}
.bb-currency-switcher__menu li button:hover {
    background: rgba(255, 255, 255, 0.05);
}
.bb-currency-switcher__menu li button:focus-visible {
    outline: 2px solid var(--accent-gold, #F5A623);
    outline-offset: -2px;
}
.bb-currency-switcher__menu li button.is-active {
    background: rgba(245, 166, 35, 0.12);
    color: var(--accent-gold, #F5A623);
}
.bb-currency-switcher__menu li button .bb-currency-switcher__flag {
    font-size: 1.1rem;
}
.bb-currency-switcher__menu li button .bb-currency-switcher__name {
    margin-left: auto;
    color: var(--text-muted, #A1A1A6);
    font-size: 0.8rem;
    font-weight: 400;
}
.bb-currency-switcher__menu li button.is-active .bb-currency-switcher__name {
    color: rgba(245, 166, 35, 0.7);
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
    .bb-currency-switcher { top: 12px; right: 12px; }
    .bb-currency-switcher__toggle {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
    .bb-currency-switcher__menu {
        min-width: 200px;
        right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bb-currency-switcher__toggle,
    .bb-currency-switcher__arrow,
    .bb-currency-switcher__menu li button { transition: none; }
    .bb-currency-switcher__menu { animation: none; }
}
