/*
|--------------------------------------------------------------------------
| Map Container
|--------------------------------------------------------------------------
*/

.klo-location-map {
    width: 100%;
    margin-bottom: 2rem;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.klo-location-map iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/*
|--------------------------------------------------------------------------
| Google Maps Reset
|--------------------------------------------------------------------------
*/

.klo-location-map img {
    max-width: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/*
|--------------------------------------------------------------------------
| Custom Map Markers
|--------------------------------------------------------------------------
*/

.klo-map-marker {
    position: relative;

    width: 28px;
    height: 28px;

    background: #5a7158;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 7px rgba(20, 38, 55, 0.32);

    cursor: pointer;

    transform: scale(1);
    transform-origin: center;

    transition:
        transform 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.klo-map-marker::after {
    position: absolute;
    top: 20px;
    left: 50%;

    width: 10px;
    height: 10px;

    content: "";

    background: #5a7158;
    border-right: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;

    transform: translateX(-50%) rotate(45deg);
}

.klo-map-marker__dot {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 7px;
    height: 7px;

    background: #ffffff;
    border-radius: 50%;

    transform: translate(-50%, -50%);
}

.klo-map-marker--active {
    background: #3f5f43;

  box-shadow:
        0 0 0 5px rgba(90, 113, 88, 0.25),
        0 4px 12px rgba(20, 38, 55, 0.38);

    transform: scale(1.28);
}

.klo-map-marker--active::after {
     background: #3f5f43;
}

/*
|--------------------------------------------------------------------------
| InfoWindow Content
|--------------------------------------------------------------------------
*/

.klo-map-popup {
    min-width: 190px;
    max-width: 260px;
    margin: 0;
    padding: 0;

    font-family: "Inter Tight", sans-serif !important;
    line-height: 1.4;
    text-shadow: none !important;
}

.klo-map-popup strong {
    display: block;
    margin: 0 0 0.25rem;

    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.klo-map-popup strong a {
    color: #163f5f !important;

    font-weight: 700;

    text-decoration: none !important;
    text-shadow: none !important;
}

.klo-map-popup strong a:hover,
.klo-map-popup strong a:focus {
    color: #2d6c89 !important;

    text-decoration: underline !important;
    text-underline-offset: 0.15em;
}

.klo-map-location {
    margin-top: 0.15rem;

    color: #687681;
    font-size: 0.875rem;
    line-height: 1.35;
}

.klo-map-popup__action {
    display: inline-flex;
    align-items: center;

    margin-top: 0.7rem;

    color: #163f5f !important;

    font-family: "Inter Tight", sans-serif !important;
    font-size: 0.875rem;
    font-weight: 700;

    text-decoration: none !important;
    text-shadow: none !important;
}

.klo-map-popup__action::after {
    margin-left: 0.35rem;

    content: "→";

    transition: transform 150ms ease;
}

.klo-map-popup__action:hover,
.klo-map-popup__action:focus {
    color: #2d6c89 !important;
}

.klo-map-popup__action:hover::after,
.klo-map-popup__action:focus::after {
    transform: translateX(2px);
}

/*
|--------------------------------------------------------------------------
| Google InfoWindow Shell
|--------------------------------------------------------------------------
*/

.gm-style .gm-style-iw-c {
    padding: 0 !important;

    background: #ffffff !important;
    border: 1px solid #d9e0e6 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(20, 38, 55, 0.18) !important;
}

/*
 * Google creates a separate header row for the close button.
 * Collapse that row so it does not reserve vertical space.
 */

.gm-style .gm-style-iw-chr {
    position: absolute !important;
    z-index: 2;
    top: 0;
    right: 0;

    width: 40px !important;
    height: 40px !important;
    min-height: 0 !important;

    pointer-events: none;
}

.gm-style .gm-style-iw-d {
    max-height: none !important;
    padding: 1rem 2.8rem 1rem 1rem !important;
    overflow: visible !important;
}

.gm-style .gm-style-iw-d > div {
    margin: 0 !important;
    padding: 0 !important;
}

.gm-style .gm-style-iw-tc::after {
    background: #ffffff !important;
    box-shadow: none !important;
}

/*
|--------------------------------------------------------------------------
| Google InfoWindow Close Button
|--------------------------------------------------------------------------
*/

.gm-style button.gm-ui-hover-effect {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;

    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;

    background: #f4f7f9 !important;
    border: 0 !important;
    border-radius: 7px !important;
    box-shadow: none !important;

    opacity: 1 !important;
    pointer-events: auto;

    transform: none !important;
}

.gm-style button.gm-ui-hover-effect:hover,
.gm-style button.gm-ui-hover-effect:focus {
    background: #e8eef2 !important;
    box-shadow: none !important;
    transform: none !important;
}

.gm-style button.gm-ui-hover-effect span {
    width: 18px !important;
    height: 18px !important;
    margin: 7px !important;
}
/*
|--------------------------------------------------------------------------
| Map Marker Colors
|--------------------------------------------------------------------------
*/

/* Default marker */
.klo-map-marker {
    background-color: #00A6D6 !important;
    border: 3px solid #ffffff !important;

    filter:
        drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45))
        drop-shadow(0 0 3px rgba(0, 0, 0, 0.25));
}

/* Keep the center dot white */
.klo-map-marker__dot {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Selected marker */
.klo-map-marker.klo-map-marker--active {
    background-color: #E32636 !important;

    filter:
        drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 4px rgba(0, 0, 0, 0.3));
}
.klo-map-marker::after {
    background-color: #00A6D6 !important;
}

.klo-map-marker.klo-map-marker--active::after {
    background-color: #E32636 !important;
}
/*
|--------------------------------------------------------------------------
| Interactive Discovery Map
|--------------------------------------------------------------------------
*/

.klo-discovery-map {
    width: 100%;
}

.klo-discovery-map__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 1rem;
}

.klo-discovery-map__filter {
    appearance: none;
    min-height: 42px;
    padding: 0.65rem 1rem;
    color: #163f5f !important;
    background: #ffffff !important;
    border: 1px solid #cbd7df !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    font-family: "Inter Tight", sans-serif !important;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: none !important;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.klo-discovery-map__filter:hover,
.klo-discovery-map__filter:focus-visible {
    color: #ffffff !important;
    background: #2d6c89 !important;
    border-color: #2d6c89 !important;
}

.klo-discovery-map__filter.is-active {
    color: #ffffff !important;
    background: #163f5f !important;
    border-color: #163f5f !important;
}

.klo-discovery-map__status {
    display: flex;
    align-items: center;
    min-height: 24px;
    margin: 0 0 0.65rem;
    color: #687681;
    font-family: "Inter Tight", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
}

.klo-discovery-map.is-loading .klo-discovery-map__status::after {
    width: 14px;
    height: 14px;
    margin-left: 0.55rem;
    content: "";
    border: 2px solid #cbd7df;
    border-top-color: #163f5f;
    border-radius: 50%;
    animation: klo-map-spin 700ms linear infinite;
}

.klo-location-map--discovery {
    height: var(--klo-discovery-map-height, 760px);
    min-height: 520px;
    margin-bottom: 0;
    aspect-ratio: auto;
    border: 1px solid #d5dde5;
    border-radius: 12px;
}

.klo-discovery-map__message {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    color: #7a2630;
    background: #fff5f5;
    border: 1px solid #efc7cb;
    border-radius: 8px;
    font-family: "Inter Tight", sans-serif;
}

@keyframes klo-map-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .klo-discovery-map__filters {
        flex-wrap: nowrap;
        padding-bottom: 0.35rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .klo-discovery-map__filter {
        flex: 0 0 auto;
    }

    .klo-location-map--discovery {
        height: min(var(--klo-discovery-map-height, 620px), 70vh);
        min-height: 480px;
    }
}

/* =======================================================
   EVENT DETAIL MAP
   ======================================================= */
.klo-event-map {
    width: 100%;
    min-height: 320px;
    overflow: hidden;
    border-radius: 12px;
}

/* Prevent global Elementor/site image styles from affecting Google map tiles. */
.klo-event-map img {
    max-width: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Event map fallback used only when address geocoding cannot be resolved. */
.klo-event-map-fallback {
    width: 100%;
    margin-bottom: 2rem;
    overflow: hidden;
}

.klo-event-map-fallback iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Discovery map context switcher */
.klo-discovery-map__contexts {
    display: inline-flex;
    gap: 0;
    margin: 0 0 1rem;
    padding: 4px;
    background: #eef3f6;
    border-radius: 999px;
}

.klo-discovery-map__context {
    appearance: none;
    min-height: 42px;
    padding: 0.65rem 1.35rem;
    color: #163f5f !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    font-family: "Inter Tight", sans-serif !important;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
}

.klo-discovery-map__context.is-active {
    color: #ffffff !important;
    background: #163f5f !important;
}
