/* /public/store-locator/assets/css/style.bs-sl-css */

/* ------------------------- */
/* VARIABLES ET STYLES GLOBAUX */
/* ------------------------- */
:root {
    --shadow-color: rgba(0, 0, 0, 0.15);

    /* Dimensions et structure (CRITIQUE) */
    --border-radius-main: 20px;
    --border-radius-small: 8px;
    --spacing-unit: 1rem;
}

/* ------------------------- */
/* STRUCTURE PRINCIPALE      */
/* ------------------------- */
#bs-sl-container {
    position: relative;
    width: 100%;
    height: 100svh;
    /* Fixe la hauteur pour éviter l'effondrement à 0px */
    border-radius: var(--border-radius-main);
    overflow: hidden;
    margin: 0 auto;
}

#bs-sl-map {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 1;
}

.bs-sl-hidden {
    display: none !important;
}

.bs-sl-clearable-input-container {
    position: relative;
    width: 100%;
}

.bs-sl-input-clear-btn {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #999;
    display: none;
    /* Masqu par dfaut */
}

.bs-sl-input-clear-btn.bs-sl-visible {
    display: block;
    /* Affich par JS */
}


/* ------------------------- */
/* PANNEAU D'INFORMATION     */
/* ------------------------- */
#bs-sl-info-panel {
    position: absolute;
    background-color: var(--bde-background-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease-in-out, height 0.3s ease-in-out;
    z-index: 100;
}

/* Configuration desktop (grand cran) */
@media (min-width: 1025px) {
    #bs-sl-info-panel {
        top: var(--spacing-unit);
        right: var(--spacing-unit);
        bottom: var(--spacing-unit);
        width: 400px;
        border-radius: var(--border-radius-main);
    }

    #bs-sl-info-panel.bs-sl-is-hidden {
        transform: translateX(110%);
    }

    /* Details view prend la hauteur du contenu sur grand cran */
    #bs-sl-details-view .bs-sl-details-content {
        max-height: calc(100% - 150px);
        overflow-y: auto;
    }
}

/* Configuration tablette paysage (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    #bs-sl-info-panel {
        bottom: 0;
        left: 0;
        right: 0;
        height: 40%;
        min-height: 200px;
        max-height: 80%;
        border-radius: var(--border-radius-main) var(--border-radius-main) 0 0;
    }

    #bs-sl-info-panel.bs-sl-is-hidden {
        transform: translateY(100%);
    }

    #bs-sl-info-panel.bs-sl-details-expanded {
        height: 70%;
    }
}

/* Configuration mobile (moins de 768px) */
@media (max-width: 767px) {
    #bs-sl-info-panel {
        bottom: 0;
        left: 0;
        right: 0;
        height: 50%;
        min-height: 200px;
        max-height: 90%;
        border-radius: var(--border-radius-main) var(--border-radius-main) 0 0;
    }

    #bs-sl-info-panel.bs-sl-is-hidden {
        transform: translateY(100%);
    }

    #bs-sl-info-panel.bs-sl-details-expanded {
        height: 100%;
    }
}

/* Guidon de redimensionnement */
#bs-sl-drag-handle {
    width: 100%;
    padding: 10px 0;
    cursor: grab;
    display: none;
    justify-content: center;
    align-items: center;
    touch-action: none;
    user-select: none;
}

#bs-sl-drag-handle.bs-sl-dragging {
    cursor: grabbing;
}

.bs-sl-drag-handle-bar {
    width: 50px;
    height: 5px;
    background-color: #ccc;
    border-radius: 3px;
}

@media (max-width: 1024px) {
    #bs-sl-drag-handle {
        display: flex;
    }
}

/* ------------------------- */
/* BOUTON TOGGLE            */
/* ------------------------- */
#bs-sl-toggle-panel-btn {
    position: absolute;
    width: 48px;
    height: 48px;
    background-color: var(--bde-background-color);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px var(--shadow-color);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

#bs-sl-toggle-panel-btn:hover {
    background-color: var(--bde-brand-primary-color-hover);
}

@media (min-width: 1025px) {
    #bs-sl-toggle-panel-btn {
        top: 20px;
        right: 420px;
    }

    #bs-sl-info-panel.bs-sl-is-hidden~#bs-sl-toggle-panel-btn {
        right: 20px;
    }
}

@media (max-width: 1024px) {
    #bs-sl-toggle-panel-btn {
        bottom: 20px;
        right: 20px;
    }
}

/* Animation pour faire clignoter un lment */
@keyframes blink-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 6px var(--shadow-color);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 15px var(--brand-color);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 2px 6px var(--shadow-color);
    }
}

/* Classe  appliquer pour dclencher l'animation */
.bs-sl-is-blinking {
    /* Nom de l'animation, dure, et nombre de rptitions */
    animation: blink-animation 0.4s 3;
}

/* ------------------------- */
/* HEADER DU PANNEAU        */
/* ------------------------- */
.bs-sl-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: var(--spacing-unit);
    border-bottom: 1px solid var(--color-background-dark);
    background-color: var(--bde-background-color);
}

.bs-sl-delivery-options {
    flex-basis: 100%;
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bs-sl-pill-checkbox {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background-color: #f5f5f5;
    border: 1px solid var(--color-background-dark);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.bs-sl-pill-checkbox input {
    display: none;
}

.bs-sl-pill-checkbox:has(input:checked) {
    background-color: var(--bde-brand-primary-color);
    color: white;
    border-color: var(--bde-brand-primary-color);
}

.bs-sl-search-filter-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.bs-sl-search-container {
    position: relative;
    flex: 1;
    min-width: 0;
}

.bs-sl-search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

#bs-sl-search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--color-background-dark);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
}

#bs-sl-filter-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--color-background-dark);
    border-radius: var(--border-radius-small);
    font-size: 1.2rem;
    cursor: pointer;
    width: 42px;
    height: 42px;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

#bs-sl-filter-btn:hover {
    background-color: var(--bde-brand-primary-color-hover);
}

/* ------------------------- */
/* VUE LISTE                 */
/* ------------------------- */
ul {
    margin: 0;
    margin-block-start: 0;
    margin-block-end: 0;
    padding-inline-start: 0;
}

#bs-sl-list-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#bs-sl-stores-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.bs-sl-store-item {
    display: flex;
    padding: 0 var(--spacing-unit) 0 var(--spacing-unit);
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-background-dark);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bs-sl-store-item:last-child {
    border-bottom: none;
}

.bs-sl-store-item:hover {
    background-color: var(--bde-brand-primary-color-hover);
}

.bs-sl-store-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.bs-sl-store-address {
    font-size: 0.875rem;
    color: var(--text-light);
}

.bs-sl-store-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bs-sl-action-btn {
    font-size: 1.2rem;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bs-sl-action-btn:hover {
    color: var(--bde-brand-primary-color-hover);
}

/* ------------------------- */
/* VUE DTAILS               */
/* ------------------------- */
#bs-sl-details-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#bs-sl-back-to-list-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    padding: 0;
}

.bs-sl-details-content {
    padding: 10px var(--spacing-unit) var(--spacing-unit);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.bs-sl-store-image {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius-small);
    margin-top: var(--spacing-unit);
    background-color: #f0f0f0;
}

#bs-sl-detail-name {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.bs-sl-store-complement {
    font-size: 1rem;
    color: var(--text-light);
}

.bs-sl-store-comment {
    font-size: 0.9rem;
    font-style: italic;
    margin: 8px 0;
}

#bs-sl-detail-address {
    margin-bottom: var(--spacing-unit);
}

.bs-sl-main-action-btn,
.bs-sl-service-btn,
.bs-sl-direction-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 10px;
}

.bs-sl-main-action-btn {
    background-color: var(--bde-brand-primary-color);
    color: white;
}

.bs-sl-main-action-btn:hover {
    color: var(--bde-background-color);
}

.bs-sl-service-btn {
    background-color: var(--color-background);
    border: 1px solid var(--color-background-dark);
    color: var(--text-color);
}

.bs-sl-service-btn:hover {
    color: var(--bde-headings-color);
}

.bs-sl-button-group {
    display: flex;
    gap: 10px;
}

.bs-sl-direction-btn {
    background-color: var(--color-background-dark);
    border: 1px solid var(--color-background-light);
    color: var(--text-color);
}

.bs-sl-direction-btn:hover {
    color: var(--bde-headings-color);
}

/* ------------------------- */
/* CONTRLES DE LA CARTE    */
/* ------------------------- */
#bs-sl-map-controls {
    position: absolute;
    z-index: 99;
    background-color: var(--bde-background-color);
    border-radius: var(--border-radius-main);
    box-shadow: 0 2px 6px var(--shadow-color);
}

#bs-sl-map-controls .bs-sl-input-clear-btn {
    right: 40px;
}

/* Configuration desktop */
@media (min-width: 1025px) {
    #bs-sl-map-controls {
        left: var(--spacing-unit);
        bottom: var(--spacing-unit);
        width: auto;
    }
}

/* Configuration tablette paysage */
@media (min-width: 768px) and (max-width: 1024px) {
    #bs-sl-info-panel.bs-sl-is-hidden~#bs-sl-map-controls {
        bottom: var(--spacing-unit);
    }
}

/* Configuration mobile */
@media (max-width: 767px) {
    #bs-sl-map-controls {
        top: var(--spacing-unit);
        left: var(--spacing-unit);
        right: var(--spacing-unit);
        width: auto;
    }
}

.bs-sl-search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

#bs-sl-map-search-input {
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: 1rem;
    width: 400px;
    padding-right: 70px;
}

#bs-sl-map-search-input:focus {
    outline: none;
}

#bs-sl-geolocation-btn {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    padding: 8px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-light);
    transition: color 0.2s ease;
}

#bs-sl-geolocation-btn:hover {
    color: var(--bde-brand-primary-color-hover);
}

/* Adaptation mobile pour la recherche carte */
@media (max-width: 767px) {
    #bs-sl-map-search-input {
        width: 100%;
    }
}

/* ------------------------- */
/* CONTR�LES LEAFLET CUSTOM */
/* ------------------------- */
.leaflet-control-custom {
    width: 30px;
    height: 30px;
    background-color: #fff;
    cursor: pointer;
    text-align: center;
    line-height: 30px;
    font-size: 1rem;
    color: #333;
    display: block;
    text-decoration: none;
}

.leaflet-control-custom:hover {
    background-color: var(--bde-brand-primary-color-hover);
}

/* Int�gration avec la barre de zoom */
.leaflet-control-zoom a.leaflet-control-custom {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 16px;
}

/* Style uniforme avec les boutons de zoom */
.leaflet-touch .leaflet-control-zoom a.leaflet-control-custom {
    width: 44px;
    height: 44px;
    line-height: 44px;
    font-size: 18px;
}

/* Retirer le style de base leaflet-top pour mobile */
@media (max-width: 767px) {
    /* Les contr�les restent en haut � gauche, pas de modification */
}

/* ------------------------- */
/* VUE FILTRES               */
/* ------------------------- */

#bs-sl-filter-options {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    /* Juste en dessous du champ de recherche */
    left: 16px;
    right: 16px;
    background-color: var(--bde-background-color);
    border: 1px solid var(--color-background-dark);
    border-radius: var(--border-radius-small);
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 10;
    padding: 10px;
}

#bs-sl-filter-options.bs-sl-is-visible {
    display: block;
    max-height: 300px;
    /* Hauteur suffisante pour afficher les filtres */
    padding-top: var(--spacing-unit);
    padding-bottom: var(--spacing-unit);
}

.bs-sl-filter-group {
    margin-bottom: 15px;
}

.bs-sl-filter-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.bs-sl-filter-group select,
.bs-sl-filter-group .bs-sl-checkbox-group {
    width: 100%;
}

.bs-sl-checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.bs-sl-checkbox-item input {
    margin-right: 8px;
}

#bs-sl-filter-btn.bs-sl-has-filters {
    background-color: var(--brand-color);
    color: white;
    border-color: var(--brand-color);
}

#bs-sl-reset-filters-btn {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background-color: #e0e0e0;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
}

/* Style g�n�ral pour le select et les checkboxes */
#bs-sl-filter-options label {
    font-size: 0.9rem;
    color: var(--text-light);
}

#bs-sl-filter-options .bs-sl-filter-group {
    margin-bottom: 12px;
}

#bs-sl-filter-options .bs-sl-filter-group>label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

/* Style pour le menu d�roulant (select) */
#bs-sl-country-filter {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-background-dark);
    border-radius: var(--border-radius-small);
    background-color: var(--bde-background-color);
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 10px auto;
    cursor: pointer;
}

/* Style pour les checkboxes personnalis�es */
.bs-sl-checkbox-item {
    display: block;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    user-select: none;
}

.bs-sl-checkbox-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.bs-sl-checkbox-item .bs-sl-checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.bs-sl-checkbox-item:hover input~.bs-sl-checkmark {
    background-color: var(--bde-brand-primary-color-hover);
}

.bs-sl-checkbox-item input:checked~.bs-sl-checkmark {
    background-color: var(--bde-brand-primary-color);
    border-color: var(--brand-color);
}

.bs-sl-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.bs-sl-checkbox-item input:checked~.bs-sl-checkmark:after {
    display: block;
}

.bs-sl-checkbox-item .bs-sl-checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#bs-sl-toggle-panel-btn::after {
    content: '';
    /* Obligatoire pour un pseudo-�l�ment */
    position: absolute;
    top: 0px;
    /* Position en haut... */
    right: 0px;
    /* ...� droite du bouton */
    width: 12px;
    height: 12px;
    background-color: orange;
    border-radius: 50%;
    /* Pour en faire un cercle parfait */
    border: 2px solid white;
    /* Petite bordure pour le faire ressortir */

    /* Animation d'apparition */
    transform: scale(0);
    transition: transform 0.2s ease-in-out;
}

/* Quand le bouton a la classe .bs-sl-has-filters, on fait appara�tre la pastille */
#bs-sl-toggle-panel-btn.bs-sl-has-filters::after {
    transform: scale(1);
}

/* ------------------------- */
/* INTERFACE EMBARQU�        */
/* ------------------------- */

#bs-sl-embed-interface {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    /* Au-dessus de la carte */

    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: var(--spacing-unit);
    box-shadow: 0 -4px 12px var(--shadow-color);

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#bs-sl-embed-interface.bs-sl-hidden {
    display: none;
}

/* On r�utilise les styles des boutons de la vue d�tail */
#bs-sl-embed-interface .bs-sl-main-action-btn,
#bs-sl-embed-interface .bs-sl-service-btn,
#bs-sl-embed-interface .bs-sl-direction-btn {
    display: inline-block;
    /* Pour qu'ils soient c�te � c�te */
    width: auto;
    flex-grow: 1;
    /* Pour qu'ils prennent la m�me place */
    margin-bottom: 0;
}

/* ------------------------- */
/* CARTE SIMPLE (LÉGENDE)    */
/* ------------------------- */
.bs-sl-simple-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: var(--bde-background-color, #fff);
    padding: 15px;
    border-radius: var(--border-radius-main, 16px);
    box-shadow: 0 4px 12px var(--shadow-color, rgba(0, 0, 0, 0.15));
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--color-background-dark, #e0e0e0);
}

.bs-sl-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bs-sl-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.bs-sl-legend-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color, #333);
}

.bs-sl-custom-svg-icon {
    background: transparent;
    border: none;
}
/* ------------------------- */
/* PLEIN ÉCRAN               */
/* ------------------------- */
/* Plein écran natif (API Fullscreen) */
/* !important : le site hôte peut imposer une taille au conteneur */
#bs-sl-container:fullscreen {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
}

#bs-sl-container:-webkit-full-screen {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
}

/* Plein écran de secours (iOS Safari, iframe sans autorisation, webviews) */
#bs-sl-container.bs-sl-is-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    z-index: 2147483000 !important;
}

/* Bloque le défilement de la page hôte pendant le plein écran de secours */
html.bs-sl-fullscreen-lock,
html.bs-sl-fullscreen-lock body {
    overflow: hidden !important;
}
