/* ── Smax Locations Map ────────────────────────────────────────────────────
   Works with Flatsome child theme. All --smax-* vars have fallbacks.
   ──────────────────────────────────────────────────────────────────────── */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.smax-locations {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    width: 100%;
}

.smax-locations--map-only .smax-locations__map-wrap {
    flex: 1;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.smax-locations__sidebar {
    flex: 0 0 clamp(260px, 28%, 360px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 540px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.smax-locations__sidebar::-webkit-scrollbar {
    width: 4px;
}
.smax-locations__sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* ── Location card ───────────────────────────────────────────────────────── */

.smax-locations__card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 16px;
    padding: 20px 22px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.smax-locations__card--has-map {
    cursor: pointer;
}

.smax-locations__card--has-map:hover,
.smax-locations__card--active {
    border-color: var(--smax-primary, #a36b4f);
    box-shadow: 0 4px 16px rgba(163, 107, 79, 0.12);
}

/* Type badge */
.smax-locations__card-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--smax-primary, #a36b4f);
    background: #ffebe5;
    border-radius: 6px;
    padding: 2px 8px;
    margin-bottom: 10px;
}

.smax-locations__card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--smax-text, #1a1a1a);
    margin: 0 0 8px;
    line-height: 1.3;
}

.smax-locations__card-address {
    font-size: 14px;
    color: #66737a;
    margin: 0 0 8px;
    line-height: 1.4;
}

.smax-locations__card-phone,
.smax-locations__card-email {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--smax-primary, #a36b4f);
    text-decoration: none;
    margin-bottom: 4px;
    transition: opacity 0.15s;
}

.smax-locations__card-phone:hover,
.smax-locations__card-email:hover {
    opacity: 0.8;
}

.smax-locations__card-hours {
    font-size: 13px;
    color: #66737a;
    margin: 8px 0 0;
    line-height: 1.5;
}

.smax-locations__card-person {
    font-size: 14px;
    font-weight: 600;
    color: var(--smax-text, #1a1a1a);
    margin: 0 0 10px;
}

.smax-locations__card-desc {
    font-size: 13px;
    color: #66737a;
    line-height: 1.6;
    margin: 10px 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 10px;
}

.smax-locations__card-notes {
    font-size: 13px;
    color: #66737a;
    margin: 8px 0 0;
    line-height: 1.5;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 8px;
}

/* ── Map canvas ──────────────────────────────────────────────────────────── */

.smax-locations__map-wrap {
    flex: 1;
    min-width: 0;
    height: clamp(360px, 45vw, 540px);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    z-index: 0;
}

/* Leaflet container must be plain — overflow/border-radius on wrapper instead */
.smax-locations__map {
    width: 100%;
    height: 100%;
}

/* Leaflet overrides */
.smax-locations__map .leaflet-tile-pane {
    filter: saturate(0.85);
}

/* ── Map popup ───────────────────────────────────────────────────────────── */

.smax-locations-map__popup {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    min-width: 160px;
}

.smax-locations-map__popup strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.smax-locations-map__popup-address,
.smax-locations-map__popup-hours {
    display: block;
    color: #66737a;
    font-size: 13px;
    margin-top: 2px;
}

.smax-locations-map__popup-phone {
    display: block;
    margin-top: 6px;
    font-weight: 600;
    color: var(--smax-primary, #a36b4f);
    text-decoration: none;
}

/* ── Map marker ──────────────────────────────────────────────────────────── */

.smax-locations-map__marker {
    background: transparent;
    border: 0;
}

.smax-locations-map__marker span {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(17, 24, 28, 0.12);
    border-radius: 50% 50% 50% 8px;
    box-shadow: 0 12px 26px rgba(17, 24, 28, 0.28);
    display: flex;
    height: 46px;
    justify-content: center;
    transform: rotate(-45deg);
    transform-origin: center;
    width: 46px;
}

.smax-locations-map__marker img {
    display: block;
    height: 28px;
    object-fit: contain;
    transform: rotate(45deg);
    width: 28px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 849px) {
    .smax-locations {
        flex-direction: column;
    }

    .smax-locations__sidebar {
        flex: none;
        width: 100%;
        max-height: none;
        overflow-y: visible;
    }

    /* Higher specificity to beat .smax-locations--map-only .smax-locations__map-wrap */
    .smax-locations .smax-locations__map-wrap {
        flex: none;
        width: 100%;
        height: clamp(260px, 60vw, 400px);
    }
}
