/* =========================================================
   EVCompareHub - Charging Map Page
   File: /ev/charging-map.css
========================================================= */

:root {
    --cm-green: #174b35;
    --cm-green-2: #27845f;
    --cm-soft-green: #edf8f2;
    --cm-orange: #f47b20;
    --cm-red: #ef4d3f;
    --cm-text: #111827;
    --cm-muted: #667085;
    --cm-border: #e5e7eb;
    --cm-line: #edf0f5;
    --cm-bg: #ffffff;
    --cm-card: #ffffff;
    --cm-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

html,
body {
    background: #fff !important;
    color: var(--cm-text);
    font-family: Inter, "Sarabun", "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color-scheme: light;
}

.cm-page {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 44px;
}

.cm-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
    margin: 0 0 16px;
    padding: 22px 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, #102017 0%, #174b35 100%);
    color: #fff;
    box-shadow: var(--cm-shadow);
}

.cm-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.cm-hero h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.cm-hero p {
    max-width: 820px;
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 15px;
    line-height: 1.65;
}

.cm-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cm-main-btn,
.cm-secondary-btn,
.cm-location-btn,
.cm-clear-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.cm-main-btn,
.cm-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.cm-main-btn {
    background: #fff;
    color: #111827;
}

.cm-secondary-btn {
    background: rgba(255,255,255,.11);
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
}

.cm-shell {
    position: relative;
    display: block !important;
    min-height: 50dvh;
    border-radius: 16px;
    overflow: hidden;
}

.cm-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 620px;
    max-height: 620px;
    border-right: 1px solid var(--cm-border);
    background: #fff;
    overflow: auto;
}

.cm-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 16px 12px;
    border-bottom: 1px solid var(--cm-line);
}

.cm-panel-head h2 {
    margin: 0;
    color: #1f2937;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.cm-panel-head p {
    margin: 4px 0 0;
    color: var(--cm-muted);
    font-size: 13px;
}

.cm-clear-btn {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.cm-search-box {
    padding: 14px 16px;
    border-bottom: 1px solid var(--cm-line);
}

.cm-search-box input {
    width: 100%;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid var(--cm-border);
    border-radius: 12px;
    outline: none;
    background: #f8fafc;
    color: #111827;
    font-size: 14px;
    font-family: inherit;
}

.cm-search-box input:focus {
    border-color: #b7dccd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(39,132,95,.10);
}

.cm-filter-group {
    padding: 14px 16px;
    border-bottom: 1px solid var(--cm-line);
}

.cm-filter-group h3 {
    margin: 0 0 10px;
    color: #1f2937;
    font-size: 15px;
    font-weight: 900;
}

.cm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cm-chip {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--cm-border);
    background: #fff;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.cm-chip:hover {
    background: #f8fafc;
}

.cm-chip.active {
    background: var(--cm-green);
    border-color: var(--cm-green);
    color: #fff;
}

.cm-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #344054;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.cm-check-row input {
    width: 18px;
    height: 18px;
}

.cm-location-btn {
    margin: 14px 16px;
    min-height: 42px;
    border-radius: 12px;
    background: var(--cm-green);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

.cm-result-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--cm-line);
    border-bottom: 1px solid var(--cm-line);
    background: #f8fafc;
}

.cm-result-head strong {
    color: #111827;
    font-size: 14px;
    font-weight: 900;
}

.cm-result-head span {
    color: var(--cm-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.cm-station-list {
    display: grid;
    gap: 0;
}

.cm-station-card {
    padding: 14px 16px;
    border-bottom: 1px solid var(--cm-line);
    background: #fff;
    cursor: default;
}

.cm-station-card:hover {
    background: #f8fafc;
}

.cm-station-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cm-provider {
    color: var(--cm-green-2);
    font-size: 12px;
    font-weight: 900;
}

.cm-station-card h3 {
    margin: 3px 0 8px;
    color: #111827;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 900;
}

.cm-distance {
    flex: 0 0 auto;
    color: #111827;
    font-size: 13px;
    font-weight: 900;
}

.cm-station-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cm-station-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.cm-address {
    margin: 8px 0 0;
    color: var(--cm-muted);
    font-size: 13px;
}

.cm-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.cm-card-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.cm-card-actions a:nth-child(2) {
    background: #fff;
    color: #111827;
    border: 1px solid var(--cm-border);
}

.cm-empty {
    margin: 14px 16px;
    padding: 16px;
    border: 1px dashed var(--cm-border);
    border-radius: 14px;
    background: #f9fafb;
    color: var(--cm-muted);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.cm-map-wrap {
    position: relative;
    min-height: 620px;
}

#cmMap {
    width: 100%;
    height: 100%;
    min-height: 620px;
    background: #f2f4f7;
}

.cm-pin {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15,23,42,.20);
    border: 3px solid #fff;
}

.cm-pin.is-dc {
    background: var(--cm-red);
}

.cm-pin.is-ac {
    background: var(--cm-green-2);
    font-size: 11px;
}

.cm-popup {
    min-width: 210px;
}

.cm-popup strong {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
}

.cm-popup span {
    display: block;
    margin-top: 2px;
    color: var(--cm-green-2);
    font-size: 12px;
    font-weight: 900;
}

.cm-popup p {
    margin: 6px 0 0;
    color: #344054;
    font-size: 12px;
}

.cm-popup a {
    display: inline-flex;
    margin-top: 9px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #111827;
    color: #fff !important;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.cm-mobile-filter-btn {
    display: none;
}

.cm-seo-box {
    margin-top: 16px;
    padding: 20px 22px;
    border: 1px solid var(--cm-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 0 1px rgba(0,0,0,.1);
}

.cm-seo-box h2 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 22px;
    line-height: 1.35;
    font-weight: 900;
}

.cm-seo-box h3 {
    margin: 18px 0 8px;
    color: #111827;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 900;
}

.cm-seo-box p {
    margin: 0 0 10px;
    color: #374151;
    font-size: 14px;
    line-height: 1.75;
}

.cm-disclaimer {
    margin-top: 14px !important;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412 !important;
    font-weight: 700;
}

@media (max-width: 1024px) {
    .cm-shell {
        grid-template-columns: 340px 1fr;
    }
}

@media (max-width: 560px) {
    .cm-main-btn,
    .cm-secondary-btn {
        width: 100%;
    }

    .cm-card-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .cm-card-actions a {
        width: 100%;
    }

    .cm-seo-box {
        padding: 16px;
    }

    .cm-seo-box h2 {
        font-size: 19px;
    }
}

/* =========================================================
   Google Maps specific polish
========================================================= */
#cmMap .gm-style-iw,
#cmMap .gm-style-iw-c {
    border-radius: 12px !important;
}

#cmMap .gm-style-iw-d {
    overflow: auto !important;
}

#cmMap button.gm-ui-hover-effect {
    top: 2px !important;
    right: 2px !important;
}

.cm-station-card {
    transition: background .18s ease, box-shadow .18s ease;
}

.cm-station-card:hover {
    box-shadow: inset 3px 0 0 #27845f;
}


/* =========================================================
   Provider logo markers + AC/DC badge
   Icon files expected in: /ev/images/charging/providers/{provider_slug}.png
========================================================= */
.cm-provider-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
}

.cm-station-main {
    min-width: 0;
}

.cm-provider-text {
    min-width: 0;
}

.cm-provider-logo,
.cm-popup-logo,
.cm-provider-marker__logo {
    position: relative;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #174b35;
    font-weight: 900;
}

.cm-provider-logo {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    margin-top: 1px;
}

.cm-provider-logo img,
.cm-popup-logo img,
.cm-provider-marker__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
}

.cm-provider-logo__fallback,
.cm-popup-logo__fallback,
.cm-provider-marker__logo__fallback {
    display: none;
    width: 100%;
    height: 100%;
    place-items: center;
    background: #edf8f2;
    color: #174b35;
    font-size: 10px;
    line-height: 1;
    text-align: center;
}

.cm-connector-pill {
    color: #fff !important;
}

.cm-connector-pill--ac {
    background: #27845f !important;
}

.cm-connector-pill--dc {
    background: #e46a36 !important;
}

.cm-connector-pill--both {
    background: #2563eb !important;
}

.cm-connector-pill--unknown {
    background: #6b7280 !important;
}

.cm-provider-marker {
    position: absolute;
    width: 54px;
    height: 64px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform: translate(-50%, -100%);
    transform-origin: 50% 100%;
    z-index: 1;
    outline: none;
    transition: transform .15s ease, filter .15s ease;
}

.cm-provider-marker:hover,
.cm-provider-marker:focus-visible {
    transform: translate(-50%, -100%) scale(1.08);
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .24));
    z-index: 20;
}

.cm-provider-marker__pin {
    position: absolute;
    left: 50%;
    top: 0;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: #fff;
    border: 3px solid #fff;
    box-shadow: 0 7px 16px rgba(15, 23, 42, .22);
    overflow: visible;
}

.cm-provider-marker__pin::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -12px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-right: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 3px;
    z-index: -1;
    box-shadow: 5px 5px 10px rgba(15, 23, 42, .08);
}

.cm-provider-marker__logo {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
}

.cm-provider-marker__logo__fallback {
    border-radius: 999px;
    font-size: 11px;
}

.cm-provider-marker__badge {
    position: absolute;
    left: 50%;
    bottom: 3px;
    min-width: 30px;
    height: 20px;
    padding: 0 6px;
    transform: translateX(-50%);
    border-radius: 999px;
    border: 2px solid #fff;
    color: #fff;
    font-size: 9px;
    font-weight: 950;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .18);
    white-space: nowrap;
}

.cm-provider-marker__badge--ac {
    background: #27845f;
}

.cm-provider-marker__badge--dc {
    background: #e46a36;
}

.cm-provider-marker__badge--both {
    background: #2563eb;
}

.cm-provider-marker__badge--unknown {
    background: #6b7280;
}

.cm-popup-provider {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 230px;
}

.cm-popup-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.cm-popup-logo__fallback {
    font-size: 10px;
}

.cm-popup-provider strong {
    margin-top: 0;
}

@media (max-width: 767px) {
    .cm-provider-marker {
        width: 48px;
        height: 58px;
    }

    .cm-provider-marker__pin {
        width: 40px;
        height: 40px;
    }

    .cm-provider-marker__badge {
        height: 18px;
        min-width: 28px;
        font-size: 8px;
        line-height: 14px;
        bottom: 4px;
    }
}


/* =========================================================
   Tesla-like marker mode: map legend + performance helpers
   Brand is represented by marker border color / initial in SVG marker.
   AC/DC/BOTH is represented by marker fill color.
========================================================= */
.cm-map-legend {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 5;
    display: grid;
    gap: 6px;
    max-width: 210px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(229, 231, 235, .92);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
    backdrop-filter: blur(8px);
    color: #111827;
    font-size: 14px;
    font-weight: 800;
}

.cm-map-legend-row {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1.1;
    white-space: nowrap;
}

.cm-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: inline-block;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(17,24,39,.12);
}

.cm-legend-dot--dc {
    background: #ef4d3f;
}

.cm-legend-dot--ac {
    background: #27845f;
}

.cm-legend-dot--both {
    background: #2563eb;
}

.cm-map-legend-note {
    margin-top: 2px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

/* Native Google marker mode does not need heavy HTML overlay markers. */
.cm-provider-marker {
    display: none;
}

@media (max-width: 860px) {
    .cm-map-legend {
        top: 12px;
        left: 12px;
        max-width: 190px;
        padding: 9px 10px;
        font-size: 11px;
    }

    .cm-map-legend-note {
        display: none;
    }
}

@media (max-width: 560px) {
    .cm-map-legend {
        grid-template-columns: repeat(3, auto);
        max-width: none;
        gap: 8px;
    }
}
.cm-map-legend {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 5;
    display: grid;
    gap: 6px;
    max-width: 150px;
    padding: 9px 10px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .90);
    border: 1px solid rgba(229, 231, 235, .92);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .10);
    backdrop-filter: blur(8px);
    color: #111827;
    font-size: 14px;
    font-weight: 800;
}

.cm-map-legend-row {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1.1;
    white-space: nowrap;
}

.cm-legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(17,24,39,.14);
}

.cm-legend-dot--dc {
    background: #ea6b55;
}

.cm-legend-dot--ac {
    background: #676d76;
}

.cm-legend-dot--both {
    background: #5d79f6;
}

.cm-map-legend-note {
    margin-top: 1px;
    color: #667085;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}
.cm-popup-group {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.cm-popup-group strong {
    display: block;
    margin-bottom: 4px;
    color: #111827;
    font-size: 12px;
    font-weight: 900;
}

.cm-popup-group ul {
    margin: 0;
    padding-left: 16px;
}

.cm-popup-group li {
    margin: 2px 0;
    color: #475467;
    font-size: 11px;
    line-height: 1.35;
}
@media (max-width: 860px) {
    .cm-page {
        width: min(100% - 20px, 100%);
        padding-bottom: 36px;
    }

    .cm-hero {
        grid-template-columns: 1fr;
        padding: 18px;
        border-radius: 16px;
    }

    .cm-hero h1 {
        font-size: 26px;
    }

    .cm-hero-actions {
        justify-content: flex-start;
    }

    .cm-map-wrap,
    #cmMap {
        min-height: 56dvh;
        height: 56dvh;
    }

    .cm-sidebar {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 10001;
        display: flex;
        min-height: 0;
        max-height: min(82dvh, 680px);
        border: 1px solid var(--cm-border);
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 22px 54px rgba(15,23,42,.30);
        overflow: auto;
        transform: translateY(112%);
        opacity: 0;
        pointer-events: none;
        transition: transform .22s ease, opacity .18s ease;
    }

    .cm-sidebar.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .cm-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: none;
        background: rgba(15, 23, 42, .38);
        backdrop-filter: blur(2px);
    }

    .cm-mobile-backdrop.is-open {
        display: block;
    }

    body.cm-filter-open {
        overflow: hidden;
    }

    .cm-panel-head {
        position: sticky;
        top: 0;
        z-index: 3;
        background: #fff;
        border-bottom: 1px solid var(--cm-line);
    }

    .cm-panel-head h2 {
        font-size: 18px;
    }

    .cm-panel-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .cm-filter-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 999px;
        background: #f2f4f7;
        color: #111827;
        font-size: 22px;
        line-height: 1;
        font-weight: 800;
        cursor: pointer;
        font-family: inherit;
    }

    .cm-result-head {
        position: sticky;
        top: 71px;
        z-index: 2;
    }

    .cm-mobile-filter-btn {
        position: absolute;
        left: 14px;
        bottom: 18px;
        z-index: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 18px;
        border: 0;
        border-radius: 999px;
        background: #111827;
        color: #fff;
        font-size: 14px;
        font-weight: 900;
        font-family: inherit;
        box-shadow: 0 8px 20px rgba(15,23,42,.22);
    }
}
/* Desktop/mobile drawer base */
.cm-mobile-backdrop {
    display: none;
}

.cm-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cm-filter-close-btn {
    display: none;
}
@media (max-width: 860px) {
    .cm-page {
        width: min(100% - 20px, 100%);
        padding-bottom: 36px;
    }

    .cm-hero {
        grid-template-columns: 1fr;
        padding: 18px;
        border-radius: 16px;
    }

    .cm-hero h1 {
        font-size: 26px;
    }

    .cm-hero-actions {
        justify-content: flex-start;
    }

    .cm-sidebar {
        position: fixed !important;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 10001;
        display: flex;
        width: auto;
        min-height: 0;
        max-height: min(82dvh, 680px);
        border: 1px solid var(--cm-border);
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 22px 54px rgba(15,23,42,.30);
        overflow: auto;
        transform: translateY(112%);
        opacity: 0;
        pointer-events: none;
        transition: transform .22s ease, opacity .18s ease;
    }

    .cm-sidebar.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .cm-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: none;
        background: rgba(15, 23, 42, .38);
        backdrop-filter: blur(2px);
    }

    .cm-mobile-backdrop.is-open {
        display: block;
    }

    body.cm-filter-open {
        overflow: hidden;
    }

    .cm-panel-head {
        position: sticky;
        top: 0;
        z-index: 3;
        background: #fff;
        border-bottom: 1px solid var(--cm-line);
    }

    .cm-panel-head h2 {
        font-size: 18px;
    }

    .cm-filter-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 999px;
        background: #111827;
        color: #fff;
        font-size: 22px;
        line-height: 1;
        font-weight: 800;
        cursor: pointer;
        font-family: inherit;
    }

    .cm-result-head {
        position: sticky;
        top: 71px;
        z-index: 2;
    }

    .cm-mobile-filter-btn {
        position: absolute;
        left: 14px;
        bottom: 18px;
        z-index: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0 18px;
        border: 0;
        border-radius: 999px;
        background: #111827;
        color: #fff;
        font-size: 14px;
        font-weight: 900;
        font-family: inherit;
        box-shadow: 0 8px 20px rgba(15,23,42,.22);
    }
}
@media (min-width: 861px) {
    .cm-shell {
        display: grid !important;
        grid-template-columns: 380px minmax(0, 1fr) !important;
        min-height: 620px !important;
    }

    .cm-sidebar {
        position: static !important;
        display: flex !important;
        min-height: 620px !important;
        max-height: 620px !important;
        width: auto !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        border-right: 1px solid var(--cm-border) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: auto !important;
    }

    .cm-map-wrap,
    #cmMap {
        min-height: 50dvh;
        height: 50dvh;
    }

    .cm-mobile-filter-btn,
    .cm-mobile-backdrop,
    .cm-filter-close-btn {
        display: none !important;
    }
}
/* =========================================================
   Charging Map - Use Theme Mobile Menu Like Product Page
   Put at the VERY END of charging-map.css
========================================================= */

@media (max-width: 991px) {

    /*
      สำคัญ:
      ห้าม override main-navigation-links เป็น dropdown สีดำ
      ปล่อยให้ theme style.css จัด mobile drawer เองเหมือน product page
    */

    .site-header,
    #masthead {
        position: relative !important;
        z-index: 9999 !important;
        overflow: visible !important;
    }

    .middle-header-part,
    .bottom-header-part,
    .ascendoor-wrapper,
    .middle-header-wrapper,
    .bottom-header-wrapper,
    .navigation-part,
    .main-navigation {
        overflow: visible !important;
    }

    .bottom-header-part {
        position: relative !important;
        z-index: 10000 !important;
    }

    .main-navigation {
        z-index: 10001 !important;
    }

    .menu-toggle {
        z-index: 10002 !important;
    }

    /*
      กัน map / filter drawer / legend ลอยทับ menu ของ theme
    */
    .cm-page,
    .cm-shell,
    .cm-map-wrap,
    #cmMap,
    .cm-map-legend{
        position: relative !important;
        z-index: 1 !important;
    }

    .cm-sidebar {
        z-index: 8000 !important;
    }

    .cm-mobile-backdrop {
        z-index: 7999 !important;
    }

    /*
      ตอนเปิด hamburger menu ให้ filter drawer ของ charging map ไม่มาทับ
    */
    body.mobile-menu-open .cm-sidebar,
    body.mobile-menu-open .cm-mobile-backdrop,
    body.mobile-menu-open .cm-mobile-filter-btn {
        display: none !important;
    }
}
/* =========================================================
   Charging Map - Restore Mobile Filter Button
   Put at the VERY END of charging-map.css
========================================================= */

@media (max-width: 860px) {
    .cm-map-wrap {
        position: relative !important;
        overflow: hidden !important;
    }

    .cm-mobile-filter-btn {
        position: absolute !important;
        left: 14px !important;
        bottom: 18px !important;
        z-index: 50 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 44px !important;
        padding: 0 18px !important;
        border: 0 !important;
        border-radius: 999px !important;
        background: #111827 !important;
        color: #fff !important;
        font-size: 14px !important;
        font-weight: 900 !important;
        font-family: inherit !important;
        box-shadow: 0 8px 20px rgba(15,23,42,.22) !important;
        pointer-events: auto !important;
    }

    body.mobile-menu-open .cm-mobile-filter-btn,
    body.cm-filter-open .cm-mobile-filter-btn {
        display: none !important;
    }
}

@media (min-width: 861px) {
    .cm-mobile-filter-btn {
        display: none !important;
    }
}
/* Fix Google Maps fullscreen button on mobile */
@media (max-width: 860px) {
    .cm-shell,
    .cm-map-wrap {
        overflow: visible !important;
    }

    #cmMap {
        position: relative !important;
        overflow: hidden !important;
    }

    #cmMap .gm-fullscreen-control,
    #cmMap button[title="Toggle fullscreen view"],
    #cmMap button[aria-label="Toggle fullscreen view"],
    #cmMap button[title="มุมมองเต็มหน้าจอ"],
    #cmMap button[aria-label="มุมมองเต็มหน้าจอ"] {
        z-index: 9999 !important;
        pointer-events: auto !important;
    }

    .cm-map-legend {
        pointer-events: none !important;
    }

    .cm-mobile-filter-btn {
        z-index: 50 !important;
    }
}

#chargingMap,
#map {
  width: 100%;
  height: 520px;
  position: relative;
  z-index: 1;
  border-radius: 18px;
  overflow: hidden;
}

/* Mobile ลดความสูง */
@media (max-width: 768px) {
  #chargingMap,
  #map {
    height: 420px;
    border-radius: 0;
  }
}

/* Legend ต้องลอยอยู่บน map */
.map-legend,
.ev-map-legend {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.15);
}

/* ปุ่ม filter อย่าไปบัง fullscreen */
.map-filter-toggle,
.ev-map-filter-toggle {
  position: absolute;
  left: 18px;
  bottom: 76px;
  z-index: 21;
}

/* Google Maps controls ต้องไม่โดนซ่อน */
.gm-fullscreen-control,
.gmnoprint,
.gm-bundled-control,
.gm-style-cc {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* กัน custom overlay บังปุ่ม fullscreen */
.map-overlay,
.map-filter-panel,
.ev-map-card {
  z-index: 10;
}
/* FINAL MOBILE UX FIX - Charging Map */
@media (max-width: 860px) {
    .cm-page {
        width: 100% !important;
        padding: 0 12px 32px !important;
    }

    .cm-hero {
        margin: 0 0 14px !important;
        padding: 18px 18px 22px !important;
        border-radius: 0 0 22px 22px !important;
    }

    .cm-hero h1 {
        font-size: 30px !important;
        line-height: 1.15 !important;
    }

    .cm-shell {
        display: block !important;
        min-height: 0 !important;
        overflow: visible !important;
        border-radius: 0 !important;
    }

    .cm-map-wrap {
        position: relative !important;
        width: 100% !important;
        height: 430px !important;
        min-height: 430px !important;
        max-height: 430px !important;
        overflow: hidden !important;
        border-radius: 0 !important;
        margin: 0 0 14px !important;
    }

    #cmMap {
        width: 100% !important;
        height: 430px !important;
        min-height: 430px !important;
    }

    /* ย้าย legend ไปบนซ้าย ไม่ให้ชน SEO / ปุ่ม Google */
    .cm-map-legend {
        position: absolute !important;
        left: 10px !important;
        top: 10px !important;
        bottom: auto !important;
        z-index: 50 !important;

        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;

        width: auto !important;
        max-width: calc(100% - 84px) !important;
        padding: 7px 10px !important;
        border-radius: 999px !important;
        background: rgba(255,255,255,.96) !important;
        box-shadow: 0 6px 18px rgba(15,23,42,.16) !important;

        font-size: 12px !important;
        line-height: 1 !important;
        pointer-events: none !important;
    }

    .cm-map-legend-row {
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        white-space: nowrap !important;
    }

    .cm-legend-dot {
        width: 10px !important;
        height: 10px !important;
        border-width: 2px !important;
    }

    .cm-map-legend-note {
        display: none !important;
    }

    /* ปุ่ม filter ลอยล่างซ้าย แต่ไม่บัง attribution มากเกิน */
    .cm-mobile-filter-btn {
        position: absolute !important;
        left: 12px !important;
        bottom: 54px !important;
        z-index: 60 !important;

        min-height: 42px !important;
        padding: 0 18px !important;
        border-radius: 999px !important;
        font-size: 14px !important;
    }

    .cm-seo-box {
        margin-top: 0 !important;
        border-radius: 18px !important;
    }
}
/* Mobile legend note + hide keyboard shortcut */
@media (max-width: 860px) {
    .cm-map-legend {
        flex-wrap: wrap !important;
        max-width: 155px !important;
        border-radius: 16px !important;
    }

    .cm-map-legend-note {
        display: block !important;
        width: 100% !important;
        margin-top: 2px !important;
        padding-top: 4px !important;
        border-top: 1px solid rgba(17,24,39,.08) !important;
        color: #667085 !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
        font-weight: 800 !important;
    }

    #cmMap .gm-style-cc,
    #cmMap .gmnoscreen,
    #cmMap a[title="Keyboard shortcuts"],
    #cmMap button[title="Keyboard shortcuts"] {
        display: none !important;
    }
}
.cm-custom-fullscreen-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 70;
    width: 44px;
    height: 44px;
    border: 0;
    background: #fff;
    color: #374151;
    font-size: 24px;
    font-weight: 900;
    padding-left: 14px;
    padding-top: 9px;
    display: block;
}
.cm-map-wrap.is-custom-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: none !important;
    min-height: 100dvh !important;
    border-radius: 0 !important;
}

.cm-map-wrap.is-custom-fullscreen #cmMap {
    height: 100dvh !important;
    min-height: 100dvh !important;
}
.cm-custom-fullscreen-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 80;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 4px 14px rgba(15,23,42,.18);
}

.cm-custom-fullscreen-exit {
    display: none;
}

.cm-map-wrap.is-custom-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99990 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
}

.cm-map-wrap.is-custom-fullscreen #cmMap {
    height: 100dvh !important;
    min-height: 100dvh !important;
}

.cm-map-wrap.is-custom-fullscreen .cm-custom-fullscreen-btn {
    z-index: 100010 !important;
}

.cm-map-wrap.is-custom-fullscreen .cm-mobile-filter-btn {
    z-index: 100010 !important;
    bottom: 24px !important;
}

body.cm-map-fullscreen {
    overflow: hidden !important;
}

/* ตอน fullscreen ให้ filter drawer อยู่เหนือ map */
body.cm-map-fullscreen .cm-sidebar {
    z-index: 100030 !important;
}

body.cm-map-fullscreen .cm-mobile-backdrop {
    z-index: 100020 !important;
}
.cm-custom-fullscreen-btn {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;
    z-index: 80 !important;
    width: 44px !important;
    height: 44px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #374151 !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    /*box-shadow: 0 4px 14px rgba(15,23,42,.18) !important;*/
        display: none;
}
@media (max-width: 860px) {
    .cm-custom-fullscreen-btn{
        display: block;
    }
}
.cm-map-wrap.is-custom-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99990 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
}

.cm-map-wrap.is-custom-fullscreen #cmMap {
    height: 100dvh !important;
    min-height: 100dvh !important;
}

body.cm-map-fullscreen {
    overflow: hidden !important;
}

body.cm-map-fullscreen .cm-sidebar {
    z-index: 100030 !important;
}

body.cm-map-fullscreen .cm-mobile-backdrop {
    z-index: 100020 !important;
}

body.cm-map-fullscreen .cm-mobile-filter-btn,
body.cm-map-fullscreen .cm-custom-fullscreen-btn {
    z-index: 100040 !important;
}
/* =========================================
   FULLSCREEN MODE CLEANUP
========================================= */

body.cm-map-fullscreen #masthead,
body.cm-map-fullscreen .site-header,
body.cm-map-fullscreen .bottom-header-part,
body.cm-map-fullscreen .middle-header-part,
body.cm-map-fullscreen .live-vote-bar,
body.cm-map-fullscreen .cm-hero,
body.cm-map-fullscreen .cm-seo-box {
    display: none !important;
}

/* map เต็มจอจริง */
body.cm-map-fullscreen .cm-shell {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99990 !important;
    width: 100vw !important;
    height: 100dvh !important;
    background: #fff !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

/* map wrapper */
body.cm-map-fullscreen .cm-map-wrap {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
}

/* ตัว map */
body.cm-map-fullscreen #cmMap {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
}

/* fullscreen button */
body.cm-map-fullscreen .cm-custom-fullscreen-btn {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    z-index: 100050 !important;
}

/* filter button */
body.cm-map-fullscreen .cm-mobile-filter-btn {
    z-index: 100050 !important;
}

/* sidebar filter */
body.cm-map-fullscreen .cm-sidebar {
    z-index: 100060 !important;
}

body.cm-map-fullscreen .cm-mobile-backdrop {
    z-index: 100055 !important;
}
/* =========================================================
   Google Maps InfoWindow compact header
   Remove empty header space but keep close button usable
========================================================= */

#cmMap .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
}

#cmMap .gm-style-iw-d {
    overflow: auto !important;
    padding: 0 !important;
}

#cmMap .gm-style-iw-chr {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    z-index: 5 !important;
    width: 36px !important;
    height: 36px !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

#cmMap .gm-style-iw-ch {
    display: none !important;
}

#cmMap button.gm-ui-hover-effect {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: .75 !important;
    background: rgba(255,255,255,.92) !important;
    border-radius: 999px !important;
}

#cmMap button.gm-ui-hover-effect:hover {
    opacity: 1 !important;
    background: #f2f4f7 !important;
}

#cmMap .cm-popup {
    min-width: 230px;
    padding: 16px 16px 14px !important;
}
#cmMap .cm-popup strong {
    padding-right: 34px;
    font-size: 15px;
    line-height: 1.35;
}

#cmMap .cm-popup span {
    margin-top: 3px;
    color: #27845f;
    font-size: 13px;
}

#cmMap .cm-popup p {
    margin: 7px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

#cmMap .cm-popup a {
    margin-top: 12px;
    min-height: 38px;
    align-items: center;
}
.ev-site-footer {
    margin-top: 32px;
    background: #111827;
    color: rgba(255, 255, 255, 0.88);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ev-footer-inner {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 18px;
}

.ev-footer-top {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    padding-bottom: 20px;
}

.ev-footer-brand {
    min-width: 0;
}

.ev-footer-logo {
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 10px;
}

.ev-footer-desc {
    margin: 0;
    max-width: 520px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.98rem;
    line-height: 1.7;
}

.ev-footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ev-footer-col h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
}

.ev-footer-col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ev-footer-col li + li {
    margin-top: 8px;
}

.ev-footer-col a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color .18s ease;
}

.ev-footer-col a:hover {
    color: #ffffff;
}

.ev-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
}

.ev-footer-bottom p {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 767px) {
    .ev-footer-inner {
        width: min(100% - 20px, 100%);
        padding: 24px 0 16px;
    }

    .ev-footer-top {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .ev-footer-links {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .ev-footer-logo {
        font-size: 1.22rem;
    }

    .ev-footer-desc {
        font-size: 0.95rem;
    }
}