/* ===== From Foshan to Global Markets — v2 (click-to-zoom) additions =====
   Loaded after global-markets.css, only when the v2 module is rendered. */
.gm-v2 .gm-map { position: relative; }
.gm-v2 .gm-stage { position: relative; overflow: hidden; border-radius: 4px; }
.gm-v2 .gm-svg { overflow: hidden; touch-action: manipulation; }
.gm-v2 .gm-sea { fill: #faf8f4; }
.gm-v2 .gm-land {
    fill: var(--gm-land);
    stroke: #fff;
    stroke-width: .8px;
    vector-effect: non-scaling-stroke;
    stroke-linejoin: round;
}
/* Faint borders appear as the map zooms in, so neighbours stay readable as reference */
.gm-v2 .gm-map:not([data-active="all"]) .gm-land.gm-land-detailed { stroke: #d9cfbd; stroke-width: .7px; }
.gm-v2 .gm-country {
    fill: var(--gm-land);
    stroke: #fff;
    stroke-width: .8px;
    vector-effect: non-scaling-stroke;
    stroke-linejoin: round;
    transition: fill .35s ease, stroke .35s ease;
}
.gm-v2 .gm-map:not([data-active="all"]) .gm-country { stroke: #d9cfbd; stroke-width: .7px; }
.gm-v2 .gm-country.is-region { fill: #e6d7b6; cursor: pointer; }
.gm-v2 .gm-country.is-region:hover { fill: #dcc79c; }
.gm-v2 .gm-country.is-selected,
.gm-v2 .gm-country.is-selected:hover { fill: #d2a24c; stroke: #7a521c; stroke-width: 1.8px; }
/* Country view: neighbours go back to neutral land so the selected market stands out */
.gm-v2 .gm-map:not([data-country=""]) .gm-country.is-region:not(.is-selected) { fill: #ede6d8; }
.gm-v2 .gm-map:not([data-country=""]) .gm-country.is-region:not(.is-selected):hover { fill: #e4d6b8; }
.gm-v2 .gm-map:not([data-country=""]) .gm-route:not(.is-active) { opacity: .08; }

/* Country arc from Foshan */
.gm-v2 .gm-route-country,
.gm-v2 .gm-route-country-flow { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.gm-v2 .gm-route-country { stroke: #b8893c; stroke-width: 2px; opacity: .95; }
.gm-v2 .gm-route-country-flow { stroke: #fff6df; stroke-width: 1.4px; stroke-dasharray: 3 15; animation: gm-flow 1.6s linear infinite; }
.gm-v2 .gm-map[data-country=""] .gm-route-country,
.gm-v2 .gm-map[data-country=""] .gm-route-country-flow { display: none; }
.gm-v2 .gm-map:not([data-country=""]) .gm-route.is-active { opacity: .45; }
.gm-v2 .gm-map:not([data-country=""]) .gm-route-flow.is-active { display: none; }

/* Zoomed views: region nodes/labels give way to market pins */
.gm-v2 .gm-map:not([data-active="all"]) .gm-node { opacity: 0 !important; pointer-events: none; }

/* Market pins (constant screen size) */
.gm-v2 .gm-pin { display: none; cursor: pointer; outline: none; }
.gm-v2 .gm-pin.is-shown { display: inline; }
.gm-v2 .gm-pin-hit { fill: transparent; }
.gm-v2 .gm-pin-dot { fill: #b8893c; stroke: #fff; stroke-width: 1.8px; transition: fill .2s ease; }
.gm-v2 .gm-pin:hover .gm-pin-dot { fill: #8c6224; }
.gm-v2 .gm-pin:focus-visible .gm-pin-hit { fill: none; stroke: var(--gm-gold); stroke-width: 3px; }
.gm-v2 .gm-pin.is-selected { visibility: hidden; }

/* Selected-country marker */
.gm-v2 .gm-focus { display: none; pointer-events: none; }
.gm-v2 .gm-focus.is-on { display: inline; }
.gm-v2 .gm-focus-halo { fill: #8c6224; opacity: .16; }
.gm-v2 .gm-focus-pulse {
    fill: #8c6224; opacity: .35;
    transform-box: fill-box; transform-origin: center;
    animation: gm-focus-pulse 2s ease-out infinite;
}
.gm-v2 .gm-focus-disc { fill: #8c6224; stroke: #fff; stroke-width: 1.5px; }
.gm-v2 .gm-focus-ring { fill: none; stroke: #fff; stroke-width: 2.4px; }
.gm-v2 .gm-focus-dot { fill: #e2bd6a; }
@keyframes gm-focus-pulse {
    0%   { transform: scale(1);   opacity: .38; }
    100% { transform: scale(2.1); opacity: 0; }
}

/* Tooltip card */
.gm-v2 .gm-tip {
    --gm-tip-arrow: 50%;
    position: absolute;
    left: 0; top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 13px 8px 10px;
    background: #2b2b2b;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    will-change: transform;
}
.gm-v2 .gm-tip[hidden], .gm-v2 .gm-tip.is-off { display: none; }
.gm-v2 .gm-tip::after {
    content: "";
    position: absolute;
    left: var(--gm-tip-arrow);
    bottom: -6px;
    width: 12px; height: 12px;
    margin-left: -6px;
    background: #2b2b2b;
    transform: rotate(45deg);
    border-radius: 2px;
}
.gm-v2 .gm-tip.is-below::after { bottom: auto; top: -6px; }
.gm-v2 .gm-tip-flag {
    flex: 0 0 24px;
    width: 24px; height: 16px;
    border-radius: 2px;
    background-repeat: no-repeat;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .55);
}
.gm-v2 .gm-tip-flag[hidden] { display: none; }
.gm-v2 .gm-tip-name { position: relative; z-index: 1; }

/* Reset Map */
.gm-v2 .gm-reset {
    position: absolute;
    top: 8px; right: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid #e3d9c6;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--gm-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: opacity .2s ease, border-color .2s ease;
}
.gm-v2 .gm-reset svg { width: 16px; height: 16px; fill: none; stroke: var(--gm-gold-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gm-v2 .gm-reset:hover { border-color: var(--gm-gold); }
.gm-v2 .gm-reset.is-idle { opacity: .6; }
.gm-v2 .gm-reset:focus { outline: none; }
.gm-v2 .gm-reset:focus-visible { outline: 3px solid var(--gm-gold); outline-offset: 2px; opacity: 1; }

/* Select Your Target Market */
.gm-v2 .gm-markets { margin-top: 16px; }
.gm-v2 .gm-markets-title { font-size: 17px; margin: 0 0 6px; color: var(--gm-ink); }
.gm-v2 .gm-markets-hint { font-size: 14px; color: var(--color-text-light); margin: 0; }
.gm-v2 .gm-markets.has-region .gm-markets-hint { display: none; }
.gm-v2 .gm-market-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.gm-v2 .gm-market-list[hidden] { display: none; }
.gm-v2 .gm-market {
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid #e3d9c6;
    border-radius: 6px;
    background: #fff;
    color: var(--gm-ink);
    font: inherit;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.gm-v2 .gm-market:hover { border-color: var(--gm-gold); color: var(--gm-gold-deep); }
.gm-v2 .gm-market[aria-pressed="true"] { background: #8c6224; border-color: #8c6224; color: #fff; }
.gm-v2 .gm-market:focus { outline: none; }
.gm-v2 .gm-market:focus-visible { outline: 3px solid var(--gm-gold); outline-offset: 2px; }

@media (max-width: 768px) {
    .gm-v2 .gm-stage { border-radius: 0; display: flex; flex-direction: column; }
    /* Small screens: Reset sits under the map so it never covers the zoomed area */
    .gm-v2 .gm-reset { position: static; align-self: flex-end; margin: 6px 10px 0 0; padding: 8px 14px; font-size: 13px; box-shadow: none; }
    .gm-v2 .gm-tip { font-size: 15px; padding: 7px 11px 7px 9px; }
    .gm-v2 .gm-markets { margin-top: 14px; }
    .gm-v2 .gm-market { padding: 9px 12px; font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .gm-v2 .gm-focus-pulse { animation: none; opacity: .2; transform: scale(1.5); }
    .gm-v2 .gm-route-country-flow { animation: none; display: none; }
    .gm-v2 .gm-country, .gm-v2 .gm-market, .gm-v2 .gm-reset { transition: none; }
}
