/* Compact Scouts-style locator results, with list numbers matching map pins. */
#wpsl-wrap .swgs-results-heading {
    margin: 0;
    padding: 24px 30px 16px;
    border-bottom: 1px solid #d8d8d8;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
}

#wpsl-wrap #wpsl-stores {
    padding: 0 30px;
}

#wpsl-wrap #wpsl-stores li.swgs-result-row {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #d8d8d8;
}

#wpsl-wrap #wpsl-stores li.swgs-result-row:last-child {
    border-bottom: 0;
}

#wpsl-wrap .swgs-result-link {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 22px 0;
    color: inherit;
    text-decoration: none;
}

#wpsl-wrap .swgs-result-link:hover .swgs-result-name,
#wpsl-wrap .swgs-result-link:focus .swgs-result-name {
    text-decoration: underline;
}

#wpsl-wrap .swgs-result-link:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

#wpsl-wrap .swgs-result-pin {
    position: relative;
    flex: 0 0 27px;
    width: 27px;
    height: 35px;
    margin-top: 1px;
    border-radius: 50% 50% 50% 0;
    background: #000;
    transform: rotate(-45deg);
}

#wpsl-wrap .swgs-result-pin span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    transform: rotate(45deg) translate(1px, -1px);
}

#wpsl-wrap .swgs-result-copy {
    min-width: 0;
    flex: 1 1 auto;
}

#wpsl-wrap .swgs-result-name {
    display: block;
    margin-bottom: 8px;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    color: #000;
}

#wpsl-wrap .swgs-result-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
    gap: 14px;
    align-items: start;
    color: #616161;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 400;
}

#wpsl-wrap .swgs-result-sections,
#wpsl-wrap .swgs-result-place {
    font-weight: 400;
}

#wpsl-wrap .swgs-result-sections {
    min-width: 0;
}

#wpsl-wrap .swgs-result-place {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 767px) {
    #wpsl-wrap .swgs-results-heading {
        padding: 20px 22px 14px;
        font-size: 18px;
    }

    #wpsl-wrap #wpsl-stores {
        padding: 0 22px;
    }

    #wpsl-wrap .swgs-result-link {
        gap: 14px;
        padding: 19px 0;
    }

    #wpsl-wrap .swgs-result-name {
        font-size: 19px;
        margin-bottom: 7px;
    }

    #wpsl-wrap .swgs-result-meta {
        grid-template-columns: minmax(0, 1fr) minmax(105px, auto);
        gap: 10px;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    #wpsl-wrap .swgs-result-meta {
        display: block;
    }

    #wpsl-wrap .swgs-result-place {
        display: block;
        margin-top: 3px;
        text-align: left;
    }
}

/* On phones, let the result panel use the full locator width. */
@media (max-width: 767px) {
    #wpsl-wrap #wpsl-result-list {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #wpsl-wrap .swgs-results-heading {
        padding-left: 20px;
        padding-right: 20px;
    }

    #wpsl-wrap #wpsl-stores {
        padding-left: 20px;
        padding-right: 20px;
    }

    #wpsl-wrap .swgs-result-meta {
        grid-template-columns: minmax(0, 1fr) max-content;
    }
}

/* v1.5.4: use the complete mobile result width and stop metadata columns
 * squeezing the section list on narrow locator panels. */
@media (max-width: 767px) {
    #wpsl-wrap #wpsl-stores {
        padding-left: 0;
        padding-right: 0;
    }

    #wpsl-wrap #wpsl-stores li.swgs-result-row {
        width: 100%;
    }

    #wpsl-wrap .swgs-result-link {
        box-sizing: border-box;
        width: 100%;
        padding: 18px 14px;
        gap: 12px;
    }

    #wpsl-wrap .swgs-result-meta {
        display: block;
    }

    #wpsl-wrap .swgs-result-place {
        display: block;
        margin-top: 3px;
        text-align: left;
        white-space: normal;
    }
}

/* v1.5.5: the SFL mobile layout can leave an inset wrapper around the result
 * panel even when #wpsl-result-list itself is full width. Normalise every
 * wrapper between the result panel and list, and use a single-column metadata
 * layout throughout the mobile breakpoint. */
@media (max-width: 767px) {
    #wpsl-wrap.wpsl-mobile #wpsl-result-list,
    #wpsl-wrap.wpsl-mobile #wpsl-result-list > div,
    #wpsl-wrap.wpsl-mobile #wpsl-stores,
    #wpsl-wrap.wpsl-mobile #wpsl-stores > ul {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #wpsl-wrap.wpsl-mobile #wpsl-stores {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #wpsl-wrap.wpsl-mobile .swgs-results-heading {
        box-sizing: border-box;
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    #wpsl-wrap.wpsl-mobile .swgs-result-link {
        padding-left: 10px;
        padding-right: 10px;
    }

    #wpsl-wrap.wpsl-mobile .swgs-result-meta {
        display: block;
    }

    #wpsl-wrap.wpsl-mobile .swgs-result-place {
        display: block;
        margin-top: 3px;
        text-align: left;
        white-space: normal;
    }
}

/* v1.5.6: SFL fixes the complete locator wrapper at 400px on desktop.  Let
 * the map retain the available page width and give the overlaid result panel
 * enough room for the national-style two-column metadata layout. */
@media (min-width: 768px) {
    .sfl-wpsl-filter-map,
    #wpsl-wrap.sfl-wpsl-locator {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
    }

    #wpsl-wrap.sfl-wpsl-locator #wpsl-gmap {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
    }

    #wpsl-wrap.sfl-wpsl-locator #wpsl-result-list {
        box-sizing: border-box !important;
        width: clamp(420px, 31vw, 520px) !important;
        max-width: calc(100% - 48px) !important;
    }

    #wpsl-wrap.sfl-wpsl-locator #wpsl-stores,
    #wpsl-wrap.sfl-wpsl-locator #wpsl-stores > ul,
    #wpsl-wrap.sfl-wpsl-locator #wpsl-stores li.swgs-result-row {
        box-sizing: border-box;
        width: 100%;
        max-width: none;
    }

    #wpsl-wrap.sfl-wpsl-locator .swgs-result-meta {
        grid-template-columns: minmax(0, 1fr) max-content;
    }
}
/* v1.5.7: keep each result row edge-to-edge so the hover/focus background
 * covers the complete panel width.  Put the visual gutter on the link
 * content instead of on #wpsl-stores. */
#wpsl-wrap #wpsl-stores {
    padding-left: 0;
    padding-right: 0;
}

#wpsl-wrap #wpsl-stores li.swgs-result-row {
    box-sizing: border-box;
    width: 100%;
}

#wpsl-wrap .swgs-result-link {
    box-sizing: border-box;
    width: 100%;
    padding-left: 30px;
    padding-right: 30px;
}

#wpsl-wrap .swgs-result-link:hover,
#wpsl-wrap .swgs-result-link:focus {
    background: inherit;
}

@media (max-width: 767px) {
    #wpsl-wrap .swgs-result-link,
    #wpsl-wrap.wpsl-mobile .swgs-result-link {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* v1.5.8: keep the desktop results card compact so the map remains the
 * dominant visual while preserving enough width for the two-column metadata. */
@media (min-width: 768px) {
    #wpsl-wrap.sfl-wpsl-locator #wpsl-result-list {
        width: clamp(420px, 31vw, 520px) !important;
    }

    #wpsl-wrap.sfl-wpsl-locator .swgs-result-link {
        gap: 14px;
        padding-left: 24px;
        padding-right: 24px;
    }

    #wpsl-wrap.sfl-wpsl-locator .swgs-result-meta {
        gap: 10px;
    }
}

/* v1.5.9: balance the enhanced SFL locator controls.  Treat the postcode
 * field and search action as one compound control, and prevent the location
 * column from consuming almost the entire desktop toolbar. */
@media (min-width: 768px) {
    #wpsl-wrap.sfl-wpsl-locator .sfl-locator-primary-controls {
        display: grid !important;
        grid-template-columns: minmax(360px, 2fr) minmax(210px, 0.72fr) minmax(210px, 0.72fr) !important;
        gap: 12px !important;
        align-items: end !important;
        width: 100% !important;
    }

    #wpsl-wrap.sfl-wpsl-locator .sfl-locator-location-search {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 52px !important;
        gap: 0 !important;
        min-width: 0 !important;
        align-items: end !important;
    }

    #wpsl-wrap.sfl-wpsl-locator .sfl-locator-location-search .wpsl-input,
    #wpsl-wrap.sfl-wpsl-locator .sfl-locator-location-search .wpsl-search-btn-wrap {
        float: none !important;
        width: auto !important;
        margin: 0 !important;
    }

    #wpsl-wrap.sfl-wpsl-locator #wpsl-search-input,
    #wpsl-wrap.sfl-wpsl-locator #wpsl-search-btn,
    #wpsl-wrap.sfl-wpsl-locator .sfl-wpsl-filter .wpsl-selected-item {
        box-sizing: border-box !important;
        min-height: 52px !important;
        height: 52px !important;
    }

    #wpsl-wrap.sfl-wpsl-locator #wpsl-search-input {
        width: 100% !important;
        margin: 0 !important;
        border-right: 0 !important;
    }

    #wpsl-wrap.sfl-wpsl-locator #wpsl-search-btn {
        display: block !important;
        width: 52px !important;
        min-width: 52px !important;
        margin: 0 !important;
        border-left: 0 !important;
    }

    #wpsl-wrap.sfl-wpsl-locator .sfl-wpsl-filter,
    #wpsl-wrap.sfl-wpsl-locator .sfl-wpsl-filter .wpsl-dropdown,
    #wpsl-wrap.sfl-wpsl-locator .sfl-wpsl-filter .wpsl-selected-item {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
}

/* At restricted desktop/tablet widths, give location its own row and keep
 * the two filters balanced beneath it instead of squeezing all three. */
@media (min-width: 768px) and (max-width: 1050px) {
    #wpsl-wrap.sfl-wpsl-locator .sfl-locator-primary-controls {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }

    #wpsl-wrap.sfl-wpsl-locator .sfl-locator-location-search {
        grid-column: 1 / -1 !important;
    }
}

/* v1.5.10: LastPass can inject a zero-sized helper element beside the postcode
 * input after initial layout.  Some browser/extension combinations still make
 * that node participate in the control's sizing, which shifts the compound
 * postcode/search control.  The locator field is not a credential field, so
 * exclude only the LastPass helper inside this specific wrapper. */
#wpsl-wrap.sfl-wpsl-locator .sfl-locator-location-search .wpsl-input {
    position: relative !important;
    min-width: 0 !important;
}

#wpsl-wrap.sfl-wpsl-locator .sfl-locator-location-search .wpsl-input > [data-lastpass-icon-root] {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}
