/* ==========================================================================
   Smart Cover — Habillage du Logia Store Locator (.lsl.sc-locator)
   Chargé après assets/css/lsl.css du plugin.
   ========================================================================== */

.sc-locator {
    --sc-orange: var(--e-global-color-primary, #EC6608);
    --sc-dark: var(--e-global-color-accent, #151414);
    --sc-dark-2: var(--e-global-color-secondary, #242423);
    --sc-white: var(--e-global-color-8c2951a, #FFFFFF);
    --sc-text: var(--e-global-color-text, #1E1E1E);
    --sc-font: var(--e-global-typography-text-font-family, 'Barlow'), sans-serif;
    --sc-font-condensed: var(--e-global-typography-56de74f-font-family, 'Barlow Condensed'), sans-serif;
    --sc-radius-card: 12px;
    --sc-radius-map: 16px;
    --sc-input-h: 48px;

    /* Variables du plugin (couleur des marqueurs lue en JS sur :root, voir plus bas) */
    --lsl-color-primary: var(--sc-orange);
    --lsl-color-secondary: var(--sc-dark);
    --lsl-font-primary: var(--sc-font);
    --lsl-border: 1px solid var(--sc-orange);
    --lsl-border-radius-large: 9999px;
    --lsl-input-height: var(--sc-input-h);

    font-family: var(--sc-font);
    color: var(--sc-text);
}

/* Le JS du plugin lit --lsl-color-primary sur <html> pour colorer les marqueurs. */
:root {
    --lsl-color-primary: #EC6608;
    --lsl-color-secondary: #151414;
}

/* --------------------------------------------------------------------------
   Barre de recherche
   -------------------------------------------------------------------------- */

.sc-locator header.lsl__toolbar {
    padding: 0;
    margin-bottom: 24px;
}

.sc-locator form.lsl__searchform {
    flex-wrap: wrap;
    gap: 20px;
}

/* Géocodeur Mapbox */
.sc-locator .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {
    min-width: 0 !important;
    width: 100%;
    max-width: 236px;
    font-family: var(--sc-font) !important;
    font-size: 15px !important;
    line-height: var(--sc-input-h) !important;
}

.sc-locator input.mapboxgl-ctrl-geocoder--input {
    height: var(--sc-input-h) !important;
    padding: 0 16px 0 44px !important;
    background: var(--sc-white);
    border: 1px solid var(--sc-orange) !important;
    border-radius: 9999px !important;
    color: var(--sc-text);
    font-family: var(--sc-font) !important;
    font-size: 15px !important;
    font-weight: 400;
    box-shadow: none !important;
}

.sc-locator input.mapboxgl-ctrl-geocoder--input::placeholder {
    color: #6d6d6d;
}

.sc-locator input.mapboxgl-ctrl-geocoder--input:focus {
    outline: none !important;
    border-color: var(--sc-dark) !important;
}

.sc-locator svg.mapboxgl-ctrl-geocoder--icon-search {
    left: 16px !important;
    width: 18px;
    height: 18px;
    fill: var(--sc-orange) !important;
}

.sc-locator .mapboxgl-ctrl-geocoder--icon-loading,
.sc-locator .mapboxgl-ctrl-geocoder--button {
    background: transparent !important;
}

.sc-locator .mapboxgl-ctrl-geocoder .suggestions {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    font-family: var(--sc-font);
    line-height: 1.35;
}

.sc-locator .mapboxgl-ctrl-geocoder .suggestions > li > a {
    padding: 10px 16px;
}

.sc-locator .mapboxgl-ctrl-geocoder--suggestion-address {
    margin-top: 2px;
}

.sc-locator .mapboxgl-ctrl-geocoder .suggestions > .active > a,
.sc-locator .mapboxgl-ctrl-geocoder .suggestions > li > a:hover {
    background: var(--sc-orange);
    color: var(--sc-white);
}

/* Rayon de recherche */
.sc-locator .lsl__radius-toggle {
    min-width: 222px !important;
    min-height: var(--sc-input-h) !important;
    padding: 0 18px 0 16px !important;
    background: var(--sc-white) !important;
    border: 1px solid var(--sc-orange) !important;
    border-radius: 9999px !important;
    color: var(--sc-text) !important;
    font-family: var(--sc-font) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.sc-locator .lsl__radius-toggle[data-placeholder='true'] .lsl__radius-label {
    color: #6d6d6d;
    font-weight: 400;
}

.sc-locator .lsl__radius-toggle svg {
    color: var(--sc-orange);
}

.sc-locator .lsl__radius-dropdown-menu {
    top: calc(100% + 8px);
    border: 1px solid var(--sc-orange);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.sc-locator .lsl__radius-option {
    padding: 12px 18px !important;
    font-family: var(--sc-font) !important;
    font-size: 15px !important;
    color: var(--sc-text) !important;
}

.sc-locator .lsl__radius-option:hover {
    background: var(--sc-orange) !important;
    color: var(--sc-white) !important;
}

.sc-locator .lsl__radius-option:first-child { border-radius: 11px 11px 0 0; }
.sc-locator .lsl__radius-option:last-child  { border-radius: 0 0 11px 11px; }

/* Bouton Rechercher */
.sc-locator form.lsl__searchform button[type='submit'] {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: var(--sc-input-h);
    padding: 0 24px;
    background: var(--sc-orange);
    border: 1px solid var(--sc-orange);
    border-radius: 9999px;
    color: var(--sc-white);
    font-family: var(--sc-font-condensed);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: background .25s ease, border-color .25s ease;
}

.sc-locator form.lsl__searchform button[type='submit']::after {
    content: '';
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sc-locator form.lsl__searchform button[type='submit']:hover,
.sc-locator form.lsl__searchform button[type='submit']:focus-visible {
    background: var(--sc-dark);
    border-color: var(--sc-dark);
    color: var(--sc-white);
}

/* Messages */
.sc-locator .lsl__notice.is-success,
.sc-locator .lsl__notice.is-error {
    border-radius: 12px;
    font-family: var(--sc-font);
}

/* --------------------------------------------------------------------------
   Liste + carte
   -------------------------------------------------------------------------- */

.sc-locator .lsl__view.lsl__view--combo {
    margin-top: 0;
}

.sc-locator .lsl__split {
    gap: 24px;
    align-items: stretch;
}

.sc-locator .lsl__panel.lsl__panel--list {
    width: 32%;
    min-width: 280px;
}

.sc-locator .lsl__panel.lsl__panel--map {
    width: 68%;
    padding-top: 0;
    min-height: 480px;
    max-height: none;
}

.sc-locator .lsl__panel--map .lsl__map {
    height: 100%;
    min-height: 480px;
    border-radius: var(--sc-radius-map) !important;
    overflow: hidden;
}

.sc-locator .lsl__panel.lsl__panel--list .lsl__grid {
    max-height: 480px;
    gap: 14px;
    padding: 0 12px 4px 0;
    scrollbar-color: var(--sc-orange) transparent;
}

.sc-locator .lsl__panel.lsl__panel--list .lsl__grid::-webkit-scrollbar { width: 6px; }
.sc-locator .lsl__panel.lsl__panel--list .lsl__grid::-webkit-scrollbar-track { background: transparent; }
.sc-locator .lsl__panel.lsl__panel--list .lsl__grid::-webkit-scrollbar-thumb {
    background: var(--sc-orange);
    border-radius: 9999px;
}

/* --------------------------------------------------------------------------
   Carte agence (accordéon)
   -------------------------------------------------------------------------- */

.sc-locator .lsl__panel.lsl__panel--list .lsl__grid article.sc-agence-card {
    position: relative;
    /* Le plugin pose flex: 0 1 calc(…) !important (pensé pour une grille en ligne) :
       dans la liste en colonne ce flex-basis devient une hauteur et écrase les cartes. */
    flex: 0 0 auto !important;
    width: 100%;
    height: auto;
    padding: 0;
    background: var(--sc-dark);
    color: var(--sc-white);
    border-radius: var(--sc-radius-card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    overflow: hidden;
    transition: background .25s ease, box-shadow .25s ease;
}

/* Survol et état déplié : la carte reste sombre (le plugin force l'orange sur .is-active) */
.sc-locator .lsl__panel.lsl__panel--list .lsl__grid article.sc-agence-card:hover,
.sc-locator .lsl__panel.lsl__panel--list .lsl__grid article.sc-agence-card.is-active,
.sc-locator .lsl__panel.lsl__panel--list .lsl__grid article.sc-agence-card.is-active:hover {
    background: var(--sc-dark) !important;
    color: var(--sc-white) !important;
}

.sc-locator .sc-agence-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
}

.sc-locator .lsl__panel.lsl__panel--list .lsl__grid article.sc-agence-card h3.sc-agence-card__title {
    margin: 0;
    padding: 0;
    max-width: none;
    font-family: var(--sc-font);
    font-size: 20px;
    font-weight: 700;
    font-style: italic;
    line-height: 1.15;
    letter-spacing: .01em;
    text-transform: uppercase;
    color: var(--sc-white);
}

.sc-locator .sc-agence-card__title .text-orange {
    color: var(--sc-orange);
}

.sc-locator .sc-agence-card__chevron {
    flex: 0 0 auto;
    width: 14px;
    height: 10px;
    color: var(--sc-white);
    transition: transform .3s ease;
}

.sc-locator .sc-agence-card__chevron svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sc-locator article.sc-agence-card.is-active .sc-agence-card__chevron {
    transform: rotate(180deg);
}

/* Corps replié par défaut, déplié sur .is-active (posé par le JS du plugin).
   L'astuce 0fr → 1fr n'anime que la première ligne : le corps doit avoir UN seul enfant direct. */
.sc-locator .sc-agence-card__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .35s ease;
}

.sc-locator .sc-agence-card__body-inner {
    min-height: 0;
    overflow: hidden;
}

.sc-locator article.sc-agence-card.is-active .sc-agence-card__body {
    grid-template-rows: 1fr;
}

.sc-locator .sc-agence-card__infos {
    list-style: none;
    margin: 0;
    padding: 0 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-locator .sc-agence-card__infos li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .06em;
    line-height: 1.35;
    text-transform: uppercase;
}

.sc-locator .sc-agence-card__infos svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    color: var(--sc-orange);
}

.sc-locator .sc-agence-card__infos a {
    color: inherit;
    text-decoration: none;
}

.sc-locator .sc-agence-card__infos a:hover {
    color: var(--sc-orange);
}

.sc-locator .sc-agence-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin: 20px 22px 22px;
}

/* « Voir sur la carte » : uniquement dans le bottom sheet mobile
   (sélecteur renforcé pour passer devant les styles de bouton du kit Elementor) */
.sc-locator .sc-agence-card button.sc-agence-card__map {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 16px;
    min-height: 40px;
    background: transparent;
    border: 2px solid var(--sc-orange);
    border-radius: 9999px;
    color: var(--sc-white);
    font-family: var(--sc-font-condensed);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .25s ease, color .25s ease;
}

.sc-locator .sc-agence-card button.sc-agence-card__map svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.sc-locator .sc-agence-card button.sc-agence-card__map:hover,
.sc-locator .sc-agence-card button.sc-agence-card__map:focus-visible {
    background: var(--sc-orange);
    color: var(--sc-white);
    outline: none;
}

.sc-locator .sc-sheet .sc-agence-card button.sc-agence-card__map {
    display: inline-flex;
}

.sc-locator .sc-agence-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0 20px;
    min-height: 40px;
    background: var(--sc-orange);
    border-radius: 9999px;
    color: var(--sc-white) !important;
    font-family: var(--sc-font-condensed);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    width: fit-content;
    transition: background .25s ease, color .25s ease;
}

.sc-locator .sc-agence-card__cta svg {
    width: 20px;
    height: 12px;
    transition: transform .25s ease;
}

.sc-locator .sc-agence-card__cta:hover {
    background: var(--sc-white);
    color: var(--sc-dark) !important;
}

.sc-locator .sc-agence-card__cta:hover svg {
    transform: translateX(4px);
}

/* Badge distance ajouté par le JS après une recherche */
.sc-locator span.lsl__badge.lsl__badge--distance {
    top: auto;
    bottom: 14px;
    right: 22px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--sc-orange);
    text-transform: uppercase;
}

.sc-locator article.sc-agence-card:not(.is-active) span.lsl__badge.lsl__badge--distance {
    display: none;
}

/* --------------------------------------------------------------------------
   Popup carte
   -------------------------------------------------------------------------- */

.sc-locator .mapboxgl-popup-content {
    width: auto;
    max-width: 520px;
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    overflow: visible;
}

.sc-locator .mapboxgl-popup-tip {
    border-top-color: var(--sc-white);
}

.sc-locator .sc-popup {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 16px;
    background: var(--sc-white);
    border-radius: 20px;
    overflow: hidden;
    font-family: var(--sc-font);
}

.sc-locator .sc-popup__image {
    flex: 0 0 170px;
    width: 170px;
    height: 140px;
    min-height: 0;
    max-width: none;
    max-height: none;
    object-fit: cover;
    display: block;
    margin: 0;
    border-radius: 14px;
}

.sc-locator .sc-popup__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 6px 48px 6px 0;
    min-width: 0;
}

.sc-locator .sc-popup__title {
    margin: 0;
    font-family: var(--sc-font);
    font-size: 22px;
    font-weight: 700;
    font-style: italic;
    line-height: 1.15;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--sc-dark);
}

.sc-locator .sc-popup__title .text-orange {
    color: var(--sc-orange);
}

.sc-locator .sc-popup__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin: 0 !important; /* le plugin pose margin-top: 25px sur .lsl-popup-link */
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sc-orange);
    color: var(--sc-dark) !important;
    font-family: var(--sc-font-condensed);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: color .25s ease, border-color .25s ease;
}

.sc-locator .sc-popup__link svg {
    width: 22px;
    height: 13px;
    transition: transform .25s ease;
}

/* Le plugin met border:none sur :focus ; Mapbox focus le lien à l'ouverture du popup */
.sc-locator a.sc-popup__link:focus,
.sc-locator a.sc-popup__link:focus-visible {
    border: 0 !important;
    border-bottom: 2px solid var(--sc-orange) !important;
    outline: none !important;
    box-shadow: none !important;
}

.sc-locator .sc-popup__link:hover,
.sc-locator a.sc-popup__link:hover:focus {
    color: var(--sc-orange) !important;
    border-bottom-color: var(--sc-dark) !important;
}

.sc-locator .sc-popup__link:hover svg {
    transform: translateX(4px);
}

.sc-locator button.mapboxgl-popup-close-button {
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border-radius: 50%;
    color: var(--sc-orange);
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
    font-family: var(--sc-font);
}

.sc-locator button.mapboxgl-popup-close-button:hover {
    background: rgba(236, 102, 8, .1);
    color: var(--sc-orange);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Bouton flottant + bottom sheet : uniquement en responsive (le JS retire [hidden]) */
.sc-locator .sc-sheet-trigger,
.sc-locator .sc-sheet {
    display: none;
}

/* --------------------------------------------------------------------------
   Responsive ≤ 1024px : la carte occupe toute la largeur ; recherche, rayon et
   liste des agences sont déplacés par le JS dans un bottom sheet ouvert par un
   bouton flottant en bas à gauche.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .sc-locator .lsl__split {
        display: block;
    }

    .sc-locator .lsl__panel.lsl__panel--map {
        width: 100%;
        min-width: 0;
        height: min(72vh, 680px);
        height: min(72svh, 680px);
        min-height: 420px;
        max-height: none;
        padding: 0;
    }

    .sc-locator .lsl__panel--map .lsl__map {
        height: 100%;
        min-height: 0;
    }

    /* Tant que le JS n'a pas déplacé la liste, elle reste sous la carte */
    .sc-locator .lsl__split > .lsl__panel.lsl__panel--list {
        width: 100%;
        min-width: 0;
        margin-top: 16px;
    }

    /* ---- Bouton flottant ---- */
    .sc-locator .sc-sheet-trigger {
        position: fixed;
        left: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 900;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        min-height: 48px;
        padding: 0 20px 0 16px;
        background: var(--sc-orange);
        border: 0;
        border-radius: 9999px;
        color: var(--sc-white);
        font-family: var(--sc-font-condensed);
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
        cursor: pointer;
        opacity: 0;
        transform: translateY(16px);
        pointer-events: none;
        transition: opacity .25s ease, transform .25s ease, background .25s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .sc-locator .sc-sheet-trigger[hidden] {
        display: none;
    }

    .sc-locator .sc-sheet-trigger.is-visible {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .sc-locator .sc-sheet-trigger:hover,
    .sc-locator .sc-sheet-trigger:focus-visible {
        background: var(--sc-dark);
        color: var(--sc-white);
    }

    .sc-locator .sc-sheet-trigger svg {
        width: 20px;
        height: 20px;
        flex: 0 0 auto;
    }

    /* ---- Bottom sheet ---- */
    .sc-locator .sc-sheet {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: block;
        pointer-events: none;
        font-family: var(--sc-font);
        color: var(--sc-text);
    }

    .sc-locator .sc-sheet[hidden] {
        display: none;
    }

    .sc-locator .sc-sheet.is-open {
        pointer-events: auto;
    }

    .sc-locator .sc-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(21, 20, 20, .55);
        opacity: 0;
        transition: opacity .3s ease;
    }

    .sc-locator .sc-sheet.is-open .sc-sheet__backdrop {
        opacity: 1;
    }

    .sc-locator .sc-sheet__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        max-height: 88vh;
        max-height: 88svh;
        padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        background: var(--sc-white);
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, .25);
        transform: translateY(100%);
        transition: transform .35s cubic-bezier(.32, .72, 0, 1);
        will-change: transform;
    }

    .sc-locator .sc-sheet.is-open .sc-sheet__panel {
        transform: translateY(0);
    }

    .sc-locator .sc-sheet.is-dragging .sc-sheet__panel {
        transition: none;
    }

    .sc-locator .sc-sheet__handle {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 100%;
        height: 30px;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        cursor: grab;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }

    .sc-locator .sc-sheet__handle::before {
        content: '';
        width: 48px;
        height: 5px;
        border-radius: 9999px;
        background: var(--sc-orange);
    }

    .sc-locator .sc-sheet.is-dragging .sc-sheet__handle {
        cursor: grabbing;
    }

    .sc-locator .sc-sheet__handle:focus-visible::before {
        outline: 2px solid var(--sc-dark);
        outline-offset: 4px;
    }

    .sc-locator .sc-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex: 0 0 auto;
        padding: 2px 0 14px;
    }

    .sc-locator .sc-sheet__title {
        margin: 0;
        font-family: var(--sc-font);
        font-size: 22px;
        font-weight: 700;
        font-style: italic;
        line-height: 1.15;
        text-transform: uppercase;
        color: var(--sc-dark);
    }

    .sc-locator .sc-sheet__title .text-orange {
        color: var(--sc-orange);
    }

    .sc-locator .sc-sheet__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        margin: 0;
        padding: 0;
        background: rgba(21, 20, 20, .06);
        border: 0;
        border-radius: 50%;
        color: var(--sc-dark);
        cursor: pointer;
    }

    .sc-locator .sc-sheet__close svg {
        width: 14px;
        height: 14px;
    }

    .sc-locator .sc-sheet__close:hover,
    .sc-locator .sc-sheet__close:focus-visible {
        background: var(--sc-orange);
        color: var(--sc-white);
    }

    /* Recherche + rayon dans le sheet */
    .sc-locator .sc-sheet__toolbar {
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
    }

    .sc-locator .sc-sheet__toolbar header.lsl__toolbar {
        margin-bottom: 0;
    }

    .sc-locator .sc-sheet__toolbar form.lsl__searchform {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .sc-locator .sc-sheet__toolbar .mapboxgl-ctrl-geocoder.mapboxgl-ctrl,
    .sc-locator .sc-sheet__toolbar .lsl__radius-dropdown,
    .sc-locator .sc-sheet__toolbar .lsl__radius-toggle {
        width: 100% !important;
        max-width: none;
        min-width: 0 !important;
    }

    .sc-locator .sc-sheet__toolbar form.lsl__searchform button[type='submit'] {
        justify-content: center;
    }

    .sc-locator .sc-sheet__toolbar .lsl__notice:not(:empty) {
        margin: 10px 0 0;
    }

    /* Liste des agences dans le sheet : c'est .lsl__grid qui défile (le plugin y scrolle) */
    .sc-locator .sc-sheet__list {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        margin-top: 14px;
    }

    .sc-locator .sc-sheet__list .lsl__panel.lsl__panel--list {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        min-height: 0;
    }

    .sc-locator .sc-sheet__list .lsl__panel.lsl__panel--list .lsl__grid {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: 0 0 4px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sc-locator .sc-sheet__list .lsl__grid article.sc-agence-card {
        box-shadow: none;
    }

    /* Page figée derrière le sheet */
    html.sc-sheet-open,
    html.sc-sheet-open body {
        overflow: hidden;
    }
}

@media (max-width: 767px) {
    .sc-locator form.lsl__searchform {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .sc-locator .mapboxgl-ctrl-geocoder.mapboxgl-ctrl,
    .sc-locator .lsl__radius-dropdown,
    .sc-locator .lsl__radius-toggle {
        width: 100% !important;
        max-width: none;
        min-width: 0 !important;
    }

    .sc-locator form.lsl__searchform button[type='submit'] {
        justify-content: center;
    }

    /* ---- Popup carte : image pleine largeur au-dessus, texte en dessous ----
       Mapbox pose max-width: fit-content en inline sur .mapboxgl-popup : on fixe donc
       une largeur explicite sur le contenu, sinon le popup se replie sur le texte
       et l'image ne peut pas prendre toute la largeur. */
    .sc-locator .mapboxgl-popup {
        max-width: calc(100vw - 32px) !important;
    }

    .sc-locator .mapboxgl-popup-content {
        width: min(320px, calc(100vw - 32px));
        max-width: none;
        border-radius: 16px;
    }

    .sc-locator .sc-popup {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 10px;
        border-radius: 16px;
    }

    /* Le plugin force img.lsl-popup-image { width: 90px !important } en mobile */
    .sc-locator img.sc-popup__image {
        flex: 0 0 auto;
        width: 100% !important;
        max-width: none !important;
        height: 150px;
        border-radius: 12px;
    }

    .sc-locator .sc-popup__content {
        gap: 10px;
        padding: 0 4px 6px;
    }

    .sc-locator .sc-popup__title {
        font-size: 18px;
        line-height: 1.15;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .sc-locator .sc-popup__link {
        gap: 8px;
        padding-bottom: 5px;
        font-size: 14px;
        letter-spacing: .08em;
    }

    .sc-locator .sc-popup__link svg {
        width: 18px;
        height: 11px;
    }

    /* Bouton fermer posé sur l'image : pastille blanche pour rester lisible */
    .sc-locator button.mapboxgl-popup-close-button {
        top: 16px;
        right: 16px;
        width: 28px;
        height: 28px;
        background: var(--sc-white);
        box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
        font-size: 24px;
    }

    .sc-locator button.mapboxgl-popup-close-button:hover {
        background: var(--sc-white);
    }
}
