.info-wrap * {
    box-sizing: border-box;
}

#map-main {
    display: flex;
}
.map-wrap {
    position: relative;
    width: 100%;
}
#map {
    height: 550px;
    width: 100%;
    border-radius: 9px;
}
.map-deco {
    position: absolute;
    top: -168px;
    right: 27px;
    z-index: 10000;
    width: 275px;
    height: 275px;
    background-image: url(https://yopi.ca/wp-content/uploads/2025/01/y-cercle-mauve-sat.svg);
    background-repeat: no-repeat;
    background-size: contain;
}
.info-wrap {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.inner-nearest-location {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #4b2e87;
    background: #ffffff;
    padding: 15px;
    border-radius: 9px;
    height: 100%;
}
.inner-nearest-location a {
	text-decoration:underline;
}

input#address {
    width: 500px;
    max-width: 100%;
    padding: 14px 26px;
    border-radius: 50px;
    border: none;
    color: #ffffff;
    background: #58379a;
}

#search-container button {
    padding: 8px 40px;
    border-radius: 50px;
    background-color: #8500e6;
    border: none;
    color: white;
    font-size: 18px;
    font-weight: normal;
    width: 179px;
    height: 37px;
    cursor: pointer;
}

button#search-btn:hover {
    background: #BE6BFF;
}

#search-container {
    margin: 0;
    position: relative;
    display: flex;
    gap: 15px;
}

#suggestions { position: absolute; background: white; border: 1px solid #ccc; max-height: 150px; overflow-y: auto; width: 100%; z-index: 1000; }
.suggestion-item { padding: 5px; cursor: pointer; }
.suggestion-item:hover { background: #eee; }

#city {
    width: 100%;
    padding: 10px;
    border-radius: 9px;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0;
}

.separator::before,
.separator::after {
    content: "";
    flex: 1;
    border-bottom: 2px solid #FFFFFF;
    margin: 0 10px;
}

.separator span {
    color: #FFFFFF;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
}


/*Side menu*/

#scroll-menu {
	width: 350px;
    margin: 0 10px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Bloc d'une région */
.region-block + .region-block {
    border-top: 4px solid #421b77;
}

/* En-tête de région */
.region-header {
    width: 100%;
    border: none;
    background: #8516e6;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}

.region-block {
    background: #471e82;
}

.region-title {
    color: #ffffff;
}

.region-count {
    font-size: 0.8rem;
    padding: 2px 8px;
    color: #ffffff;
}

.region-toggle {
    margin-left: auto;
    color: #ffffff;
}

/* Liste des établissements d'une région */
.region-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.25s ease;
}

.entry-content ul.region-list {
    list-style-type: unset;
    padding: 0;
    line-height: unset;
}

/* Quand la région est ouverte */
.region-block.open .region-list {
    max-height: 380px; /* hauteur scrollable interne, ajuste au besoin */
}

/* Item établissement */
.location-item {
    position: relative;
    padding: 20px 18px;
    margin: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #411e79;
}

.location-distance {
    color: #ffffff;
    font-weight: bold;
    position: absolute;
    top: 3px;
    right: 3px;
}

.location-item:hover {
    background: #311f5b;
}

.location-item.active {
    background: #311f5b;
    font-weight: 600;
}

/* Nom d'établissement */
.location-name {
    color: #fced00;
    font-size: 16px;
    font-weight: bold;
}

.location-adress {
    color: #ffffff;
    font-size: 14px;
}

/* Popup carte (optionnel, pour harmoniser le style) */
.leaflet-popup-content-wrapper .popup-yopi strong {
    font-size: 0.95rem;
}
.leaflet-popup-content-wrapper .popup-yopi {
    font-size: 0.85rem;
    line-height: 1.4;
}

.leaflet-container a {
    color: #8500e6;
}

.leaflet-popup-tip-container {
    display: none;
}

/* Conteneur */
.region-list {
    scrollbar-width: thin;          /* Firefox */
    scrollbar-color: #a66cff #421b77; /* Firefox (thumb, track) */
}

/* Chrome / Edge / Safari */
.region-list::-webkit-scrollbar {
    width: 6px;     /* largeur de la scrollbar */
    height: 6px;    /* si jamais horizontal */
}

.region-list::-webkit-scrollbar-track {
    background: #421b77;   /* couleur du track */
    border-radius: 4px;
}

.region-list::-webkit-scrollbar-thumb {
    background: #a66cff;  /* couleur du thumb */
    border-radius: 4px;
}

.region-list::-webkit-scrollbar-thumb:hover {
    background: #8a3ef0; /* couleur au hover */
}


#address:focus, 
#city:focus,
input:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: inherit !important;
}

.dist-info {
    color: #ffffff;
    margin: 5px;
}


#search-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#search-btn.loading .btn-text {
    display:none;
}

#search-btn.loading .btn-spinner {
    display: inline-block;
}


#address::placeholder {
    color: #ffffff;
    opacity: 1; /* important sinon certains navigateurs grisent */
}

/* Pour Safari / anciens Chrome */
#address::-webkit-input-placeholder {
    color: #ffffff;
}

/* Pour Firefox */
#address::-moz-placeholder {
    color: #ffffff;
}

/* Pour IE / Edge legacy */
#address:-ms-input-placeholder {
    color: #ffffff;
}

/* Pour les versions anciennes */
#address::-ms-input-placeholder {
    color: #ffffff;
}

#nearest-location, #mobile-location-select {
	display:none;
}

@media screen and (max-width: 1080px) {
	.map-deco {
		display:none
	}	
}

@media screen and (max-width: 768px) {
    #map {
        height: 330px; 
    }
	.info-wrap {
		flex-direction: column;
	
	}	
	input#address {
		width: 100%;
	}
	#scroll-menu {
		display: none;
	}
	#nearest-location {
		display:block;
	}
    #search-container button {
        position: absolute;
        right: 0px;
        color: transparent;
        height: 43px;
        text-indent: -9999px;
        overflow: hidden;
        width: 46px;
        padding: 0;
        border-radius: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #search-container button::before {
        content: "";
        background-image: url(https://yopi.ca/wp-content/uploads/2025/11/magnifying-glass-solid-full.svg);
        background-size: 23px 23px;
        background-repeat: no-repeat;
        background-position: 12px;
        width: 46px;
        height: 43px;
        filter: invert(1);
    }
	
    /* mode “loading” = spinner */
    #search-container button.loading::before {
        content: "";
        width: 16px;
        height: 16px;
        border: 4px solid #ffffff;
        border-top-color: transparent;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        filter: invert(0);
        background: none;
    }

    @keyframes spin {
        from { transform: rotate(0deg); }
        to   { transform: rotate(360deg); }
    }
	span.btn-spinner {
		display: none !important;
	}		
	
	#search-container {
		flex-direction: column;
		align-items: center;
	}
	#mobile-location-select {
		display:block;
		width: 100%;
		padding: 13px 26px;
		border-radius: 50px;
		border: none;
		color: white;
		font-weight: 500;
		background: url(/wp-content/uploads/2021/01/select_arrow.png) no-repeat right #8300e9;
		-webkit-appearance: none;
		background-position-x: 94%;
	}	
		
}