/* ═══════════════════════════════════════════════════════════════
   Locations archive page
   ═══════════════════════════════════════════════════════════════ */

.locations-page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 0px 60px;
}

/* ── Unified search + filter card ──────────────────────────────── */
.locations-search-widget {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 64px;
    box-shadow: 0 12px 20px 0 rgba(66, 66, 66, 0.15);
    padding: 16px 32px;
}

/* ── Search bar ─────────────────────────────────────────────────── */
.locations-search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    /* padding: 0 16px; */
    height: 52px;
    padding: 16px 24px;
    border-radius: 8px;
    border: solid 1px rgba(40, 49, 88, 0.15);
    background-color: #f9fbfd;
}
.locations-search-icon {
    display: flex;
    align-items: center;
    color: #9ca3af;
    flex-shrink: 0;
    margin-right: 10px;
}
.breakdance input.locations-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #1E293B;
    background: transparent;
    min-width: 0;
}
.breakdance .locations-search-input::placeholder { color: #9ca3af; }
.breakdance .locations-use-location {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    border-left: 1.5px solid #e5e7eb;
    padding: 0 0 0 16px;
    margin-left: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    height: 100%;
    transition: color 0.2s;
}

.breakdance .locations-use-location-text {
 font-family: "Nunito", sans-serif;
 font-size: 14px;
 font-weight: 600;
 color:  #1e293b;
}
.breakdance .locations-use-location:hover { color: #1E293B; }
.breakdance .locations-use-location:disabled { opacity: 0.5; cursor: default; }

/* ── Region filter row ──────────────────────────────────────────── */
.locations-filters-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 0;
    justify-content: center;
}
/* Region select — visible on all breakpoints */
.locations-region-select-wrap {
    display: block;
    position: relative;
    flex-shrink: 0;
}
.breakdance .locations-region-select {
    appearance: none;
    -webkit-appearance: none;
    /* padding: 0px 28px 0px 10px; */
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color:  #1e293b;
    cursor: pointer;
    font-family: "Nunito Sans", sans-serif;
    outline: none;
    field-sizing: content;
    border-right: 1px solid  rgba(40, 49, 88, 0.15);
    margin-right: 12px;
}
.breakdance .locations-region-select:focus { outline: none; }
/* Desktop: chevron wrap holds the absolute position, SVG sits inside it */
.locations-select-chevron-wrap {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    color: #6b7280;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.locations-select-chevron {
    width: 20px;
    height: 30px;
    pointer-events: none;
    color: inherit;
}
/* Desktop tabs — flex: 1 lets tabs fill remaining row space beside the Region select */
.locations-region-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-width: 0; }
/* Location quick-jump select — desktop hidden, shown on mobile in place of tabs */
.locations-loc-select {
    display: none;
}
.locations-loc-select-wrap { display: none; }
.locations-region-tab {
    padding: 10px 16px;
    border-radius: 8px;
    font-family: "Nunito Sans", sans-serif;
    border: solid 1px rgba(40, 49, 88, 0.15);
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.18s, border-color 0.18s;
    line-height: 1;
    white-space: nowrap;
    color: #1e293b ;
}
.locations-region-tab.is-active,
.locations-region-tab:hover {
    background-color: #cdd9a3;
    border: solid 1px rgba(40, 49, 88, 0.15);
}


/* ── Count line ─────────────────────────────────────────────────── */
.locations-list-panel {
    min-width: 0;
}
.locations-count-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 26px;
    margin-bottom: 24px;
}
.breakdance .locations-count {
    font-family: "Nunito Sans", sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    color: #1e293b;
}
.locations-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: none;
    font-family: "Nunito", sans-serif;
    font-size: 16px;
    font-weight: bold;
    font-stretch: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-align: left;
    color: #1e293b;
    cursor: pointer;
}
.locations-clear-filters[hidden] { display: none; }
.locations-clear-filters:hover { color: #1E293B; }
.locations-clear-filters svg { flex-shrink: 0; }

/* ── Split layout ───────────────────────────────────────────────── */
.locations-split {
    display: grid;
    grid-template-columns: minmax(0, 518fr) minmax(0, 570fr);
    gap: 64px;
    align-items: start;
}

/* ── List panel ─────────────────────────────────────────────────── */
.locations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* max-height: calc(100vh - 180px); */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
    padding-right: 4px;
}
.locations-list::-webkit-scrollbar { width: 4px; }
.locations-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* ── Card wrapper ───────────────────────────────────────────────── */
.loc-card-wrap {
    flex: 0 0 auto;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    transition: border 0.2s;
    outline: none;
}
.loc-card-wrap:focus-visible .loc-card{ border: 1px solid #4F8F8B; }
.loc-card-wrap.is-highlighted .loc-card{ border: 1px solid #4F8F8B; }

/* ── Card ───────────────────────────────────────────────────────── */
.loc-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    min-height: 100px;
    padding: 17px;
}

/* Image column */
.loc-card-img {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
}
.breakdance .loc-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.loc-card-img--empty {
    background: #f1f5f9;
    min-height: 150px;
}

/* Home Care badge */
.loc-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #d1fae5;
    color: #065f46;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
}

/* Body column */
.loc-card-body {
    padding: 0 0px 0px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* Distance and region label */
.loc-card-distance {
    padding: 4px 6px;
    border-radius: 16px;
    background-color: rgba(59, 100, 179, 0.1);
    font-family: "Nunito Sans", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #3157a8;
    align-self: flex-start;
}
.loc-card-distance.hidden { display: none; }

.breakdance .loc-card-title {
    margin: 4px 0 0 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    color: #1e293b;
}

.breakdance  .loc-card-title a {
    font-family: "Nunito Sans", sans-serif;
    font-size: 18px;
    font-weight: bold;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: normal;
    text-align: left;
    color: #1e293b;
    text-decoration: none;
}
.loc-card-title a:hover { color: #4F8F8B; }

.loc-card-meta {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin: 0;
    font-family: "Nunito Sans", sans-serif;
    font-size: 14px;
    font-weight: normal;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.4;
    letter-spacing: normal;
    text-align: left;
    color: #64748b;
}
.loc-card-meta svg { flex-shrink: 0; margin-top: 5px; color: #9ca3af; }
.breakdance .loc-card-meta a { color: #64748b; text-decoration: none; font-family: "Nunito Sans", sans-serif;
    font-size: 14px; }
.loc-card-meta a:hover { color: #4F8F8B; }

.loc-card-services {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}
.loc-card-service {
    border: solid 1px rgba(49, 87, 168, 0.3);
    border-radius: 16px;
    padding: 4px 6px;
    font-family: "Nunito Sans", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #3157a8;
}
.loc-card-services-more {
    font-family: "Nunito Sans", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #64748b;
}

/* Action buttons */
.loc-card-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    padding-top: 12px;
    flex-wrap: wrap;
}
.loc-card-actions .loc-btn {
    flex: 1;
    justify-content: center;
}
.breakdance .loc-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
    line-height: 1;
    border: solid 1px rgba(40, 49, 88, 0.15);;
}
.loc-btn--outline {
    border-color: #d1d5db;
    color: #374151;
    background: #fff;
}
.loc-btn--outline:hover { border-color: #4F8F8B; color: #4F8F8B; }
.loc-btn--primary {
    background: #CDD9A3;
    color: #1E293B;
    border-color: #CDD9A3;
}
.loc-btn--primary:hover { background: #4F8F8B; border-color: #4F8F8B; color: #fff; }
.loc-btn--full { width: 100%; justify-content: center; }

/* ── Map panel ──────────────────────────────────────────────────── */
.locations-map-wrap {
    position: sticky;
    top: 112px;
    margin-top: 50px; /* lines the map up with the first card (Figma) */
}
.admin-bar .locations-map-wrap { top: 144px; }
#locations-map {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: calc(100vh - 136px);
    border-radius: 8px;
    border: 1px solid rgba(193, 200, 194, 0.4);
    overflow: hidden;
    z-index: 0;
    background: #eceff1;
}

/* ── Leaflet butterfly marker ────────────────────────────────── */
.loc-map-marker {
    background: none !important;
    border: none !important;
}
.loc-butterfly-wrap {
    position: relative;
    display: flex;
    justify-content: center;
}
.locations-page-wrap .leaflet-container .leaflet-marker-pane .loc-butterfly-wrap img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    padding: 0;
    display: block;
    transition: transform 0.18s;
    /* filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25)); */
    margin-top: 5px;
}
.loc-marker-label {
    position: absolute;
    bottom: calc(100% - 4px);
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    pointer-events: none;
}
.loc-map-marker.is-active .loc-butterfly-wrap img {
    transform: scale(1.35);
}

/* ── Legend ─────────────────────────────────────────────── */
.loc-map-legend {
    background: rgba(255,255,255,0.92);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.loc-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    padding: 3px 0;
    font-size: 10px;;
}
.loc-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}
.loc-legend-swatch--physical { background: #4F8F8B; }
.loc-legend-swatch--hc       { background: #3157A8; }

/* ── User location dot ──────────────────────────────────────────── */
.loc-user-marker { background: none !important; border: none !important; }
.loc-user-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4F8F8B;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(79,143,139,0.4);
    animation: user-pulse 2s ease-in-out infinite;
}
@keyframes user-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(79,143,139,0.4); }
    50%       { box-shadow: 0 0 0 10px rgba(79,143,139,0.06); }
}

/* ── Location services list (ACF post object links) ───────────── */
.breakdance .location-services-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(6, auto);
    grid-auto-flow: column;
    column-gap: 32px;
    row-gap: 16px;
}
.breakdance .location-services-list > li {
    margin: 0;
}
.breakdance .location-services-list > li:nth-child(n + 13) {
    display: none;
}
.breakdance .location-services-list > li > a {
    position: relative;
    display: inline-block;
    padding: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.6;
    letter-spacing: normal;
    text-align: left;
    color: #1e293b;
    text-decoration: none;
    transition: padding-left 220ms ease, color 220ms ease;
}
.breakdance .location-services-list > li > a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 41%;
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    opacity: 0;
    transform: translate(-6px, -50%) rotate(45deg);
    transition: opacity 220ms ease, transform 220ms ease;
}
.breakdance .location-services-list > li > a::after {
    content: "";
    position: absolute;
    left: 16px;
    bottom: 8px;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 220ms ease;
}
.breakdance .location-services-list > li > a:hover::before,
.breakdance .location-services-list > li > a:focus-visible::before {
    opacity: 1;
    transform: translate(0, -50%) rotate(45deg);
}
.breakdance .location-services-list > li > a:hover,
.breakdance .location-services-list > li > a:focus-visible {
    padding-left: 17px;
    color: #1e293b;
}
.breakdance .location-services-list > li > a:hover::after,
.breakdance .location-services-list > li > a:focus-visible::after {
    width: calc(100% - 17px);
}
.breakdance .location-services-list > li > a:focus-visible {
    outline: none;
}

@media (max-width: 767px) {
    .breakdance .location-services-list {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-auto-flow: row;
        width: 100%;
    }
    .breakdance .location-services-list > li > a {
        padding-left: 17px;
    }
    .breakdance .location-services-list > li > a::before {
        opacity: 1;
        transform: translate(0, -50%) rotate(45deg);
    }
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .locations-split {
        grid-template-columns: 1fr;
    }
    .locations-map-wrap {
        position: static;
    }
    .loc-card-wrap {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .locations-count-line {
        font-size: 14px;
    }
    .loc-card {
        grid-template-columns: 1fr;
        width: 100%;
        box-sizing: border-box;
        padding: 16px;
    }
    .loc-card-img {
        width: 100%;
        height: 200px;
    }
    .loc-card-body { padding: 16px 0 0; }
    .loc-card-actions { padding: 12px 0 0; }
    #locations-map {
        min-width: 0;
        min-height: 0;
        border-radius: 12px;
    }
    .locations-list {
        max-height: none;
        overflow-y: visible;
        overflow-x: hidden;
    }
    .locations-region-tabs { display: none; }
    .locations-use-location-text { display: none; }
    /* Pill-button style for both filter dropdowns */
    .locations-search-widget {padding-left: 16px; padding-right: 16px;}
    .locations-filters-row { gap: 16px; padding: 16px 0 0 0; }
    .locations-region-select-wrap,
    .locations-loc-select-wrap {
        display: flex;
        flex: 1;
        align-items: center;
        background: #fff;
        border: 1px solid rgba(40, 49, 88, 0.15);
        border-radius: 8px;
        height: 48px;
        overflow: hidden;
        min-width: 0;
    }
    .locations-region-select,
    .locations-loc-select {
        display: block;
        appearance: none;
        -webkit-appearance: none;
        border: none !important;
        background: transparent;
        padding: 0 8px 0 12px;
        font-size: 14px;
        font-weight: 500;
        color: #374151;
        cursor: pointer;
        outline: none;
        height: 100%;
        flex: 1;
        min-width: 0;
        max-width: none;
        margin: 0;
        border-radius: 0;
    }
    .locations-region-select-wrap .locations-select-chevron,
    .locations-loc-select-wrap .locations-select-chevron {
        width: 20px;
        height: 30px;
    }
    .locations-region-select-wrap .locations-select-chevron-wrap,
    .locations-loc-select-wrap .locations-select-chevron-wrap {
        position: static;
        transform: none;
        top: auto;
        right: auto;
        margin: 0;
        width: auto;
        height: 100%;
        padding: 0 16px;
        border-left: 1px solid rgba(40, 49, 88, 0.15);
        align-self: stretch;
        flex-shrink: 0;
    }

    .breakdance .loc-btn {
        padding: 15px 8px;
    }
}


/* ── Filters, map and states (2026-09-23) ───────────────────────── */
.loc-card-wrap[hidden],
.loc-card-distance[hidden],
.locations-empty[hidden],
.locations-show-more[hidden] { display: none !important; }

.breakdance .locations-use-location.is-active,
.breakdance .locations-use-location.is-active .locations-use-location-text { color: #4F8F8B; }

.breakdance .locations-empty {
    margin: 0;
    padding: 32px 16px;
    text-align: center;
    color: #64748b;
    font-size: 16px;
    border: 1px dashed rgba(40, 49, 88, 0.15);
    border-radius: 12px;
}
.breakdance .locations-show-more {
    margin-top: 24px;
    padding: 15px 8px;
    font-size: 14px;
}

.loc-marker-label { background: #4F8F8B; text-transform: uppercase; }
.loc-marker-label--hc { background: #3157A8; }
.loc-legend-item { text-transform: uppercase; }
.loc-map-marker.is-active { z-index: 1000 !important; }
.loc-user-marker--search .loc-user-dot {
    background: #3157A8;
    box-shadow: 0 0 0 3px rgba(49, 87, 168, 0.35);
    animation: none;
}

@media (max-width: 1199px) {
    .locations-split { gap: 40px; }
}
@media (max-width: 900px) {
    .locations-map-wrap { margin-top: 32px; }
    #locations-map { aspect-ratio: auto; height: 500px; max-height: none; }
}

.loc-map--labels-off .loc-marker-label { opacity: 0; transition: opacity 0.15s; }
.loc-map--labels-off .loc-map-marker:hover .loc-marker-label,
.loc-map--labels-off .loc-map-marker.is-active .loc-marker-label { opacity: 1; }
.loc-map-marker:hover { z-index: 1000 !important; }
@media (max-width: 900px) {
    .breakdance .locations-region-select,
    .breakdance .locations-loc-select {
        field-sizing: fixed;
        width: 100%;
        margin: 0;
        text-align: center;
        text-align-last: center;
    }
}
