/*
 * Community Directory Map — community-map.css v3
 */

/* ── Wrapper ── */
.cdm-wrap {
    position: relative;
    font-family: inherit;
	width:100%;
}

/* ── Legend ── */
.cdm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
	display:none!Important;
}

.cdm-legend-btn {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    padding: 6px 14px 6px 10px;
    border: 1.5px solid var(--cdm-color, #888);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-family: industria-sans-variable, sans-serif !important;
    font-variation-settings: 'wght' 500, 'wdth' 500;
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, transform 0.12s, opacity 0.15s;
    opacity: 0.5;
	display:none!Important;
}

.cdm-legend-btn.active {
    background: var(--cdm-color, #888);
    color: #fff;
    opacity: 1;
}

.cdm-legend-btn:hover {
    transform: translateY(-1px);
    opacity: 1;
}

.cdm-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cdm-color, #888);
    flex-shrink: 0;
    transition: background 0.18s;
}

.cdm-legend-btn.active .cdm-legend-dot {
    background: rgba(255, 255, 255, 0.8);
}

/* ── Individual markers ──
 *
 * .cdm-out = filtered-out state: collapses to pin tip, fades to transparent.
 * transform and opacity use separate durations so the fade completes while
 * the spring is still settling — the layering feels polished.
 *
 * z-index is managed ENTIRELY by JS mouseenter/mouseleave.
 * Do NOT set z-index here with !important — it overrides inline styles set
 * by JS and causes hovered markers to hide behind neighbors.
 */
.cdm-marker {
    position: absolute;
    width: 40px;
    height: 52px;
    cursor: pointer;
    transform-origin: bottom center;
    will-change: transform, opacity;
    transition:
        transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity   0.28s ease;
}

.cdm-marker.cdm-out {
    transform: scale(0) translateY(6px);
    opacity: 0;
    pointer-events: none;
}

/* Transform/filter on hover — z-index intentionally omitted (handled by JS) */
.cdm-marker:not(.cdm-out):hover {
    transform: scale(1.35) translateY(-5px);
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28));
}

.cdm-marker svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Tooltip ── */
.cdm-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #2a2520;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
    /* Tooltip must stack above its parent's raised z-index */
    z-index: 1;
}

.cdm-marker:not(.cdm-out):hover .cdm-tooltip {
    opacity: 1;
}

/* ── Cluster badge ──
 *
 * A round pill showing the count of grouped markers.
 * Background color = dominant category in the cluster.
 * White ring via box-shadow so it sits cleanly over the map.
 * display is toggled inline by JS (none → flex).
 */
.cdm-cluster {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow:
        0 3px 14px rgba(0, 0, 0, 0.22),
        0 0 0 3.5px rgba(255, 255, 255, 0.88);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
}

.cdm-cluster:hover {
    transform: scale(1.18);
}

/* ── Map wrapper — layout styles are set inline by PHP to guarantee ──
   they apply before Google Maps initialises (avoids mobile height:100% failures) ── */

/* ── Bottom sheet ──
 *
 * Sits inside .cdm-map-wrap so it slides up over the map.
 * pointer-events:none when closed so the map remains interactive.
 * Uses cubic-bezier(0.32, 0.72, 0, 1) — iOS-style deceleration.
 */
.cdm-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.14);
    padding: 10px 20px 28px;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 2000000;
    pointer-events: none;
}

.cdm-sheet.cdm-sheet-open {
    transform: translateY(0);
    pointer-events: auto;
}

/* Drag-handle indicator */
.cdm-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #ddd6ca;
    margin: 0 auto 14px;
}

/* Close button */
.cdm-sheet-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f2ede6;
    color: #8a7e6a;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.cdm-sheet-close:hover {
    background: #e5ddd2;
}

.cdm-sheet-body {
    padding-top: 2px;
}

/* Category row */
.cdm-sheet-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

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

.cdm-sheet-cat {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

/* Location title */
.cdm-sheet-title {
    font-family: industria-sans-variable, sans-serif !important;
    text-transform: uppercase;
    font-size: 30px;
    color: var(--cdm-sheet-color, #2a2520);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 4px;
}

/* Address (optional) */
.cdm-sheet-address {
    font-size: 1rem;
    color: #9a8e82;
    margin-bottom: 16px;
    line-height: 1.4;
    min-height: 0;
}

.cdm-sheet-address:empty {
    margin-bottom: 16px;
}

/* CTA button */
.cdm-sheet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    border-radius: 9px;
    background: var(--cdm-sheet-color, #3a3530);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.025em;
    transition: opacity 0.15s, transform 0.15s;
}

.cdm-sheet-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
