/* Currency Switcher - Premium styled, visible in topbar */
.af-currency-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Button - visible in topbar */
.af-current-currency {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.af-current-currency:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Dropdown - premium dark background for visibility in topbar */
.af-currency-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    min-width: 180px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: linear-gradient(180deg, #1a365d 0%, #0f2744 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10010;
    max-height: 60vh;
    overflow-y: auto;
}

.af-currency-switcher.is-open .af-currency-list {
    display: block;
}

.af-currency-list li {
    list-style: none;
    margin: 0;
}

.af-currency-list li a {
    display: block;
    padding: 10px 16px;
    color: #f0f4f8 !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    transition: background 0.2s;
}

.af-currency-list li a:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Topbar context - ensure visibility */
.wf_header-topbar .af-currency-switcher .af-current-currency {
    color: #fff;
}

.wf_header-topbar .af-currency-switcher.is-open .af-currency-list {
    display: block;
}

/*
 * Theme-only switcher uses a visible button + hidden <select> mirror.
 * Afriyah Multi-Currency header markup is select-only — it must stay visible.
 */
.af-currency-switcher:not(.afriyah-mc-header) .af-currency-select {
    display: none !important;
}

.af-currency-switcher.afriyah-mc-header .af-currency-select,
.af-currency-switcher.afriyah-mc-header .afriyah-currency-dropdown {
    display: inline-block !important;
    max-width: min(100%, 260px) !important;
    width: auto !important;
    min-width: 0 !important;
    max-height: 44px !important;
    height: auto !important;
    line-height: 1.2 !important;
    padding: 8px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: 8px;
    /* Solid field (not translucent) so text never sits on near-white; native <option> lists often ignore parent alpha */
    background-color: #122a4a !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    vertical-align: middle;
    box-sizing: border-box;
    color-scheme: dark;
}

/* Native <select> listbox must not inherit a huge min-height from legacy header rules */
.af-currency-switcher.afriyah-mc-header select {
    min-height: 0 !important;
}

/*
 * Dropdown rows: many browsers default to white popup + inherited color → white-on-white.
 * These rules apply where supported (Chrome/Edge/Firefox; Safari varies).
 */
.af-currency-switcher.afriyah-mc-header select option,
.af-currency-switcher.afriyah-mc-header select optgroup {
    background-color: #152d52 !important;
    color: #f1f5f9 !important;
}

.af-currency-switcher.afriyah-mc-header select option:checked,
.af-currency-switcher.afriyah-mc-header select option:hover {
    background-color: #1e4976 !important;
    color: #ffffff !important;
}

.af-currency-switcher.afriyah-mc-header .af-currency-select:focus,
.af-currency-switcher.afriyah-mc-header .afriyah-currency-dropdown:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Topbar must not clip dropdown */
.wf_header-topbar,
.wf_header-topbar .wf-container,
.wf_header-topbar .wf-row,
.wf_header-topbar .wf_navbar-right,
.wf_header-topbar .wf_navbar-list-right,
.af-topbar-currency {
    overflow: visible !important;
}

.af-topbar-currency {
    list-style: none;
    display: inline-flex;
    align-items: center;
}

/* Rate warning badge */
.af-currency-switcher.af-rates-stale .af-current-currency {
    border-color: #ffc107;
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.5);
}

/* Responsiveness for small screens */
@media (max-width: 480px) {
    .af-currency-switcher {
        width: 100%;
        justify-content: center;
    }
    .af-current-currency {
        width: 100%;
        justify-content: space-between;
        padding: 10px 16px;
    }
    .af-currency-list {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.4) !important;
        padding: 20px 0 30px !important;
        max-height: 70vh !important;
    }
    .af-currency-list li a {
        padding: 16px 24px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
}

/* First-visit currency prompt */
body.af-currency-prompt-open {
    overflow: hidden;
}

.af-currency-prompt {
    position: fixed;
    inset: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.af-currency-prompt[hidden] {
    display: none !important;
}

.af-currency-prompt__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 39, 0.55);
    backdrop-filter: blur(2px);
}

.af-currency-prompt__card {
    position: relative;
    max-width: 420px;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.af-currency-prompt__title {
    margin: 0 0 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0a1027;
}

.af-currency-prompt__text {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
}

.af-currency-prompt__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.af-currency-prompt__btn {
    min-height: 50px;
    border-radius: 50px;
    border: 2px solid #e0e0e0;
    background: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.af-currency-prompt__btn:hover {
    border-color: #fe4322;
    color: #fe4322;
}

.af-currency-prompt__btn--primary {
    background: #fe4322;
    border-color: #fe4322;
    color: #fff;
}

.af-currency-prompt__btn--primary:hover {
    background: #004d00;
    border-color: #004d00;
    color: #fff;
}

.af-currency-prompt__btn--ghost {
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
}

/* Main header (light background): switcher must stay readable */
.wf_header:not(.wf_header-dark) .af-currency-switcher .af-current-currency,
.site-header:not(.header-dark) .af-currency-switcher .af-current-currency {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    font-weight: 700;
}

.wf_header:not(.wf_header-dark) .af-currency-switcher .af-current-currency:hover,
.site-header:not(.header-dark) .af-currency-switcher .af-current-currency:hover {
    background: #fff;
    border-color: rgba(0, 100, 0, 0.35);
}

/* Multi-Currency <select> in light header rows (if ever moved off the blue topbar) */
.wf_header:not(.wf_header-dark) .af-currency-switcher.afriyah-mc-header .af-currency-select,
.wf_header:not(.wf_header-dark) .af-currency-switcher.afriyah-mc-header .afriyah-currency-dropdown,
.site-header:not(.header-dark) .af-currency-switcher.afriyah-mc-header select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.18) !important;
    color-scheme: light;
}

.wf_header:not(.wf_header-dark) .af-currency-switcher.afriyah-mc-header select option,
.site-header:not(.header-dark) .af-currency-switcher.afriyah-mc-header select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* Mobile topbar drawer: same contrast as desktop blue bar */
.wf_mobilenav-topbar-content .af-currency-switcher.afriyah-mc-header select,
.wf_mobilenav-topbar .af-currency-switcher.afriyah-mc-header select {
    background-color: #122a4a !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    color-scheme: dark;
}

/* Currency label slightly larger than meta links for hierarchy */
.af-currency-switcher .af-current-currency {
    font-size: 14px;
    letter-spacing: 0.02em;
}
