/* Layout */
.gm-wrap {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: stretch;
    width: 100%;
    min-height: 560px;
    background: white;
    padding: 60px;
    border-radius: 24px;
    margin: 2rem 0;
}

.gm-left {
    background: transparent;
}

.gm-left-head {
    margin-bottom: 2rem;
    font-size: 18px;
}

.gm-left-title {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-weight: 400;
    font-family: 'Kanit';
    color: #0D302A;
}

.gm-left-count {}

/* List */
.gm-garages-list {
    max-height: 560px;
    overflow: auto;
    padding-right: 6px;
}

.gm-garage-item {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-align: left;
    margin-bottom: 14px;
}

.gm-garage-card-mini {
    background: #fff;
    border-radius: 16px;
    /* box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06); */
    overflow: hidden;
}

.gm-garage-thumb img {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 25px;
}

.gm-garage-meta {
    padding: 14px 14px 16px 14px;
}

.gm-garage-title {
    font-size: 18px;
    font-weight: 400;
    padding-bottom: 15px;
    margin-bottom: 14px;
    color: #000;
    font-family: 'Sora';
    border-bottom: 1px solid #E6E6E6;
}

.gm-garage-line {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: rgba(0, 0, 0, 0.75);
    font-size: 14px;
    line-height: 1.35;
    margin-top: 6px;
    font-family: 'Figtree';
    font-weight: 600;
}

.gm-ico {
    width: 18px;
    flex: 0 0 18px;
    opacity: 0.8;
}

/* Active highlight */
.gm-garage-item.is-active .gm-garage-card-mini {
    /* outline: 2px solid #127650; */
    box-shadow: 1px 1px 14px #00000024;
}

/* Map */
.gm-right {
    position: relative;
    min-height: 560px;
}

.gm-map {
    width: 100%;
    height: 560px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

/* Leaflet control look */
.leaflet-control-zoom a {
    border-radius: 10px;
}

/* Overlay card */
.gm-overlay-card {
    position: absolute;
    left: 22px;
    top: 22px;
    width: min(520px, calc(100% - 44px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    display: none;
}

.gm-overlay-card.is-open {
    display: block;
}

.gm-overlay-close {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 0;
    background: rgba(0, 0, 0, 0.06);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.gm-overlay-inner {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 14px;
    padding: 14px;
}

.gm-overlay-thumb img {
    width: 160px;
    height: 130px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.gm-overlay-title {
    font-size: 16px;
    font-weight: 800;
    margin: 4px 0 10px;
}

.gm-overlay-row {
    margin-top: 10px;
}

.gm-overlay-label {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.75;
    margin-bottom: 4px;
}

.gm-overlay-value {
    font-size: 13px;
    opacity: 0.9;
}

.gm-overlay-value a {
    text-decoration: none;
}

.gm-overlay-actions {
    margin-top: 12px;
}

.gm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}

/* === MARKER (DOT) === */
.gm-marker {
    width: 16px;
    height: 16px;
}

.gm-marker::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #0f7b5b;
    /* green */
    border: 2px solid #ffffff;
    /* white ring */
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

/* Active marker with pulse/glow */
.gm-marker--active::before {
    animation: gm-pulse 1.2s infinite;
}

@keyframes gm-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(15, 123, 91, 0.35), 0 8px 18px rgba(0, 0, 0, 0.18);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 14px rgba(15, 123, 91, 0), 0 8px 18px rgba(0, 0, 0, 0.18);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(15, 123, 91, 0), 0 8px 18px rgba(0, 0, 0, 0.18);
    }
}

/* === POPUP STYLE === */
.gm-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: 30px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.gm-leaflet-popup .leaflet-popup-content {
    margin: 0;
    width: 525px !important;
    padding: 15px;
}

.gm-leaflet-popup .leaflet-popup-tip {
    box-shadow: none;
}

/* popup content */
.gm-pop {
    display: grid;
    grid-template-columns: 169px 1fr;
}

.gm-pop-img img {
    width: 169px;
    height: 169px;
    object-fit: cover;
    display: block;
    border-radius: 20px;
}

.gm-pop-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gm-pop-title {
    font-weight: 400;
    font-size: 18px;
    font-family: 'Sora';
    border-bottom: 1px solid #F6F6F6;
    padding-bottom: 1rem;
}

.gm-pop-row {
    font-size: 14px;
    opacity: 1;
    display: flex;
    gap: 8px;
    align-items: center;
    line-height: 1.35;
    margin-top: 6px;
    font-family: 'Kanit';
    font-weight: 300;
    color: #000000;
}

.gm-pop-row a {
    color: #000000;
}

.gm-pop-ico {
    width: 36px;
    height: 36px;
    display: flex;
    border-radius: 13px;
    background: #F7F7F7;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.gm-pop-actions {
    margin-top: 10px;
}

.gm-pop-btn {
    display: inline-flex;
    height: 34px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
}

/* Put zoom control nicely spaced from edges */
.leaflet-bottom.leaflet-left .leaflet-control-zoom {
    margin: 0 0 18px 18px;
}

/* Remove default box */
.leaflet-control-zoom {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Make them horizontal (like screenshot) */
.leaflet-control-zoom a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 54px !important;
    height: 54px !important;
    border-radius: 999px !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
    color: #127650 !important;
    /* green */
    font-size: 43px !important;
    line-height: 1 !important;
    text-decoration: none !important;
    font-family: 'Figtree';
    font-weight: 200 !important;
}

/* Leaflet adds borders between zoom buttons – remove them */
.leaflet-control-zoom a+a {
    margin-left: 12px;
}

/* Remove hover gray background */
.leaflet-control-zoom a:hover {
    background: #fff !important;
}

/* Fix the +/- alignment */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    font-weight: 600 !important;
}

/* Remove default focus outline (optional) */
.leaflet-control-zoom a:focus {
    outline: none !important;
}

button.gm-garage-item {
    background: none;
}

button.gm-garage-item:hover {
    background: none;
}

button.gm-garage-item:focus {
    background: none;
}

/* Slightly desaturate + lighten tiles */
#gm-map .leaflet-tile {
    filter: grayscale(100%) contrast(0.95) brightness(1.05);
}

span.map-info-content {
    display: flex;
    flex-direction: column;
}

.leaflet-container a.leaflet-popup-close-button {
    right: 10px;
    top: 10px;
}

/* =========================
   RESPONSIVE (no font-size changes)
   Replace your current @media (max-width: 980px) block with everything below
========================= */

/* Large screens / smaller desktops */
@media (max-width: 1400px) {
    .gm-wrap {
        padding: 48px;
        gap: 18px;
        grid-template-columns: 360px 1fr;
        min-height: 540px;
    }

    .gm-map {
        height: 540px;
    }

    .gm-garages-list {
        max-height: 540px;
    }
}

/* Laptops */
@media (max-width: 1200px) {
    .gm-wrap {
        padding: 40px;
        gap: 16px;
        grid-template-columns: 340px 1fr;
        min-height: 520px;
    }

    .gm-map {
        height: 520px;
    }

    .gm-garages-list {
        max-height: 520px;
    }

    /* Popup width adapts without changing font sizes */
    .gm-leaflet-popup .leaflet-popup-content {
        width: min(525px, calc(100vw - 120px)) !important;
    }
}

/* Tablets landscape / small laptop */
@media (max-width: 1024px) {
    .gm-wrap {
        padding: 32px;
        gap: 16px;
        grid-template-columns: 320px 1fr;
        min-height: 500px;
    }

    .gm-map {
        height: 500px;
    }

    .gm-garages-list {
        max-height: 500px;
    }

    .gm-leaflet-popup .leaflet-popup-content {
        width: min(525px, calc(100vw - 90px)) !important;
    }
}

/* Stack layout (tablet portrait & below) */
@media (max-width: 980px) {
    .gm-wrap {
        grid-template-columns: 1fr;
        padding: 28px;
        gap: 18px;
        min-height: auto;
    }

    .gm-left-head {
        margin-bottom: 1.5rem;
    }

    .gm-garages-list {
        max-height: 360px;
        padding-right: 4px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .gm-right {
        min-height: auto;
    }

    .gm-map {
        height: 520px;
        min-height: 520px;
    }

    /* Popup adapts to viewport */
    .gm-leaflet-popup .leaflet-popup-content {
        width: calc(100vw - 80px) !important;
        max-width: 525px !important;
    }

    /* Chrome / Edge / Safari */
    .gm-garages-list::-webkit-scrollbar {
        width: 10px;
    }

    .gm-garages-list::-webkit-scrollbar-track {
        background: #127650;
        border-radius: 10px;
    }

    .gm-garages-list::-webkit-scrollbar-thumb {
        background: #127650;
        border-radius: 10px;
    }

    /* Firefox */
    .gm-garages-list {
        scrollbar-width: auto;
        scrollbar-color: #127650 #f4f4f4;
    }
}

/* Tablet small */
@media (max-width: 768px) {
    .gm-wrap {
        padding: 22px;
        border-radius: 20px;
    }

    .gm-garages-list {
        max-height: 320px;
    }

    .gm-map {
        height: 460px;
        min-height: 460px;
    }

    /* Popup becomes 1 column */
    .gm-leaflet-popup .leaflet-popup-content {
        width: calc(100vw - 60px) !important;
        max-width: 335px !important;
        padding: 12px;
    }

    .gm-pop {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gm-pop-img img {
        width: 100%;
        height: 150px;
        border-radius: 14px;
    }

    .gm-pop-body {
        padding: 0;
        gap: 0;
    }

    .gm-pop-title {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

/* Mobile */
@media (max-width: 720px) {
    .gm-garages-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .gm-wrap {
        padding: 16px;
        border-radius: 18px;
    }

    .gm-garages-list {
        max-height: 330px;
        padding-right: 2px;
    }

    .gm-map {
        height: 400px;
        min-height: 400px;
        border-radius: 16px;
    }

    /* Popup full usable width */
    .gm-leaflet-popup .leaflet-popup-content {
        /* width: calc(100vw - 36px) !important; */
        max-width: 295px !important;
    }

    /* Keep zoom control bottom-left but tighter spacing */
    .leaflet-bottom.leaflet-left .leaflet-control-zoom {
        margin: 0 0 14px 14px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .gm-wrap {
        padding: 14px;
        gap: 14px;
    }

    .gm-garage-thumb img {
        height: 160px;
    }

    .gm-garages-list {
        max-height: 350px;
    }

    .gm-map {
        height: 450px;
        min-height: 450px;
    }

    .gm-pop-img img {
        height: 160px;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .gm-wrap {
        padding: 12px;
    }

    .gm-map {
        height: 320px;
        min-height: 320px;
    }

    .gm-leaflet-popup .leaflet-popup-content {
        width: calc(100vw - 24px) !important;
    }
}