/* =========================================
   CUSTOM AVADA OPENSTREETMAP MOBILE SLIDER
   ========================================= */

/* Desktop Display -> Hide Slider */
.custom-map-mobile-wrapper {
    display: none;
}

/* Mobile Display Styles (Max Width 768px typical for Avada tablet/phone break) */
@media screen and (max-width: 992px) {

    /* Show mobile slider */
    .custom-map-mobile-wrapper {
        display: block;
        width: 100vw;
        max-width: 100%;
        margin: 1.915em 0 0;
        padding-bottom: 0;
        position: relative;
    }

    /* Keep the map itself sized appropriately */
    #custom-locations-map {
        min-height: 400px;
        border-radius: 12px;
        max-width: calc(100% - 60px);
        margin: 1.125em auto 0;
        height: 29.25em !important;
    }

    /* Slider Container */
    .custom-map-mobile-wrapper .custom-map-mobile-slider {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Hide scrollbar Firefox */
        -ms-overflow-style: none;
        /* Hide scrollbar IE Edge */
    }

    .custom-map-mobile-wrapper .custom-map-mobile-slider::-webkit-scrollbar {
        display: none;
        /* Hide Chrome/Safari */
    }

    /* Card Layout */
    .custom-map-mobile-wrapper .custom-map-mobile-card {
        flex: 0 0 80%;
        max-width: 283px;
        background-color: #031e33;
        border-radius: 8px;
        padding: 21px 6px;
        text-align: center;
        scroll-snap-align: center;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        border: 2px solid transparent;
        cursor: pointer;
        transition: transform 0.2s ease, border-color 0.2s ease;
    }

    /* Optional highlight state */
    .custom-map-mobile-wrapper .custom-map-mobile-card.active-card {
        transform: translateY(-5px);
        border-color: #ee392a;
        /* Match map pin red color for clarity */
    }

    /* Title Styling */
    .custom-map-mobile-wrapper .custom-map-mobile-card h4 {
        color: #ffffff;
        font-family: inherit;
        font-size: 20px;
        line-height: 1;
        font-weight: 600;
        margin: 0 0 10px 0;
        letter-spacing: 0.5px;
    }

    /* Content Styling (Phone & Address) */
    .custom-map-mobile-wrapper .custom-map-mobile-card .custom-map-mobile-info {
        color: #ffffff;
        font-weight: 300;
        font-family: inherit;
        font-size: 16px;
        line-height: 1.6;
        margin: 0;
    }

    .custom-map-mobile-wrapper .custom-map-mobile-card .custom-map-mobile-info br {
        content: "";
        display: block;
        margin-top: 5px;
    }

    /* If you want to hide the standard Leaflet Popups entirely on mobile (because they clash with the list below) uncomment this: 
    .leaflet-popup.leaflet-zoom-animated {
        display: none !important;
    }
    */

    /* Prev/Next Controls */
    .custom-map-mobile-controls {
        display: flex;
        justify-content: center;
        gap: 12px;
        margin-top: 20px;
    }

    .custom-map-mobile-controls button {
        background-color: #E8ECEF;
        border: 1px solid #C0C8D0;
        border-radius: 8px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
        padding: 0;
    }

    .custom-map-mobile-controls button.custom-map-btn-prev i.awb-icon-arrow-down2 {
        transform: rotate(90deg);
    }

    .custom-map-mobile-controls button.custom-map-btn-next i.awb-icon-arrow-down2 {
        transform: rotate(-90deg);
    }

    .custom-map-mobile-controls button:hover {
        background-color: #D3DBE2;
        border-color: #A0B0C0;
    }

    .custom-map-mobile-controls button:active {
        transform: scale(0.95);
    }

    .custom-map-mobile-controls button svg {
        stroke: #031E33;
    }
}