/* ================== Custom Store Map - Plugin Styles ======================= */

/* ---- Map Container ---- */
#map_container_v2 {
    padding: 0 140px 120px 140px !important;
    min-height: 50vh !important;
}

#map_container_v2 #custom-store-map {
    z-index: 9 !important;
    width: 60vw !important;
}

/* ---- Popup ---- */
#custom-store-map .map_popup {
    max-height: 310px !important;
    overflow-y: scroll !important;
    padding-right: 20px !important;
    margin-top: 8px !important;
}

#custom-store-map .map_popup::-webkit-scrollbar {
    width: 5px;
}

#custom-store-map .map_popup::-webkit-scrollbar-track {
    background: transparent;
}

#custom-store-map .map_popup::-webkit-scrollbar-thumb {
    background: #aeaeae;
    border-radius: 10px;
}

#custom-store-map .map_popup::-webkit-scrollbar-thumb:hover {
    background: #878787;
}

#map_container_v2 .map_popup_header_top {
    display: flex !important;
    gap: 10px !important;
}

#map_container_v2 .leaflet-popup .leaflet-popup-close-button {
    height: 20px !important;
    width: 20px !important;
    color: #1D1D1F !important;
    right: 0.5rem !important;
    top: 0.5rem !important;
}

#map_container_v2 .leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    padding: 1.3rem 0.8rem 1.3rem 1.6rem !important;
}

#map_container_v2 .leaflet-popup-content {
    margin: 0 !important;
    padding-right: 1rem !important;
}

#map_container_v2 .leaflet-popup-content .map_popup_partner_logo {
    max-width: 70px !important;
    width: auto !important;
    height: 45px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

#map_container_v2 .leaflet-popup-content h3 {
    font-family: 'IvyStyleSansSemiBold' !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    font-size: 22px !important;
    margin: 0 !important;
}

#map_container_v2 .map_popup_header {
    padding-bottom: 0;
}

#map_container_v2 .leaflet-popup-content p {
    margin: 0 !important;
}

#map_container_v2 .map_popup_header .map_popup_store_category {
    font-family: 'IvyStyleSansLightItalic' !important;
    font-size: 14px !important;
    margin-top: 25px !important;
    margin-bottom: 0 !important;
}

#map_container_v2 .leaflet-popup-content .map_popup_store_city {
    text-transform: uppercase !important;
}

#map_container_v2 .leaflet-popup-content .map_popup_store_address {
    display: flex !important;
    flex-direction: column !important;
    font-size: 18px !important;
    line-height: 28px !important;
    font-family: 'IvyStyleSansLight';
}

#map_container_v2 .leaflet-popup-content .map_popup_website {
    margin-top: 28px !important;
}

#map_container_v2 .leaflet-popup-content .map_popup_store_website {
    font-family: 'IvyStyleSansSemiBold' !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    min-width: max-content !important;
    color: #1d1d1f !important;
    border: 1px solid #1D1D1F !important;
    border-radius: 50px !important;
    padding: 14px 20px !important;
}

#map_container_v2 .leaflet-popup-content .map_popup_store_website:hover {
    color: #fff !important;
    background: #333D3C !important;
}

#map_container_v2 .leaflet-popup-content .map_popup_store_website img {
    height: 14px !important;
    width: 14px !important;
    filter: brightness(0) saturate(100%) invert(6%) sepia(0%) saturate(1844%) hue-rotate(39deg) brightness(104%) contrast(89%);
}

#map_container_v2 .leaflet-popup-content .map_popup_store_website:hover img {
    filter: brightness(0) saturate(100%) invert(97%) sepia(61%) saturate(16%) hue-rotate(241deg) brightness(103%) contrast(100%);
}

#map_container_v2 .leaflet-popup-content .map_popup_store_mail {
    min-width: max-content !important;
    color: #1d1d1f !important;
}

#map_container_v2 .leaflet-popup-content .map_popup_store_mail:hover {
    font-family: 'IvyStyleSansSemiBold';
}

#map_container_v2 .leaflet-tooltip p {
    margin: 12px 0 !important;
}

/* ---- External Link Icons ---- */
#map_container_v2 .external_link_icon::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url('../assets/icons/fleche.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 8px;
}

#map_container_v2 .external_link_icon_white::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url('../assets/icons/fleche.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 8px;
    filter: brightness(0) saturate(100%) invert(86%) sepia(0%) saturate(2042%) hue-rotate(347deg) brightness(106%) contrast(90%);
}

/* ---- Geolocation Button ---- */
#map_container_v2 #geo-btn {
    width: 100px;
    height: 53px;
    border: none;
    cursor: pointer;
    background: url('../assets/icons/geolocalisation.svg') no-repeat center / 23px auto;
    border-radius: 10px;
    background-color: #fff !important;
}

#map_container_v2 #geo-btn:hover {
    background-color: #8b9c90 !important;
    background: url('../assets/icons/geolocalisation_white.svg') no-repeat center / 40px auto;
}

/* ---- Search Panel ---- */
#map_container_v2 #search-panel {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

#map_container_v2 #search-panel .search-row {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: center !important;
}

#map_container_v2 #search-panel .search-input {
    background: url('../assets/icons/search.svg') no-repeat 95% 50% / 23px auto;
    border: 1px solid #666 !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-family: 'IvyStyleSansLight' !important;
    font-size: 18px !important;
    line-height: 18px;
    font-weight: 100 !important;
    margin-right: 0.8em !important;
    padding: 0.9rem 0.7rem !important;
}

#map_container_v2 #search-panel .search-input::placeholder {
    font-style: italic !important;
    color: #dedede !important;
}

#map_container_v2 #search-panel .search-input::-ms-input-placeholder {
    font-style: italic !important;
    color: #dedede !important;
}

#map_container_v2 #search-panel .search-input:-ms-input-placeholder {
    font-style: italic !important;
}

#map_container_v2 #search-panel .search-input::-webkit-input-placeholder {
    color: #dedede !important;
}

#map_container_v2 #search-panel #store-search {
    margin-top: 0rem !important;
}

#map_container_v2 #search-panel .search-choice-span {
    color: #fff !important;
    font-size: 26px !important;
    font-weight: 100 !important;
}

/* ---- Search Fields ---- */
#map_container_v2 .search-field {
    margin-bottom: 0.4rem !important;
    margin-top: 0.4rem !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 40% !important;
}

#map_container_v2 .search-field > div {
    display: flex;
    align-items: center;
}

#map_container_v2 .search-field #location-search {
    width: 100% !important;
}

#map_container_v2 .search-field label {
    font-size: 26px !important;
    margin-bottom: 21px !important;
    color: #fff !important;
}

/* ---- Category Filter ---- */
#map_container_v2 #category-filter {
    margin-top: 156px !important;
    width: 100% !important;
    max-width: 100% !important;
}

#map_container_v2 #category-filter .filter-options {
    display: flex !important;
    flex-direction: row !important;
    min-width: 100% !important;
    align-items: center !important;
    gap: 8%;
}

#map_container_v2 #category-filter .filter-options input {
    display: none !important;
}

#map_container_v2 #category-filter .filter-options label {
    font-size: 1.2rem !important;
    padding: 12px 0 !important;
    color: #fff !important;
    cursor: pointer !important;
    max-width: 15vw !important;
    min-width: min-content !important;
    display: inline-flex !important;
    font-weight: 100 !important;
    text-align: center !important;
    align-items: end !important;
}

#map_container_v2 #category-filter .filter-options label:has(input[type="checkbox"]:checked) {
    font-weight: 700 !important;
}

#map_container_v2 #category-filter .filter-options label.checked {
    font-weight: 700 !important;
}

/* ---- Filter Pictos (by category order) ---- */
#map_container_v2 #category-filter .filter-options label[data-category-code="DISTRI_NOT_STOCK"]::after {
    content: '';
    display: flex !important;
    float: inline-end !important;
    width: 2rem;
    height: 2rem;
    background-image: url('../assets/picto_map_revendeur.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 0.5rem;
    align-self: center;
    z-index: 9 !important;
}

#map_container_v2 #category-filter .filter-options label[data-category-code="DISTRI_STOCK"]::after {
    content: '';
    display: flex !important;
    float: inline-end !important;
    width: 2rem;
    height: 2rem;
    background-image: url('../assets/picto_map_grossiste.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 0.5rem;
    align-self: center;
}

#map_container_v2 #category-filter .filter-options label[data-category-code="REVENDEUR_POSEUR"]::after {
    content: '';
    display: flex !important;
    float: inline-end !important;
    width: 2rem;
    height: 2rem;
    background-image: url('../assets/picto_map_poseur.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 0.5rem;
    align-self: center;
}

#map_container_v2 #category-filter .filter-options label[data-category-code="GRAD"]::after {
    content: '';
    display: flex !important;
    float: inline-end !important;
    width: 2rem;
    height: 2rem;
    background-image: url('../assets/picto-usine-grad.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 0.5rem;
    align-self: center;
}

/* ---- Search Button ---- */
#map_container_v2 .search-btn-map {
    border: none;
    cursor: pointer;
    color: #fff;
    border-radius: 10px;
    background-color: #333D3C !important;
    margin-top: 54px !important;
    font-size: 18px;
    font-weight: 400;
    padding: 18px 6% !important;
}

#map_container_v2 .search-btn-map:hover {
    background-color: #8b9c90 !important;
}

/* ---- Leaflet Controls ---- */
#map_container_v2 .leaflet-control-attribution {
    position: absolute !important;
}

#map_container_v2 .leaflet-top {
    position: absolute !important;
    right: 1.5em !important;
    left: unset !important;
    bottom: 2em !important;
    top: unset !important;
}

#map_container_v2 .leaflet-control-zoom {
    display: flex !important;
    flex-direction: row-reverse !important;
}

#map_container_v2 .leaflet-control-zoom a {
    border-radius: 0 !important;
}

#map_container_v2 .leaflet-control-zoom a:hover {
    background: #8b9c90 !important;
    color: #fff !important;
}

#map_container_v2 .leaflet-control-zoom-out {
    margin-right: 0.25em !important;
}

/* ---- Search Results ---- */
#map_container_v2 #store-results {
    color: #dedede !important;
    width: 35% !important;
    max-height: 600px !important;
    overflow-y: scroll !important;
    padding-right: 2%;
}

#map_container_v2 #store-results::-webkit-scrollbar {
    width: 14px;
}

#map_container_v2 #store-results::-webkit-scrollbar-track {
    background-color: transparent !important;
    border: 1px solid transparent !important;
}

#map_container_v2 #store-results::-webkit-scrollbar-thumb {
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: content-box;
    background-color: #fe6f61 !important;
}

#map_container_v2 #store-results h3.map_results_count {
    color: #dedede !important;
    padding: 1em 0 !important;
    font-size: 20px !important;
    font-family: 'IvyStyleSansLight' !important;
    font-weight: 100 !important;
}

#map_container_v2 #store-results .map_results_list {
    margin: 0 !important;
    padding: 0 !important;
}

#map_container_v2 #store-results .map_result_item {
    list-style: none !important;
    padding: 1.5em 0 !important;
    border-bottom: 1px solid #444 !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_header {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_title {
    font-family: 'IvyStyleSansSemiBold' !important;
    text-transform: uppercase !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #dedede !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_meta {
    display: flex !important;
    align-items: center !important;
    padding: 6px 0 !important;
    border-top: 1px solid #555 !important;
    border-bottom: 1px solid #555 !important;
    margin: 8px 0 !important;
    font-size: 13px !important;
    font-family: 'IvyStyleSansLightItalic' !important;
    gap: 1rem !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_store_category {
    display: flex !important;
    flex-direction: column !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_store_address {
    font-size: 14px !important;
    line-height: 22px !important;
    font-family: 'IvyStyleSansLight' !important;
    color: #dedede !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_store_address p {
    margin: 0 !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_website {
    margin-top: 16px !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_store_website {
    font-family: 'IvyStyleSansSemiBold' !important;
    font-size: 14px !important;
    color: #dedede !important;
    border: 1px solid #dedede !important;
    border-radius: 50px !important;
    padding: 10px 16px !important;
    display: inline-block !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_store_website:hover {
    color: #333D3C !important;
    background: #dedede !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_contacts {
    margin-top: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_contacts_label {
    font-family: 'IvyStyleSansSemiBold' !important;
    font-size: 13px !important;
    color: #dedede !important;
    margin-bottom: 6px !important;
    margin-top: 10px !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_store_mail {
    color: #dedede !important;
    font-size: 14px !important;
    font-family: 'IvyStyleSansLight' !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_store_mail_wrapper,
#map_container_v2 #store-results .map_result_item .map_popup_store_phone {
    line-height: 1rem !important;
}

#map_container_v2 #store-results .map_result_item .map_popup_store_mail:hover {
    font-family: 'IvyStyleSansSemiBold' !important;
}

/* ---- Map V2 Layout ---- */
#map_container_v2 .e-con-inner {
    min-width: 90vw !important;
}

#map_container_v2 #search-and-filter {
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 2rem !important;
}

#map_container_v2 #map_container_filter_and_shortcode {
    display: flex !important;
}

/* ---- Popup Gallery Slider ---- */
#map_container_v2 .map-popup-gallery {
    margin-top: 2rem !important;
    width: 100%;
    overflow: hidden;
}

#map_container_v2 .map-popup-gallery .swiper-slide {
    height: 140px;
    overflow: hidden;
    position: relative;
}

#map_container_v2 .map-popup-gallery .map-popup-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    display: block;
    transition: filter 0.4s ease;
}

#map_container_v2 .map-popup-gallery .swiper-slide:hover .map-popup-gallery-img {
    filter: brightness(0.6);
}

#map_container_v2 .map-popup-gallery .map-popup-gallery-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    background: #1D1D1F;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#map_container_v2 .map-popup-gallery .map-popup-gallery-icon svg {
    width: 18px;
}

#map_container_v2 .map-popup-gallery .swiper-slide:hover .map-popup-gallery-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#map_container_v2 .map-popup-gallery .swiper-button-prev::after,
#map_container_v2 .map-popup-gallery .swiper-button-next::after {
    display: none !important;
}

#map_container_v2 .map-popup-gallery .swiper-button-prev,
#map_container_v2 .map-popup-gallery .swiper-button-next {
    background-color: #fff !important;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
    border-radius: 50%;
    width: 28px !important;
    height: 28px !important;
    top: 57% !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

#map_container_v2 .map-popup-gallery .swiper-button-next {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1080 1080'%3E%3Cpath d='M639.3,789.6h-43.8c2.6-95.8,56.9-182.8,141.9-227.1H174.1v-43.8h562.9c-17.4-9.9-33.8-21.4-49-34.5-57.8-47.4-91.7-118-92.5-192.8h43.8c.9,62,29.2,120.4,77.2,159.6,53.4,44.6,120.9,68.5,190.4,67.6h0v43.8h0c-147.6,0-267.7,101.9-267.7,227.2' fill='%231D1D1F'/%3E%3C/svg%3E");
}

#map_container_v2 .map-popup-gallery .swiper-button-prev {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1080 1080'%3E%3Cpath d='M639.3,789.6h-43.8c2.6-95.8,56.9-182.8,141.9-227.1H174.1v-43.8h562.9c-17.4-9.9-33.8-21.4-49-34.5-57.8-47.4-91.7-118-92.5-192.8h43.8c.9,62,29.2,120.4,77.2,159.6,53.4,44.6,120.9,68.5,190.4,67.6h0v43.8h0c-147.6,0-267.7,101.9-267.7,227.2' fill='%231D1D1F'/%3E%3C/svg%3E");
    transform: scaleX(-1);
}

#map_container_v2 .map-popup-gallery .swiper-pagination {
    display: none !important;
}

/* ---- Lightbox Modal ---- */
#map-lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

#map-lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

#map-lightbox-modal .map-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
}

#map-lightbox-modal .map-lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

#map-lightbox-modal .map-lightbox-img-wrapper {
    width: 70vw;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#map-lightbox-modal .map-lightbox-img {
    max-width: 70vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    transition: opacity 0.2s ease;
}

#map-lightbox-modal .map-lightbox-img.loading {
    opacity: 0;
}

#map-lightbox-modal .map-lightbox-loader {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lightbox-spin 0.7s linear infinite;
    display: none;
}

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

#map-lightbox-modal .map-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

#map-lightbox-modal .map-lightbox-prev,
#map-lightbox-modal .map-lightbox-next {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

#map-lightbox-modal .map-lightbox-prev:hover,
#map-lightbox-modal .map-lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}

#map-lightbox-modal .map-lightbox-counter {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-family: 'IvyStyleSansLight', sans-serif;
    white-space: nowrap;
}

/* ---- Responsive ---- */
@media screen and (max-width: 43rem) {

    #map_container_v2 .search-btn-map {
        display: inline-block;
        width: 100% !important;
        margin-top: 33px !important;
    }

    #map_container_v2 .search-btn-map:hover {
        background-color: #000 !important;
    }

    #map_container_v2 #search-and-filter {
        flex-direction: column !important;
        align-items: center !important;
    }

    #map_container_v2 #search-panel {
        max-width: 100vw !important;
        margin-bottom: 2rem !important;
        flex-direction: column !important;
    }

    #map_container_v2 #search-panel .search-input {
        min-width: 80vw;
        background: url('../assets/icons/search.svg') no-repeat 95% 50% / 15px auto !important;
        margin-right: 0 !important;
        height: 52px !important;
        font-size: 18px !important;
    }

    #map_container_v2 #search-panel .search-row {
        margin-right: 0rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    #map_container_v2 {
        padding: 0 22px !important;
    }

    #map_container_v2 #category-filter .filter-options {
        display: grid !important;
        grid-template-columns: auto auto auto !important;
        column-gap: 2rem !important;
        justify-items: center !important;
    }

    #map_container_v2 #category-filter .filter-options label {
        max-width: 100% !important;
        flex-direction: column-reverse !important;
        align-self: start;
    }

    #map_container_v2 #category-filter .filter-options label::after {
        margin-bottom: 5px !important;
    }

    #map_container_v2 #category-filter .filter-options label:first-child {
        align-self: center !important;
        margin-top: 10px !important;
    }

    #map_container_v2 #geo-btn {
        height: 52px !important;
        width: 100% !important;
    }

    #map_container_v2 #custom-store-map {
        height: 45vh !important;
        min-width: 100vw !important;
    }

    #map_container_v2 #store-results {
        height: min-content !important;
        min-width: 100vw !important;
        padding: 0 1.5rem !important;
        margin: 2rem 0 !important;
    }

    #map_container_v2 .search-row {
        gap: 3rem;
    }

    #map_container_v2 .search-field {
        min-width: 100% !important;
    }

    #map_container_v2 .search-field label {
        font-size: 20px !important;
        margin-bottom: 13px !important;
    }

    #map_container_v2 .search-field > div {
        gap: 3%;
    }

    #map_container_v2 .search-field > div input {
        min-width: 80% !important;
    }

    #map_container_v2 #category-filter {
        margin-top: 0px !important;
    }
}