/* ===========================
   MAP PAGE
   =========================== */
body.page-map {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Subtitle under navbar */
.map-subtitle {
    position: fixed;
    top: 70px;
    left: 60px;
    z-index: 10;
    font-size: 14px;
    font-weight: 400;
    color: #090909;
    opacity: 0.5;
    pointer-events: none;
}

/* Map fills viewport */
.map-container {
    flex: 1;
    width: 100%;
}

/* ===========================
   NAVBAR TRANSPARENT ON MAP
   =========================== */
body.page-map .navbar {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ===========================
   CATEGORY FILTERS
   =========================== */
.map-filters {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 9999px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.map-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 16px;
    border-radius: 9999px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    color: #090909;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    opacity: 0.4;
}

.map-filter-btn.active {
    opacity: 1;
    background: #F0F0F0;
}

.map-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===========================
   GEOLOCATE BUTTON
   =========================== */
.map-geolocate {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    color: #090909;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.map-geolocate:active {
    transform: scale(0.92);
}

.map-geolocate.located {
    color: #4B96FF;
}

/* ===========================
   CUSTOM PINS
   =========================== */
.map-pin {
    width: 32px;
    height: 40px;
    cursor: pointer;
    transition: filter 0.2s;
    position: relative;
}

.map-pin.visited {
    filter: saturate(0%) brightness(1.4);
}

.map-pin svg {
    width: 100%;
    height: 100%;
}

/* ===========================
   CLUSTER MARKERS
   =========================== */
.map-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(9, 9, 9, 0.85);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    /* box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2); */
    cursor: pointer;
    transition: transform 0.2s;
}

.map-cluster:hover {
    transform: scale(1.1);
}

.map-cluster.large {
    width: 52px;
    height: 52px;
    font-size: 16px;
}

/* ===========================
   POPUP
   =========================== */
.maplibregl-popup {
    max-width: 280px !important;
    z-index: 20;
}

.maplibregl-popup-content {
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
}

.maplibregl-popup-close-button {
    font-size: 20px;
    color: #fff;
    right: 8px !important;
    top: 8px !important;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    line-height: 1;
    z-index: 5;
}

.maplibregl-popup-close-button:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.maplibregl-popup-tip {
    display: none !important;
}

.map-popup-img-wrap {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #F0F0F0;
}

.map-popup-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-popup-img-wrap.no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}

.map-popup-body {
    padding: 14px 16px 16px;
}

.map-popup-title {
    font-size: 15px;
    font-weight: 700;
    color: #090909;
    margin-bottom: 4px;
    line-height: 1.3;
}

.map-popup-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.map-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #4B96FF;
    text-decoration: none;
    transition: opacity 0.2s;
}

.map-popup-link:hover {
    opacity: 0.7;
}

.map-popup-link::after {
    content: '→';
    font-size: 14px;
}

/* ===========================
   USER LOCATION DOT
   =========================== */
.map-user-location {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4B96FF;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(75, 150, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===========================
   HIDE FOOTER ON MAP
   =========================== */
body.page-map .site-footer {
    display: none;
}

/* ===========================
   HIDE MAPLIBRE DEFAULTS
   =========================== */
.maplibregl-ctrl-logo {
    display: none !important;
}

.maplibregl-ctrl-attrib {
    display: none !important;
}

/* ===========================
   MOBILE
   =========================== */
@media (max-width: 768px) {

    .map-subtitle {
        top: 50px;
        left: 20px;
        font-size: 12px;
    }

    .map-geolocate {
        display: flex;
    }

    .map-filters {
        bottom: 20px;
        max-width: calc(100vw - 32px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .map-filters::-webkit-scrollbar {
        display: none;
    }

    .map-filter-btn {
        height: 30px;
        padding: 0 12px;
        font-size: 12px;
    }

    .map-filter-dot {
        width: 6px;
        height: 6px;
    }

    .map-pin {
        width: 26px;
        height: 32px;
    }

    .maplibregl-popup {
        max-width: 240px !important;
    }

    .map-popup-img-wrap {
        height: 120px;
    }

    .map-popup-body {
        padding: 12px 14px 14px;
    }

    .map-popup-title {
        font-size: 14px;
    }

    .map-popup-desc {
        font-size: 12px;
    }
}