/**
 * WP Store Locator CSS
 * Plugin WordPress pour localisateur de magasins
 */

/* Container principal */
.store-locator-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    position: relative;
    isolation: isolate;
}

.store-locator {
    display: flex;
    gap: 5px;
    height: 700px;
    min-height: 700px;
    position: relative;
    isolation: isolate;
}

/* Filtres */
.store-locator__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    /* padding: 20px; */
    /* background: white; */
    /* border-bottom: 1px solid #e9ecef; */
    flex-shrink: 0;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.05); */
    padding-right: 35px;
    margin-bottom: 35px;
}

.location-filter,
.storename-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 280px;
    position: relative;
    background: #FFF;
    border: 1px solid #000;
    border-radius: 12px;
    padding: 5px;
}

.location__input,
.location_input_name {
    flex: 1;
    /* padding: 12px 15px; */
    /* border: 1px solid #ddd; */
    /* border-radius: 4px; */
    font-size: 14px;
    outline: none;
    margin-top: 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: none;
    border: none;
}

.location__input:focus,
.location_input_name:focus {
    border-color: #d63384;
    box-shadow: 0 0 0 3px rgba(214, 51, 132, 0.1);
}

.location__submit,
.location__name__submit,
.location__reset,
.location__geolocate {
    padding: 10px 20px;
    background: #E93A2E;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
	height: 100%;
}

/*
.location__submit:hover,
.location__name__submit:hover,
.location__geolocate:hover {
    background: #b81b7a;
}
*/

/* Dropdown de recherche */
.location__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.location__results .item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.location__results .item:hover {
    background: #f8f9fa;
}

.location__results .item:last-child {
    border-bottom: none;
}

/* Contenu principal */
.store-locator__content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Carte */
.store-locator__map {
    overflow: hidden;
    position: relative;
    flex: 1;
	border-radius: 35px;
    overscroll-behavior: contain;
    height: 700px;
    border: 0.5px solid #000;
}

#store-locator-map {
    width: 100%;
    min-height: 100%;
}

.mapboxgl-canvas-container,
.mapboxgl-canvas {
    overscroll-behavior: contain;
}

/* Sidebar avec les magasins */
.store-locator__sidebar {
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    order: -1;
    height: 100%;
    max-width: 540px;
    /* padding-right: 30px; */
}

/* Liste des magasins */
.store-locator__list {
    flex: 1 1 auto;
    overflow-y: scroll !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    height: 0;
    position: relative;
    overscroll-behavior: contain;
    padding-right: 20px;
    margin-right: 10px;
}

.store-locator__stores {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.store-locator__count {
	margin-bottom: 10px;
}

/* Cards des magasins */
.card--partner {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
    cursor: pointer;
    background: white;
    /* border-radius: 12px; */
}

.card--partner:hover {
    /* background: #fff3cd; */
    /* border-left: 3px solid #d63384; */
    /* padding-left: 12px; */
}

.card__container--right {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card__container--body {
    display: flex;
    gap: 10px;
    justify-content: space-between;
	
	& img {
		max-width: 140px !important;
		border-radius: 18px;
		height: 134px;
		object-fit: cover;
	}
}

.card__store-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    padding-right: 100px;
}

.card__hours {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    flex: 1 1;
    flex-shrink: 0;
}

.card__hours small {
    font-size: 10px;
    text-transform: none;
}

.card__title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.card__title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card__title a:hover {
    color: #0149B6;
}

.card__content {
	& p {
		color: #000;
		margin: 0 0 5px 0 !important;
		font-weight: 400;
	}
	& a {
		color: #000 !important;
	}
}



.card__address,
.card__phone,
.card__email,
.card__website {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.4;
}

.card__phone:hover,
.card__email:hover,
.card__website:hover {
    color: #0149B6;
}

.card__address::before,
.card__phone::before,
.card__email::before,
.card__website::before {
	display: block;
	width: 18px;
	height: 18px;
}

.card__address::before {
	content: url("/wp-content/uploads/2025/12/store_location.svg");
}
.card__phone::before {
	content: url("/wp-content/uploads/2025/12/store_phone.svg");
}
.card__email::before {
	content: url("/wp-content/uploads/2025/12/store_email.svg");
}
.card__website::before {
	content: url("/wp-content/uploads/2025/12/website.svg");
}


/* Bouton d'action */
.card__btn a {
	color: #FFF !important;
	text-decoration: none; 
	display: inline-block; 
	padding: 8px 16px; 
	background: #E93A2E; 
	border-radius: 10px;
	transition: all 0.3s ease-in-out !important;
}

.card__btn a:hover::after {
	margin-left: 15px;
}

.card__btn a::after {
    content: url(/wp-content/uploads/2026/01/white_arrow.svg);
    margin-left: 10px;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
    transition: all 0.3s ease;
}

/* Loading states et états vides */
.store-locator.loading .store-locator__map::after {
    content: 'Chargement de la carte...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
}

.store-locator__stores:empty::after {
    content: 'Aucun magasin trouvé';
    display: block;
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1023px) {
	
	.store-locator {
		display: block;
		height: fit-content;
	}
	.store-locator__sidebar {
		padding-right: 0;
		max-width: 100%;
	}
	
    .store-locator__content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .store-locator__sidebar {
        order: -1;
    }
    
    .store-locator__list {
        height: 400px;
		padding-right: 0px;
    }
	.store-locator__filters {
        padding: 0;
	}
	.store-locator__map {
		margin-top: 20px;
		max-height: 400px;
	}
	
	.location__submit, .location__name__submit, .location__reset, .location__geolocate {
		min-width: auto;
		height: auto;
	}
}

@media (max-width: 768px) {
    
    .location-filter,
    .storename-filter {
        min-width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .location__input,
    .location_input_name {
        min-width: 200px;
    }
    
    .store-locator-container {
        padding: 15px;
    }
	
	.store-locator__map {
		border-radius: 12px;
	}
    
    .card--partner {
        padding: 15px;
    }
    
    .card__container--right {
        flex-direction: column-reverse;
        gap: 10px;
        align-items: flex-start;
    }
    
    .card__visual {
        width: 100px;
        height: 75px;
        margin-left: 0;
    }
    
    .store-locator__content {
        min-height: 400px;
    }
	
	.store-locator__list {
		margin-right: 0;
	}
}

@media (max-width: 480px) {
    
    .location-filter,
    .storename-filter {
        align-items: stretch;
        gap: 8px;
    }
    
    .location__input,
    .location_input_name {
        min-width: auto;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .location__submit,
    .location__name__submit,
    .location__reset,
    .location__geolocate {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .store-locator__count {
        padding: 15px;
    }
    
    .store-locator__count .count {
        font-size: 20px;
    }
    
    .card__title {
        font-size: 16px;
    }
    
    .card__container--infos {
        gap: 6px;
    }
    
    .card__location,
    .card__phone,
    .card__email,
    .card__website {
        font-size: 13px;
    }
}

/* Animation pour les éléments qui apparaissent */
.card--partner {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar personnalisée pour la liste des magasins */

/* Firefox scrollbar */
.store-locator__list {
    scrollbar-width: auto;
    scrollbar-color: #E93A2E #fff;
}


.store-locator__list::-webkit-scrollbar {
    width: 15px;
}

.store-locator__list::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 10px;
	border: 0.5px solid #cfcece
}

.store-locator__list::-webkit-scrollbar-thumb {
    background: #e93a2e;
    border-radius: 10px;
}

.store-locator__list::-webkit-scrollbar-thumb:hover {
    background: #e93a2e;
}



/* États de focus pour l'accessibilité */
.location__submit:focus,
.location__name__submit:focus,
.location__reset:focus,
.location__geolocate:focus,
.btn:focus,
.card--partner:focus {
    outline: 2px solid #0149B6;
    outline-offset: 2px;
}

.location__input:focus,
.location_input_name:focus {
    outline: none;
    border-color: #0149B6;
    box-shadow: 0 0 0 3px rgba(1, 73, 182, 0.1);
}

/* Améliorations d'accessibilité */
.card--partner {
    border-radius: 12px;
    position: relative;
    padding: 15px;
    border: 1px solid #006847;
    cursor: pointer;
    background: white;
}

.card--partner:focus {
    background: #f8f9fa;
}

/* Amélioration des liens */
.card__title a:focus {
    outline: 2px solid #0149B6;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Print styles */
@media print {
    .store-locator__map,
    .store-locator__filters {
        display: none;
    }
    
    .store-locator__content {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .store-locator__sidebar {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .card--partner {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 10px;
        padding: 15px;
        border-radius: 4px;
    }
    
    .card--partner:hover {
        background: transparent;
        transform: none;
    }
    
    .btn {
        border: 1px solid #ddd;
        background: transparent !important;
        color: #333 !important;
    }
}

/* Styles spécifiques WordPress */
.wp-store-locator-container .store-locator {
    font-family: inherit;
}

/* Override des styles WordPress si nécessaire */
.wp-store-locator-container * {
    box-sizing: border-box;
}

/* Mapbox overrides */
.mapboxgl-popup-content {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.mapboxgl-popup-tip {
    border-top-color: white;
}

/* Marker par défaut pour la géolocalisation */
.mapboxgl-marker {
    cursor: pointer;
}

/* Contrôles Mapbox */
.mapboxgl-ctrl-group {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mapboxgl-ctrl-group button {
    border-radius: 0;
}

.mapboxgl-ctrl-group button:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.mapboxgl-ctrl-group button:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .store-locator__filters {
        border: 2px solid #000;
    }
    
    .location__input,
    .location_input_name {
        border: 2px solid #000;
    }
    
    .card--partner {
        border: 1px solid #000;
    }
    
    .card--partner:hover {
        background: #e0e0e0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .card--partner,
    .btn,
    .location__input,
    .location_input_name,
    .location__submit,
    .location__name__submit,
    .location__reset,
    .location__geolocate {
        transition: none;
    }
    
    .card--partner {
        animation: none;
    }
    
    .card--partner:hover {
        transform: none;
    }
    
    .btn-red:hover {
        transform: none;
    }
}

/* Store Selector Modal */
.store-selector-btn {
    padding: 12px 24px;
    background-color: #E93A2E;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}


.store-selector-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.store-selector-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-selector-content {
    background-color: #EEEFE2;
    border-radius: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.store-selector-header {
    padding: 20px;
    border-bottom: 0.5px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.store-selector-header h2 {
    margin: 0;
    font-size: 20px !important;
}

.store-selector-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
}

.store-selector-close:hover {
    color: #333;
}


.store-selector-search {
    padding: 20px;
}

.store-selector-search input {
    width: 100%;
    padding: 10px;
    border: 0.5px solid #000 !important;
    border-radius: 12px;
    font-size: 14px;
    box-sizing: border-box;
}

.store-selector-search input:focus {
    outline: none;
    border-color: #E93A2E;
    box-shadow: 0 0 0 3px rgba(233, 58, 46, 0.1);
}

.store-selector-results {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.store-item {
	display: block;
    float: right;
    clear: both;
    width: 100%;
    padding: 15px;
    border: 0.5px solid #000;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
	background: #FFF;

}

.store-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.store-item-address, 
.store-item-email,
.store-item-phone {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.store-item-contact-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #E93A2E;
    color: #FFF !important;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: padding 0.2s ease-in-out !important;
	float: right;
	
	@media screen and (max-width: 767px) {
		margin-top: 5px;
	}
}

.store-item-contact-btn:hover {
    padding: 8px 22px;
}

.store-selector-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.store-selector-no-results {
    text-align: center;
    padding: 20px;
    color: #999;
}