/* ==========================================================================
   Evo Service Map
   Appearance defaults use :where() (zero specificity) so a single-class
   override or the Elementor style controls win without !important.
   Layout rules keep normal specificity.
   ========================================================================== */

/* Defaults live on the outer scope. A saved map's Appearance settings are
   inline vars on this same element; Elementor/Bricks style controls set
   vars on .evo-sm, which override what it inherits from here. */
.evo-sm-scope {
    --evo-sm-biz: #f5b301;
    --evo-sm-core: #f5b301;
    --evo-sm-extended: #8a94a6;
    --evo-sm-dot: 14px;
    --evo-sm-card-bg: #111418;
    --evo-sm-card-text: #ffffff;
    --evo-sm-accent: #f5b301;
    --evo-sm-accent-text: #111418;
    --evo-sm-radius: 10px;
    --evo-sm-item-active: rgba(245, 179, 1, 0.12);
    --evo-sm-divider: rgba(127, 127, 127, 0.25);
}

.evo-sm {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* ---- Layout: list beside map ---------------------------------------- */

.evo-sm--list-right {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
}

.evo-sm--list-left {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.evo-sm--list-left .evo-sm__list {
    order: -1;
}

.evo-sm--side .evo-sm__list {
    max-height: var(--evo-sm-map-h, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 10px;
}

/* Firefox only: Chrome ignores the ::-webkit-scrollbar rules below if
   scrollbar-color is set, so keep the standard properties out of its way. */
@supports not selector(::-webkit-scrollbar) {
    .evo-sm--side .evo-sm__list {
        scrollbar-width: thin;
        scrollbar-color: var(--evo-sm-scroll-thumb, rgba(255, 255, 255, 0.25)) transparent;
    }
}

.evo-sm--side .evo-sm__list::-webkit-scrollbar {
    width: 6px;
}

.evo-sm--side .evo-sm__list::-webkit-scrollbar-track {
    background: transparent;
}

.evo-sm--side .evo-sm__list::-webkit-scrollbar-thumb {
    background: var(--evo-sm-scroll-thumb, rgba(255, 255, 255, 0.25));
    border-radius: 999px;
}

.evo-sm--side .evo-sm__list::-webkit-scrollbar-thumb:hover {
    background: var(--evo-sm-accent);
}

.evo-sm--side .evo-sm__list::-webkit-scrollbar-button {
    display: none;
    height: 0;
}

@media (max-width: 767px) {
    .evo-sm--list-right,
    .evo-sm--list-left {
        grid-template-columns: minmax(0, 1fr);
    }

    .evo-sm--list-left .evo-sm__list {
        order: 0;
    }

    .evo-sm--side .evo-sm__list {
        max-height: none;
        overflow: visible;
    }
}

/* ---- Map ------------------------------------------------------------ */

.evo-sm__map-wrap {
    position: relative;
    height: var(--evo-sm-map-h, 560px);
    overflow: hidden;
}

:where(.evo-sm__map-wrap) {
    border-radius: var(--evo-sm-radius);
    background: #1a1d21;
}

.evo-sm__map {
    position: absolute;
    inset: 0;
}

.evo-sm.is-loading .evo-sm__map-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--evo-sm-accent);
    border-radius: 50%;
    animation: evo-sm-spin 0.8s linear infinite;
    z-index: 3;
}

@keyframes evo-sm-spin {
    to { transform: rotate(360deg); }
}

/* Click-to-load placeholder */
.evo-sm__load {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 100%;
    padding: 0;
    border: 0;
    cursor: pointer;
    background-color: #1a1d21;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.evo-sm__load[hidden],
.evo-sm.is-loading .evo-sm__load {
    display: none;
}

:where(.evo-sm__load-label) {
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--evo-sm-accent);
    color: var(--evo-sm-accent-text);
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* Error state */
.evo-sm__status {
    display: none;
}

.evo-sm.has-error .evo-sm__status {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 20px;
    text-align: center;
    color: #fff;
    background: #1a1d21;
}

/* ---- Markers -------------------------------------------------------- */

.evo-sm__pin {
    position: relative;
    cursor: pointer;
}

/* Business pin: circle with a pointer, anchored at the pointer tip. */
.evo-sm__pin--business {
    width: 44px;
    height: 44px;
    margin-bottom: 9px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--evo-sm-biz);
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    animation: evo-sm-pulse 2.4s ease-out infinite;
}

.evo-sm__pin--business::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top: 9px solid #fff;
    border-bottom: 0;
}

.evo-sm__pin--business:not(.has-image)::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
}

.evo-sm__pin--business img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    pointer-events: none;
}

@keyframes evo-sm-pulse {
    0%   { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), 0 0 0 0 color-mix(in srgb, var(--evo-sm-biz) 60%, transparent); }
    70%  { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), 0 0 0 16px color-mix(in srgb, var(--evo-sm-biz) 0%, transparent); }
    100% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), 0 0 0 0 color-mix(in srgb, var(--evo-sm-biz) 0%, transparent); }
}

/* Town dots: centred on the coordinate (markers anchor bottom-centre). */
.evo-sm__pin--town {
    width: var(--evo-sm-dot);
    height: var(--evo-sm-dot);
    transform: translateY(50%);
    --pin-color: var(--evo-sm-core);
}

.evo-sm__pin--extended {
    --pin-color: var(--evo-sm-extended);
}

.evo-sm__pin--town::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--pin-color);
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease;
}

.evo-sm__pin--town.is-hover::before,
.evo-sm__pin--town.is-active::before {
    transform: scale(1.45);
}

.evo-sm__pin-label {
    position: absolute;
    top: 50%;
    left: calc(100% + 8px);
    transform: translateY(-50%);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

:where(.evo-sm__pin-label) {
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(17, 20, 24, 0.85);
    color: #fff;
    font: 600 12px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
}

.evo-sm--labels-always .evo-sm__pin-label,
.evo-sm__pin.is-hover .evo-sm__pin-label,
.evo-sm__pin.is-active .evo-sm__pin-label {
    opacity: 1;
}

.evo-sm__pin.is-hover,
.evo-sm__pin.is-active {
    z-index: 1;
}

/* Ring labels sit on the top edge of each ring. */
.evo-sm__ring-label {
    transform: translateY(50%);
    white-space: nowrap;
    pointer-events: none;
}

:where(.evo-sm__ring-label) {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--ring-color, #fff);
    background: rgba(17, 20, 24, 0.8);
    color: var(--ring-color, #fff);
    font: 600 11px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
    .evo-sm__pin--business { animation: none; }
    .evo-sm__pin--town::before,
    .evo-sm__pin-label { transition: none; }
}

/* ---- Info card ------------------------------------------------------ */

.evo-sm__card {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 5;
    width: min(320px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    overflow-y: auto;
}

.evo-sm__card[hidden] {
    display: none;
}

:where(.evo-sm__card) {
    padding: 18px 20px;
    border-radius: var(--evo-sm-radius);
    background: var(--evo-sm-card-bg);
    color: var(--evo-sm-card-text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    font-size: 14px;
    line-height: 1.5;
}

.evo-sm__card-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.evo-sm__card-close:hover,
.evo-sm__card-close:focus-visible {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

:where(.evo-sm__card-title) {
    margin: 0 28px 4px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
}

:where(.evo-sm__card-meta) {
    margin: 0 0 8px;
    font-size: 13px;
    opacity: 0.75;
}

:where(.evo-sm__card-body) {
    margin: 0;
    white-space: pre-line;
}

.evo-sm__card-towns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

:where(.evo-sm__card-town) {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

:where(.evo-sm__card-town):hover {
    border-color: var(--evo-sm-accent);
    color: var(--evo-sm-accent);
}

.evo-sm__card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

:where(.evo-sm__btn) {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border: 1px solid var(--evo-sm-accent);
    border-radius: 6px;
    background: var(--evo-sm-accent);
    color: var(--evo-sm-accent-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

:where(.evo-sm__btn--ghost) {
    background: transparent;
    color: inherit;
    border-color: currentColor;
}

:where(.evo-sm__btn):hover {
    filter: brightness(1.08);
}

@media (max-width: 767px) {
    .evo-sm__card {
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
    }
}

/* ---- Town list ------------------------------------------------------ */

/* Text inherits the list colour (Style > Town List > Text colour).
   Heading, group title and links use .evo-sm-scoped selectors so they beat
   theme / Elementor kit rules like `.elementor-kit-x h3` and `a { color }`. */
.evo-sm__list {
    color: var(--evo-sm-list-text, inherit);
    line-height: 1.4;
}

.evo-sm .evo-sm__heading,
.evo-sm .evo-sm__group-title,
.evo-sm .evo-sm__link,
.evo-sm .evo-sm__distance {
    color: inherit;
}

:where(.evo-sm__heading) {
    margin: 0 0 12px;
}

.evo-sm__group + .evo-sm__group {
    margin-top: 18px;
}

:where(.evo-sm__group-title) {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.65;
}

.evo-sm__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.evo-sm .evo-sm__item {
    margin: 0;
    list-style: none;
}

.evo-sm__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    border-bottom: 1px solid var(--evo-sm-divider);
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.evo-sm__item::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--evo-sm-core);
}

.evo-sm__item--extended::before {
    background: var(--evo-sm-extended);
}

.evo-sm__item.is-hover,
.evo-sm__item.is-active {
    background: var(--evo-sm-item-active);
}

.evo-sm__item.is-clickable {
    cursor: pointer;
}

.evo-sm__item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

:where(.evo-sm__link) {
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

:where(a.evo-sm__link):hover {
    text-decoration: underline;
}

:where(.evo-sm__distance) {
    font-size: 12px;
    opacity: 0.65;
}

.evo-sm__locate {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
}

.evo-sm__locate:hover,
.evo-sm__locate:focus-visible {
    opacity: 1;
    background: var(--evo-sm-item-active);
}

/* ---- Editor notice -------------------------------------------------- */

.evo-sm-notice {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-left: 4px solid #d63638;
    background: #fcf0f1;
    color: #1d2327;
    font-size: 13px;
}
