/*!
 * CURCY - WooCommerce Multi Currency
 * Modern currency switcher skin.
 *
 * Visual layer only: it restyles the floating currency switcher into a compact
 * pill trigger + dropdown panel. No pricing / switching logic depends on it.
 *
 * Every colour is exposed as a CSS custom property on
 * `.woocommerce-multi-currency.wmc-sidebar.wmc-modern`, so the shop owner can
 * retheme it from Appearance > Custom CSS (or the plugin Custom CSS box)
 * without touching this file, e.g.
 *
 *   .woocommerce-multi-currency.wmc-modern { --wmc-accent: #0a7c4a; }
 */

/* -------------------------------------------------------------------------
 * Container
 * ---------------------------------------------------------------------- */
.woocommerce-multi-currency.wmc-sidebar.wmc-modern {
    --wmc-accent: #1b2d9e;
    --wmc-accent-hover: #15248a;
    --wmc-accent-soft: #eef1ff;
    --wmc-surface: #ffffff;
    --wmc-row-hover: #f4f6ff;
    --wmc-text: #101828;
    --wmc-muted: #5b6478;
    --wmc-border: rgba(16, 24, 40, .09);
    --wmc-shadow: 0 18px 40px rgba(16, 24, 40, .18);
    --wmc-trigger-shadow: 0 6px 18px rgba(27, 45, 158, .28);
    --wmc-radius: 12px;
    --wmc-trigger-radius: 10px;
    --wmc-panel-width: 268px;
    --wmc-offset: 8px;

    top: 50%;
    transform: translateY(-50%);
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern.wmc-left {
    left: var(--wmc-offset) !important;
    right: auto !important;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern.wmc-right {
    right: var(--wmc-offset) !important;
    left: auto !important;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    font-size: inherit !important;
    box-shadow: none !important;
}

/* The pill replaces the old "+" affordance. */
.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-sidebar-open {
    display: none !important;
}

/* -------------------------------------------------------------------------
 * Trigger pill
 * ---------------------------------------------------------------------- */
.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    border: 0 !important;
    border-radius: var(--wmc-trigger-radius) !important;
    background: var(--wmc-accent) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    text-shadow: none !important;
    cursor: pointer;
    box-shadow: var(--wmc-trigger-shadow) !important;
    transition: background .2s ease, box-shadow .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-trigger:hover,
.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-trigger:focus {
    background: var(--wmc-accent-hover) !important;
    color: #fff !important;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-trigger:focus-visible {
    outline: 3px solid rgba(27, 45, 158, .35);
    outline-offset: 2px;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-trigger svg {
    display: block;
    flex: 0 0 auto;
    fill: none !important;
    stroke: #fff !important;
    color: #fff !important;
    opacity: 1 !important;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-globe {
    width: 19px;
    height: 19px;
    stroke-width: 1.6;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-arrow {
    width: 13px;
    height: 13px;
    stroke-width: 2.4;
    margin-left: 1px;
    transition: transform .2s ease;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern.wmc-modern-open .wmc-modern-arrow {
    transform: rotate(180deg);
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-current {
    display: inline-block;
    color: #fff !important;
    text-shadow: none !important;
    opacity: 1 !important;
    white-space: nowrap;
}

/* -------------------------------------------------------------------------
 * Caption under the pill (the switcher title)
 * ---------------------------------------------------------------------- */
.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-title {
    display: block !important;
    visibility: visible !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 7px 2px 0 !important;
    background: none !important;
    color: var(--wmc-accent) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-align: center !important;
    transition: none !important;
}

/* -------------------------------------------------------------------------
 * Dropdown panel
 * ---------------------------------------------------------------------- */
.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 2;
    box-sizing: border-box;
    min-width: var(--wmc-panel-width);
    max-width: calc(100vw - 32px);
    max-height: 60vh;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--wmc-surface);
    border: 1px solid var(--wmc-border);
    border-radius: var(--wmc-radius);
    box-shadow: var(--wmc-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    -webkit-overflow-scrolling: touch;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern.wmc-right .wmc-modern-panel {
    left: auto;
    right: 0;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern.wmc-drop-up .wmc-modern-panel {
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateY(6px);
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern.wmc-modern-open .wmc-modern-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-panel::-webkit-scrollbar {
    width: 6px;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-panel::-webkit-scrollbar-thumb {
    background: rgba(16, 24, 40, .18);
    border-radius: 6px;
}

/* -------------------------------------------------------------------------
 * Rows
 * ---------------------------------------------------------------------- */
.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-currency {
    display: block !important;
    visibility: visible !important;
    float: none !important;
    clear: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    border-radius: 8px;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-align: left !important;
    transition: none !important;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-currency + .wmc-currency {
    margin-top: 2px !important;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-currency a.wmc-currency-redirect {
    box-sizing: border-box;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 11px;
    width: 100% !important;
    height: auto !important;
    padding: 9px 11px !important;
    border-radius: 8px;
    background: transparent;
    color: var(--wmc-text) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    text-align: left !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background .15s ease;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-currency a.wmc-currency-redirect:hover {
    background: var(--wmc-row-hover);
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-currency.wmc-active a.wmc-currency-redirect {
    background: var(--wmc-accent-soft);
    cursor: default;
}

/* Flag chip: the shared 60x40 sprite scaled down to a 24x16 rounded chip. */
.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-flag {
    position: relative;
    flex: 0 0 auto;
    display: block;
    width: 24px;
    height: 16px;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .14);
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-flag .vi-flag-64 {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px !important;
    height: 40px !important;
    margin: 0 !important;
    transform: scale(.4);
    transform-origin: 0 0;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-code {
    flex: 0 0 auto;
    min-width: 42px;
    color: var(--wmc-text) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--wmc-muted) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-check {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--wmc-accent) !important;
    stroke: var(--wmc-accent) !important;
    stroke-width: 2.6;
    fill: none !important;
    opacity: 0;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-currency.wmc-active .wmc-modern-check {
    opacity: 1;
}

.woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-currency.wmc-active .wmc-modern-code {
    color: var(--wmc-accent) !important;
}

/* -------------------------------------------------------------------------
 * RTL / right placement
 * ---------------------------------------------------------------------- */
.rtl .woocommerce-multi-currency.wmc-sidebar.wmc-modern,
.rtl .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-currency,
.rtl .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-currency a.wmc-currency-redirect {
    text-align: right !important;
}

.rtl .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies .wmc-currency a.wmc-currency-redirect {
    flex-direction: row-reverse !important;
}

.rtl .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-trigger {
    flex-direction: row-reverse;
}

/* -------------------------------------------------------------------------
 * Small screens
 * ---------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .woocommerce-multi-currency.wmc-sidebar.wmc-modern {
        --wmc-offset: 6px;
        --wmc-panel-width: 240px;
        width: auto !important;
        top: 50% !important;
        right: auto;
        bottom: auto !important;
        padding: 0 !important;
        background: none !important;
        transform: translateY(-50%) !important;
    }

    .woocommerce-multi-currency.wmc-sidebar.wmc-modern.wmc-right {
        left: auto !important;
    }

    .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-trigger {
        padding: 10px 14px !important;
        font-size: 14px !important;
    }

    .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-list-currencies {
        position: relative;
        top: auto;
        width: auto !important;
        max-height: none;
        margin: 0 !important;
        overflow: visible;
        transform: none;
    }

    .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-panel {
        max-height: 50vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-panel,
    .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-arrow,
    .woocommerce-multi-currency.wmc-sidebar.wmc-modern .wmc-modern-trigger {
        transition: none !important;
    }
}
