/* Wrapper for preview + overlay */
.clm-map-preview-wrapper {
    width: 100%;
}

/* Static preview hero */
.clm-map-preview {
    position: relative;
    width: 100%;
    min-height: 260px;
    border-radius: 0px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;

    display: flex;
    /* NEW: center the inner block */
    align-items: center;
    /* vertical center */
    justify-content: center;
    /* horizontal center */
}

.clm-map-preview-inner {
    /* no height: 100% here */
    max-width: 480px;
    /* optional: keep content column reasonable */
    width: 100%;
    padding: 24px;
    text-align: center;

    display: flex;
    flex-direction: column;
    align-items: center;
    /* center heading / subheading / button */
    justify-content: center;
    gap: 12px;

    background: transparent;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.clm-map-preview-heading {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.clm-map-preview-subheading {
    margin: 0;
    font-size: 14px;
    max-width: 420px;
}

.clm-map-preview .clm-map-preview-button {
    all: unset;
    /* resets ALL inherited styles */
    box-sizing: border-box;

    display: inline-block;
    text-align: center;
    cursor: pointer;

    /* your button styling */
    background: #ff00bd;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 999px;

    transition: background-color 0.15s ease, transform 0.08s ease;

    /* ensure centering */
    align-self: center;
}

.clm-map-preview-button:hover {
    background: #e000aa;
}

.clm-map-preview-button:active {
    transform: scale(0.97);
}

/* Fullscreen overlay */
.clm-map-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    /* always flex, but initially hidden via opacity/visibility */
    align-items: stretch;
    justify-content: center;
    z-index: 9999;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.98);
    transition:
        opacity 0.25s ease-out,
        transform 0.25s ease-out,
        visibility 0s linear 0.25s;
    /* delay visibility reset until after fade-out */
}

.clm-map-overlay--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    transition:
        opacity 0.25s ease-out,
        transform 0.25s ease-out,
        visibility 0s;
    /* no delay when showing */
}

.clm-map-overlay-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

/* Map fills the overlay */
.clm-map-overlay-inner .custom-map {
    width: 100% !important;
    height: 100% !important;
}

/* Close button for overlay */
.clm-map-overlay-close {
    all: unset;
    /* nuke Elementor styles entirely */
    box-sizing: border-box;

    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10000;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    font-size: 26px;
    line-height: 1;
    color: #000000 !important;
    /* always black */
    cursor: pointer;

    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.25);
    /* subtle border */
    border-radius: 8px;
    /* slightly rounded */

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    /* soft shadow */

    transition:
        background-color 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.2s ease;
}

.clm-map-overlay-close:hover {
    background: #ffffff;
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.clm-map-overlay-close:active {
    transform: scale(0.96);
}

/* Lock page scroll when overlay is open */
body.clm-overlay-open {
    overflow: hidden;
}

/* Wrapper leaflet uses for the icon */
.clm-marker-wrapper {
    /* no extra styles needed here unless you want effects on hover */
}

/* Circular coloured background with white border */
.clm-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Selected marker ring */
.clm-marker.selected {
    border-color: #ff00bd !important;
    box-shadow: 0 0 8px rgba(255, 0, 189, 0.6);
}

.leaflet-container .leaflet-marker-pane img.clm-marker-icon {
    width: 80% !important;
    height: 80% !important;
    max-width: none !important;
    max-height: none !important;
}

/* SVG icon in centre, forced to white */
.clm-marker-icon {
    display: block;
    filter: brightness(0) invert(1);
}

/* Make sure the map container is a positioning context */
.custom-map.clm-has-sheet {
    position: relative;
    overflow: hidden;
}

/* Bottom sheet */
.clm-bottom-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fde9dd;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
    transition: transform 0.25s ease-out;
    max-height: 30%;
    min-height: 20%;
    display: flex;
    flex-direction: column;
    padding: 10px 0 12px;
    font-size: 13px;
    z-index: 500;
}

.clm-bottom-sheet--open {
    transform: translateY(0);
}

/* Close button for sheet */
.custom-map.clm-has-sheet .clm-sheet-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    border: none !important;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 3px 12px !important;
    color: #000000 !important;
    background: transparent !important;
    border-radius: 4px !important;
    transition: background-color 0.15s ease !important;
}

.custom-map.clm-has-sheet .clm-sheet-close:hover {
    background-color: rgba(255, 0, 189, 0.8) !important;
    color: #ffffff !important;
}

/* Sheet content: 60% width, centered */
.clm-sheet-content {
    flex: 1;
    width: 60%;
    max-width: none;
    margin: 4px auto 4px;
    padding: 0;
    overflow: hidden;
    display: flex;
}

/* Bottom sheet popup layout */
.clm-popup {
    width: 100%;
}

/* Row: image left, text right */
.clm-popup-row {
    display: flex;
    align-items: stretch;
    height: 100%;
    min-height: 100px;
}

/* Thumbnail on the left */
.clm-popup-thumb {
    flex: 0 0 30%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: transparent;
}

/* Image: full image, no cropping */
.clm-popup-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px 0 0 6px !important;
}

/* Text on the right */
.clm-popup-body {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    background: #ffffff;
    padding: 10px;
    border-radius: 0 6px 6px 0;
}

.clm-popup-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
}

.clm-popup-description {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.4;
}

.clm-popup-filters {
    margin: 0 0 6px;
    font-size: 11px;
}

.clm-popup-link a {
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.clm-popup-meta {
    margin: 4px 0 0;
    font-size: 10px;
}

.clm-tag {
    display: inline-block;
    padding: 2px 5px;
    margin-right: 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.05);
}

/* Override Leaflet's grab cursor inside the bottom sheet */
.custom-map.clm-has-sheet .clm-bottom-sheet {
    cursor: default !important;
}

/* Text cursor over text inside sheet */
.custom-map.clm-has-sheet .clm-bottom-sheet p,
.custom-map.clm-has-sheet .clm-bottom-sheet h1,
.custom-map.clm-has-sheet .clm-bottom-sheet h2,
.custom-map.clm-has-sheet .clm-bottom-sheet h3,
.custom-map.clm-has-sheet .clm-bottom-sheet h4,
.custom-map.clm-has-sheet .clm-bottom-sheet h5,
.custom-map.clm-has-sheet .clm-bottom-sheet h6 {
    cursor: text !important;
}

/* Links inside sheet: pointer */
.custom-map.clm-has-sheet .clm-bottom-sheet a {
    cursor: pointer !important;
}

/* Responsive tweaks */
@media (max-width: 480px) {
    .clm-sheet-content {
        width: 90%;
    }

    .clm-popup-thumb {
        display: none;
    }

    .clm-popup-row {
        min-height: 0;
    }
}

/* Map background */
.leaflet-container {
    background: #f8ede8;
}

/* Filter UI container (top-left of map) */
.clm-filter {
    position: absolute;
    top: 60px;
    /* <-- move it below the close button */
    right: 16px;
    left: auto;
    z-index: 600;
    font-size: 13px;
}

/* Reset + style filter toggle button */
.clm-filter .clm-filter-toggle {
    all: unset;
    /* remove Elementor interference */
    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 7px 14px;
    border-radius: 8px;
    /* match close button rounding */
    background: #ffffff;
    /* white button */
    color: #000000;
    /* black text */
    font-size: 13px;
    font-weight: 600;

    border: 2px solid rgba(0, 0, 0, 0.2);
    /* subtle border */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.20);

    cursor: pointer;
    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.08s ease;
}

.clm-filter .clm-filter-toggle::before {
    content: "⛭";
    /* gear icon */
    font-size: 13px;
}

.clm-filter .clm-filter-toggle:hover {
    background: #cc3366;
    /* light grey hover */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    transform: translateY(-1px);
}

/* Active click */
.clm-filter .clm-filter-toggle:active {
    transform: scale(0.97);
}

/* Panel itself */
.clm-filter-panel {
    position: absolute;
    top: 36px;
    /* match button height */
    right: 0;
    left: auto;
    min-width: 160px;
    padding-top: 8px;
    display: none;
}

.clm-filter-panel--open {
    display: block;
}

.clm-filter-panel-inner {
    max-height: 220px;
    overflow-y: auto;
    padding: 10px 10px 8px;
    border-radius: 10px;

    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

/* Individual filter items */
.clm-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    cursor: pointer;
}

.clm-filter-item:last-child {
    margin-bottom: 0;
}

.clm-filter-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.clm-filter-item span {
    text-transform: capitalize;
}

/* On mobile, tuck panel a little closer */
@media (max-width: 480px) {

    /* Push filter button further down so it's not behind the close button */
    .clm-filter {
        top: 60px;
        /* was 56 / 60 – move it clearly below the close button */
        right: 12px;
        left: auto;
    }

    .clm-filter-panel {
        top: 36px;
        /* relative to the filter button itself */
        right: 0;
        left: auto;
    }

    .clm-filter-panel-inner {
        max-width: 70vw;
    }
}