.cxm {
    --cxm-red: #ff0000;
    --cxm-ink: #111111;
    --cxm-muted: #666666;
    --cxm-paper: #ffffff;
    --cxm-line: #e5e5e5;
    position: relative;
    width: 100%;
    min-height: 360px;
    overflow: hidden;
    border: 1px solid var(--cxm-line);
    border-radius: 18px;
    background: #f6f7f8;
    box-shadow: 0 18px 50px rgba(17, 17, 17, 0.08);
    font-family: "Open Sans", Arial, sans-serif;
}

.cxm__canvas {
    width: 100%;
    min-height: 360px;
    opacity: 0;
    transition: opacity 240ms ease;
}

.cxm__canvas.is-loaded {
    opacity: 1;
}

.cxm__filter {
    position: absolute;
    z-index: 5;
    top: 18px;
    left: 18px;
    width: min(380px, calc(100% - 36px));
    color: var(--cxm-ink);
}

.cxm__filter summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(17, 17, 17, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 28px rgba(17, 17, 17, 0.12);
    cursor: pointer;
    list-style: none;
    font-weight: 700;
}

.cxm__filter summary::-webkit-details-marker {
    display: none;
}

.cxm__filter-count {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: var(--cxm-red);
    color: #fff;
    font-size: 12px;
}

.cxm__filter-panel {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid rgba(17, 17, 17, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 32px rgba(17, 17, 17, 0.14);
}

.cxm__filter-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 10px;
}

.cxm__filter-actions button {
    padding: 6px 10px;
    border: 0;
    border-radius: 7px;
    background: #111;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.cxm__filter-actions button:last-child {
    background: #ececec;
    color: #333;
}

.cxm__filter-list {
    max-height: 310px;
    overflow: auto;
    padding-right: 4px;
}

.cxm__filter-list label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 7px 4px;
    border-top: 1px solid #efefef;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.35;
}

.cxm__filter-list input {
    accent-color: var(--cxm-red);
    margin-top: 2px;
}

.cxm-marker {
    position: absolute;
    width: 46px;
    height: 49px;
    padding: 5px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 5px 16px rgba(17, 17, 17, 0.22);
    cursor: default;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.cxm-marker[hidden] {
    display: none;
}

.cxm-marker:hover,
.cxm-marker:focus-visible {
    z-index: 2;
    outline: none;
    transform: scale(1.16);
    box-shadow: 0 8px 24px rgba(255, 0, 0, 0.27);
}

.cxm-marker img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cxm-marker__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.cxm-card-list {
    display: grid;
    max-height: 360px;
    overflow: auto;
}

.cxm .mapboxgl-popup-content {
    overflow: hidden;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(17, 17, 17, 0.2);
}

.cxm-card {
    display: flex;
    flex-direction: column;
    min-width: 230px;
    padding: 15px 17px;
    border-top: 1px solid #ececec;
    background: #fff;
    color: var(--cxm-ink);
    text-decoration: none !important;
}

.cxm-card:first-child {
    border-top: 0;
}

.cxm-card--linked {
    cursor: pointer;
}

.cxm-card--linked:hover,
.cxm-card--linked:focus-visible {
    background: #fff5f5;
}

.cxm-card__name {
    padding-right: 12px;
    color: #111;
    font-size: 15px;
    line-height: 1.25;
}

.cxm-card__location,
.cxm-card__address {
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.cxm-card__website {
    margin-top: 9px;
    color: var(--cxm-red);
    font-size: 12px;
    font-weight: 800;
}

.cxm__empty {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 50%;
    margin: 0;
    padding: 12px 18px;
    border-radius: 10px;
    background: #fff;
    color: #333;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.12);
    transform: translate(-50%, -50%);
}

@media (max-width: 640px) {
    .cxm {
        border-radius: 12px;
    }

    .cxm__filter {
        top: 12px;
        left: 12px;
        width: calc(100% - 24px);
    }

    .cxm__filter-list {
        max-height: 220px;
    }

    .cxm-marker {
        width: 40px;
        height: 43px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cxm__canvas,
    .cxm-marker {
        transition: none;
    }
}
