:root {
    --nmg-red: #e31b23;
    --nmg-red-dark: #b70810;
    --nmg-black: #101114;
    --nmg-muted: #70737c;
    --nmg-border: rgba(16, 17, 20, 0.11);
    --nmg-shadow: 0 28px 80px rgba(0, 0, 0, 0.26);
}

html.nmg-market-is-choosing,
body.nmg-market-is-choosing {
    overflow: hidden !important;
}

.nmg-market-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.nmg-market-modal.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.nmg-market-modal-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 15%, rgba(227, 27, 35, 0.24), transparent 35%), radial-gradient(circle at 90% 90%, rgba(255, 255, 255, 0.13), transparent 35%), rgb(4 5 7 / 74%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.nmg-market-dialog {
    position: relative;
    width: min(760px, 100%);
    padding: clamp(28px, 5vw, 54px);
    overflow: hidden;
  
    border-radius: 30px;
    background: #0000004f;
    box-shadow: var(--nmg-shadow);
    text-align: center;
    backdrop-filter: blur(12px);
}

.nmg-market-dialog::before {
    display: none;
    content: "";
    position: absolute;
    top: -170px;
    right: -170px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(227, 27, 35, 0.08);
}

.nmg-market-brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    margin-bottom: 18px;
}

.nmg-market-brand-logo {
    display: block;
    width: auto;
    max-width: 300px;
    max-height: 135px;
    object-fit: contain;
}

.nmg-market-brand-fallback {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: var(--nmg-black);
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -1px;
}

.nmg-market-eyebrow {
    position: relative;
    display: block;
    margin-bottom: 8px;
    color: var(--nmg-red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.nmg-market-dialog h2 {
    position: relative;
    max-width: 620px;
    margin: 0 auto 32px !important;
    color: #ffffff;
  
    line-height: 1.08 !important;
    letter-spacing: -0.035em;
    transform: none !important;
}

.nmg-market-switcher img.wp-smiley,
.nmg-market-switcher img.emoji {
    font-size: 22px;
}

.nmg-market-dialog > p {
    position: relative;
    max-width: 610px;
    margin: 0 auto 30px;
    color: var(--nmg-muted);
    font-size: 16px;
    line-height: 1.6;
}

.nmg-market-options {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.nmg-market-card {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 220px;
    width: 100%;
    padding: 18px;
    border: 1px solid var(--nmg-border);
    border-radius: 20px;
    background: #ffffff0d;
    color: var(--nmg-black);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.nmg-market-card:hover, .nmg-market-card:focus-visible {
    background: #fdfdfd00;
    box-shadow: 0 18px 42px rgba(227, 27, 35, 0.13);
    transform: translateY(-3px);
    outline: none;
    border: 3px solid white;
}

.nmg-market-flag {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 230px;
    height: 120px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.nmg-market-flag img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.nmg-market-card-copy {
    min-width: 0;
}

.nmg-market-card-copy strong,
.nmg-market-card-copy small {
    display: block;
}

.nmg-market-card-copy strong {
    margin-bottom: 0;
    font-size: 17px;
    line-height: 1.25;
    color: white;
}

.nmg-market-card-copy small {
    color: var(--nmg-muted);
    font-size: 12px;
    line-height: 1.35;
}

.nmg-market-arrow {
    color: var(--nmg-red);
    font-size: 24px;
    transition: transform 180ms ease;
}

.nmg-market-card:hover .nmg-market-arrow {
    transform: translateX(3px);
}

.nmg-market-memory-note {
    position: relative;
    display: block;
    margin-top: 23px;
    color: #92949a;
    font-size: 12px;
    line-height: 1.5;
}

.nmg-market-switcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2147482000;
    font-family: inherit;
}

.nmg-market-switcher-button {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 8px 13px 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(16, 17, 20, 0.94);
    color: #fff;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

.nmg-market-switcher-button:hover,
.nmg-market-switcher-button:focus-visible {
    background: #000;
    transform: translateY(-2px);
    outline: 2px solid rgba(227, 27, 35, 0.35);
    outline-offset: 2px;
}

.nmg-market-current-flag {
    font-size: 22px;
    line-height: 1;
}

.nmg-market-chevron {
    margin-left: 2px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
}

.nmg-market-switcher-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(290px, calc(100vw - 36px));
    padding: 8px;
    border: 1px solid rgba(16, 17, 20, 0.09);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nmg-market-switcher-menu[hidden] {
    display: none !important;
}

.nmg-market-menu-item {
    appearance: none;
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--nmg-black);
    text-align: left;
    cursor: pointer;
    line-height: 1.1;
}

.nmg-market-menu-item:hover,
.nmg-market-menu-item:focus-visible {
    background: #f4f4f5;
    outline: none;
}

.nmg-market-menu-item.is-active {
    background: #fff1f2;
}

.nmg-market-menu-item > span:first-child {
    font-size: 25px;
}

.nmg-market-menu-item strong,
.nmg-market-menu-item small {
    display: block;
}

.nmg-market-menu-item strong {
    margin-bottom: 2px;
    font-size: 13px;
}

.nmg-market-menu-item small {
    color: var(--nmg-muted);
    font-size: 11px;
}

.nmg-market-noscript {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2147483001;
    padding: 10px 14px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 12px;
}

.nmg-market-noscript a {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 680px) {
    
    .nmg-market-flag img {
    display: block;
    width: 100%;
    height: 70px;
    object-fit: cover;
}


    .nmg-market-modal {
        align-items: end;
        padding: 10px;
    }

    .nmg-market-dialog {
        max-height: calc(100dvh - 20px);
        padding: 28px 12px 22px;
        overflow-y: auto;
        border-radius: 26px;
        margin-bottom: 100px;
    }

    .nmg-market-brand {
        min-height: 44px;
        margin-bottom: 12px;
    }

    .nmg-market-brand-logo {
        max-width: 150px;
        max-height: 56px;
    }

    .nmg-market-brand-fallback {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        font-size: 20px;
    }

    .nmg-market-dialog h2 {
        font-size: 20px !important;
    }

    .nmg-market-dialog > p {
        margin-bottom: 20px;
        font-size: 14px;
    }

    .nmg-market-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .nmg-market-card {
        min-height: 150px;
        gap: 10px;
        padding: 10px 8px 12px;
        border-radius: 17px;
    }

    .nmg-market-flag {
        max-width: 132px;
        height: 72px;
        border-radius: 10px;
    }

    .nmg-market-card-copy strong {
        font-size: 12.5px;
        line-height: 1.2;
    }

    .nmg-market-switcher {
        right: 12px;
        bottom: 12px;
    }

    .nmg-market-switcher img {
       font-size: 26px;
    }


    .nmg-market-current-label {
        display: none;
    }

    .nmg-market-switcher-button {
        min-width: 52px;
        justify-content: center;
        padding: 8px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nmg-market-modal,
    .nmg-market-card,
    .nmg-market-arrow,
    .nmg-market-switcher-button {
        transition: none !important;
    }
}
