/*****************************
**
** WPSL (WP Store Locator 3.x)
**
** Loaded after the plugin stylesheets (see inc/scripts-and-styles.php),
** so equal specificity is enough to win. Rules that need more than that
** say why in a comment - they answer a specific v3 rule, not a guess.
**
******************************/

#wpsl-wrap button.w-btn:disabled {
    background: none;
    border-width: 1px;
    border-color: var(--color-content-faded);
    color: var(--color-content-text);
    user-select: none;
    pointer-events: none;
}

#wpsl-wrap button.w-btn:disabled::before {
    border-width: 1px;
}


/**** wpsl-search */

/* :has() lifts this over `.wpsl-v3-css #wpsl-wrap:not(.wpsl-has-panel):not(.wpsl-vertical-template) .wpsl-search` (1,4,0) */
#wpsl-wrap > .wpsl-search:has(> #wpsl-search-wrap) {
    margin-bottom: 0;
    padding: 30px 20px;
    background: var(--color-content-bg-alt);
}

@media (min-width: 768px) {
    #wpsl-wrap > .wpsl-search:has(> #wpsl-search-wrap) {
        padding: 30px;
    }
}

/* v3: `#wpsl-search-wrap div:not(#mapbox-autocomplete):not(.wpsl-autocomplete-search-container)` (2,1,1) floats every div and adds margin-inline-end */
#wpsl-wrap #wpsl-search-wrap,
#wpsl-wrap.wpsl-leaf-template #wpsl-search-wrap div {
    float: none;
}

#wpsl-wrap #wpsl-search-wrap form {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

@media (min-width: 1280px) {
    #wpsl-wrap #wpsl-search-wrap form {
        flex-wrap: nowrap;
    }
}

/* margin-left stays free for the button's `margin-left: auto` */
#wpsl-wrap.wpsl-leaf-template #wpsl-search-wrap form > div {
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
}

/* v3 responsive.css: `#wpsl-search-wrap .wpsl-input { margin-bottom: 10px !important }` up to 825px */
@media (max-width: 825px) {
    #wpsl-wrap #wpsl-search-wrap .wpsl-input {
        margin-bottom: 0 !important;
    }
}

#wpsl-wrap #wpsl-search-wrap div label {
    display: block;
    width: initial;
    float: none;
    font-size: 1rem;
    line-height: 32px;
    font-weight: var(--bold-font-weight);
    color: var(--color-content-heading);
    white-space: nowrap;
}

#wpsl-wrap #wpsl-search-wrap .wpsl-input,
#wpsl-wrap #wpsl-search-wrap .wpsl-select-wrap {
    display: block;
    float: none;
}

#wpsl-wrap #wpsl-search-wrap .wpsl-input {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

/* v3: `.wpsl-v3-css #wpsl-search-wrap .wpsl-input > div:not(#wpsl-stadia-autocomplete-results)` (2,2,1) pins the label wrapper to a 40px flex row */
#wpsl-wrap.wpsl-leaf-template #wpsl-search-wrap .wpsl-input > div {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 10px 0 0;
}

@media (max-width: 570px) {
    #wpsl-wrap.wpsl-leaf-template #wpsl-search-wrap .wpsl-input > div {
        margin: 0;
    }
}

@media (min-width: 571px) {
    #wpsl-wrap #wpsl-search-wrap .wpsl-input {
        flex-direction: row;
        align-items: center;
    }
}

@media (min-width: 1280px) {
    #wpsl-wrap #wpsl-search-wrap .wpsl-input {
        max-width: 540px;
    }
}

/* v3 forces a 40px flex box on the input; hand height back to the theme input tokens */
#wpsl-wrap #wpsl-search-wrap input:not([type="submit"]) {
    display: block;
    height: auto;
    min-height: var(--inputs-height, 2em);
    max-height: none;
    line-height: var(--inputs-height, 2em);
    font-size: var(--inputs-font-size, inherit);
    color: var(--inputs-text-color, inherit);
    background: var(--inputs-background, #fff);
    border: 1px solid var(--color-content-bg-alt);
    border-radius: var(--inputs-border-radius, 0px);
    padding: 0 var(--inputs-padding, .6em);
    width: 100%;
}

#wpsl-wrap #wpsl-search-wrap .wpsl-select-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

@media (min-width: 571px) {
    #wpsl-wrap #wpsl-search-wrap .wpsl-select-wrap {
        flex-wrap: nowrap;
    }
}

#wpsl-wrap #wpsl-search-wrap .wpsl-select-wrap #wpsl-radius,
#wpsl-wrap #wpsl-search-wrap .wpsl-select-wrap #wpsl-results {
    display: flex;
    flex-direction: column;
    margin-right: 0;
    width: calc(50% - 10px);
}

@media (min-width: 571px) {
    #wpsl-wrap #wpsl-search-wrap .wpsl-select-wrap #wpsl-radius,
    #wpsl-wrap #wpsl-search-wrap .wpsl-select-wrap #wpsl-results {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
}

#wpsl-wrap #wpsl-search-wrap .wpsl-dropdown {
    width: 100% !important;
    border-radius: 0;
    border: 1px solid var(--color-content-border);
}

#wpsl-wrap #wpsl-search-wrap select.wpsl-dropdown:not([multiple="multiple"]),
#wpsl-wrap #wpsl-search-wrap select.wpsl-dropdown:not([multiple="multiple"]):focus {
    -moz-appearance: none;
    -webkit-appearance: none;
    -o-appearance: none;
    appearance: none;
    position: relative;
    cursor: pointer;
    background: #FFFFFF url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%2374AF0D%22%2F%3E%3C%2Fsvg%3E) no-repeat right 10px top 55% !important;
}

@media (min-width: 1280px) {
    #wpsl-wrap #wpsl-search-wrap .wpsl-dropdown {
        width: 100% !important;
        max-width: 150px;
    }
}

#wpsl-wrap #wpsl-search-wrap .wpsl-dropdown:hover {
    box-shadow: var(--inputs-focus-box-shadow, none);
}

#wpsl-wrap #wpsl-search-wrap .wpsl-dropdown div {
    border: 1px solid var(--color-content-border);
    font-size: 16px;
}

#wpsl-wrap #wpsl-search-wrap .wpsl-dropdown .wpsl-selected-item {
    font-family: var(--inputs-font-family, inherit);
    font-size: var(--inputs-font-size, inherit);
    font-weight: var(--inputs-font-weight, inherit);
    letter-spacing: var(--inputs-letter-spacing, inherit);
    text-transform: var(--inputs-text-transform, inherit);
    border-radius: var(--inputs-border-radius, 0px);
    background: var(--inputs-background, transparent);
    border: none;
    color: var(--inputs-text-color, inherit);
    box-shadow: var(--inputs-box-shadow, none);
    width: 100%;
    min-height: var(--inputs-height, 2em);
    line-height: var(--inputs-height, 2em);
    padding: 0 35px 0 var(--inputs-padding, .6em) !important;
    transition: all 0.2s;
    position: relative;
    display: block;
}

#wpsl-wrap #wpsl-search-wrap .wpsl-dropdown .wpsl-selected-item::after {
    content: '\f078';
    display: inline-block;
    margin-left: 10px;
    font-family: var(--fa-font-family, 'fontawesome');
    font-weight: var(--fa-font-weight, 400);
    border: none;
    color: var(--color-content-primary);
    margin-top: 0;
    transform: translateY(-50%);
}

#wpsl-wrap #wpsl-search-wrap .wpsl-search-btn-wrap {
    width: 100%;
    flex-shrink: 0;
}

/* v3 turns the button into a fixed 40px flex box */
#wpsl-wrap #wpsl-search-wrap .wpsl-search-btn-wrap #wpsl-search-btn {
    display: inline-block;
    height: auto;
    min-height: 0;
    max-height: none;
    font-size: 16px;
    line-height: 1.5;
    font-weight: var(--bold-font-weight);
    font-style: normal;
    text-transform: none;
    letter-spacing: 0em;
    border-radius: 0px;
    padding: 0.8125em 1.875em;
    background: var(--color-content-primary);
    border: none;
    box-shadow: none;
    color: var(--color-content-heading);
    margin: 0;
    float: none;
    width: 100%;
    transition: all .3s ease;
}

.no-touch #wpsl-wrap #wpsl-search-wrap .wpsl-search-btn-wrap #wpsl-search-btn:hover {
    box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.15);
}

@media (min-width: 1280px) {
    #wpsl-wrap #wpsl-search-wrap .wpsl-search-btn-wrap {
        margin-left: auto;
        width: initial;
    }
    #wpsl-wrap #wpsl-search-wrap .wpsl-search-btn-wrap #wpsl-search-btn {
        width: initial;
    }
}


/**** wpsl-map */

/*** infowindow - v3 uses the native Google InfoWindow and tags its .gm-style-iw-c with .wpsl-infobox */

#wpsl-map .wpsl-infobox {
    max-width: 360px !important;
    padding: 30px !important;
    border-radius: 0;
    font-size: 16px;
    line-height: 1.75;
    font-weight: var(--font-weight);
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.25);
}

#wpsl-map .wpsl-infobox .gm-style-iw-chr {
    position: absolute;
    top: 0;
    right: 0;
}

#wpsl-map .wpsl-infobox .gm-style-iw-d {
    overflow: visible !important;
}

@media (min-width: 1280px) {
    #wpsl-map .wpsl-infobox {
        padding: 30px 60px 30px 30px !important;
    }
}

#wpsl-map .wpsl-info-window {
    padding: 0;
}

#wpsl-map .wpsl-info-window p {
    font-family: var(--font-family);
    font-weight: var(--font-weight);
    font-size: 16px;
    color: var(--color-content-text);
}

#wpsl-map .wpsl-info-window p:not(:last-child) {
    margin-bottom: 20px;
}

#wpsl-map .wpsl-info-window p>strong:first-child {
    font-size: 18px;
    display: block;
    margin-bottom: 10px;
}

#wpsl-map .wpsl-info-window .w-btn {
    display: inline-flex;
}

#wpsl-map .wpsl-info-window .wpsl-info-actions {
    display: none;
}


/**** wpsl-search-header */

#wpsl-wrap.wpsl-store-below #wpsl-search-header:not(:first-child) {
    margin-top: 50px;
}

#wpsl-wrap.wpsl-store-below #wpsl-search-header>.wpsl-search-label {
    font-size: 24px;
}


/**** results styling */

/*
 * v3 sets `.wpsl-v3-css #wpsl-result-list li * { font-size: var(--wpsl-font-size-base, 14px) !important }`.
 * Feeding that variable is how the sizes below get through without !important of our own.
 */
#wpsl-wrap.wpsl-store-below #wpsl-result-list {
    --wpsl-font-size-base: 1em;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li {
    --wpsl-font-size-base: 16px;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li>.wpsl-store-name {
    --wpsl-font-size-base: 18px;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li>.wpsl-store-location {
    --wpsl-font-size-base: 16px;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li>.wpsl-store-actions>* {
    --wpsl-font-size-base: 16px;
}

#wpsl-wrap.wpsl-store-below li>* {
    width: 100%;
}

#wpsl-wrap.wpsl-store-below li>.wpsl-store-name {
    font-size: 18px;
}

#wpsl-wrap.wpsl-store-below li>.wpsl-store-location {
    font-size: 16px;
}

#wpsl-wrap.wpsl-store-below li>.wpsl-store-location p {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-name {
        margin-bottom: 5px;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-location {
        margin-bottom: 20px;
    }
}

@media (min-width: 768px) {
    #wpsl-wrap.wpsl-store-below li {
        display: flex;
        gap: 10px;
        flex-direction: row;
        align-items: center;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-name {
        width: 30%;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-location {
        width: 40%;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-actions {
        width: 30%;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-actions>.w-btn>.w-btn-label>span {
        display: none;
    }
}

@media (min-width: 992px) {
    #wpsl-wrap.wpsl-store-below li {
        gap: 15px 30px;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-name {
        width: 25%;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-location {
        width: 35%;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-actions {
        width: 40%;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-actions>.w-btn>.w-btn-label>span {
        display: inline;
    }
}

@media (min-width: 1280px) {
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-name {
        width: 25%;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-location {
        width: 45%;
    }
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-actions {
        width: 30%;
    }
}


/**** wpsl-result-header */

@media (max-width: 991px) {
    #wpsl-wrap.wpsl-store-below #wpsl-result-header {
        display: none;
    }
}

#wpsl-wrap.wpsl-store-below #wpsl-result-header {
    margin-top: 30px;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-header ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-header li {
    padding: 15px 30px;
    margin-bottom: 0;
    background: var(--color-content-bg-alt);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.1em;
    font-weight: var(--bold-font-weight);
    text-transform: uppercase;
    color: var(--color-content-heading);
}


/**** wpsl-result-list */

#wpsl-wrap.wpsl-store-below #wpsl-result-list {
    float: none;
    margin-top: 0;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li *::before,
#wpsl-wrap.wpsl-store-below #wpsl-result-list li *::after {
    box-sizing: border-box;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li {
    padding: 20px 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-content-border);
    font-size: 16px;
}

@media (min-width: 768px) {
    #wpsl-wrap.wpsl-store-below #wpsl-result-list li {
        padding: 20px 30px;
    }
}

@media (min-width: 992px) {
    #wpsl-wrap.wpsl-store-below #wpsl-result-list li {
        --wpsl-font-size-base: 18px;
        font-size: 18px;
    }
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li:last-child {
    border-bottom: none;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li p:last-child {
    margin-bottom: 0;
}

#wpsl-wrap.wpsl-store-below #wpsl-result-list li .wpsl-country,
#wpsl-wrap.wpsl-store-below #wpsl-result-list li .wpsl-street {
    display: inline;
}

@media (min-width: 768px) {
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-actions {
        display: flex;
        justify-content: flex-end;
    }
}

#wpsl-wrap.wpsl-store-below li>.wpsl-store-actions button.w-btn:disabled {
    width: 100%;
    max-width: 268px;
}

@media (min-width: 768px) and (max-width: 991px) {
    #wpsl-wrap.wpsl-store-below li>.wpsl-store-actions button.w-btn:disabled {
        max-width: 148px;
    }
}


/*** Disable Start Location Marker */

#wpsl-map div[title="Start location"],
#wpsl-map div[title="Start location"]>img {
    display: none !important;
    user-select: none !important;
    pointer-events: none !important;
}
