/* WP Store Locator - Frontend Styles */

/* CSS Custom Properties for Dynamic Colors */
:root {
    --tooltip-color: #333333;
    --active-country-color: #ffd257;
    --hover-country-color: #e0e0e0;
    --popup-bg-color: #ffffff;
    --popup-text-color: #333333;
    --popup-header-color: #2c3e50;
}

/* jQVMap Tooltip - Using default styling */

/* jQVMap Container Styling */
.jqvmap-container {
    position: relative !important;
}

/* jQVMap Region Styling */
.jqvmap-region {
    cursor: pointer !important;
}

.jqvmap-region:hover {
    fill: var(--hover-country-color) !important;
}

.wp-store-locator-container {
    position: relative;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: visible; /* Allow popup to show outside container */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    height: 90vh; /* 90% of viewport height */
}
.jqvmap-label{
    padding: 0 !important;
    background: none !important;
    z-index: 99;
}
.jqvmap-tooltip-content{
    border-radius: 3px;
    padding: 0 5px;
    font-size: 14px;
}
/* removed list panel styles */

#store-locator-map {
    position: absolute;
    top: 0;
    left: 0;
    background: #f8f9fa;
    width: 100%;
    height: 100%;
    z-index: 1; /* Ensure map is above background but below popup */
}

/* Store Popup Styles */
.store-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--popup-bg-color);
    color: var(--popup-text-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 400px;
    min-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}
.store-popup {
    .popup-header{
        border-bottom: 1px solid #3b3b3b;
    }
    .dashicons, .dashicons-before:before{
        line-height: normal;
    }
    .store-details{
        font-size: 14px;
        p{
            align-items: flex-start !important;
        }
    }
}

/* Company name styling in popup */
.store-popup small {
    color: var(--popup-text-color);
    font-size: 14px;
}

.popup-content {
    position: relative;
}

.popup-header {
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.popup-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.popup-body {
    padding: 20px;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
}

.store-details {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #3b3b3b;
}

.store-details:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.store-details h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.store-details p {
    margin: 5px 0;
    display: flex;
    align-items: center;
}

.store-details .dashicons {
    margin-right: 5px;
}

/* Store details styling handled by .store-details above */

/* Responsive Design */
@media (max-width: 768px) {
    .store-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 90vw;
        min-width: 280px;
        max-height: 70vh;
    }
    
    .popup-header {
        padding: 12px 15px;
    }
    
    .popup-header h3 {
        font-size: 16px;
    }
    
    .popup-body {
        padding: 15px;
    }
    .popup-body p{
        display: flex;
        align-items: center;
    }
    .store-item h4 {
        font-size: 14px;
    }
    
    .store-details p {
        font-size: 13px;
    }
}

/* Map Container Responsive */
@media (max-width: 600px) {
    .wp-store-locator-container {
        margin: 10px 0;
        border-radius: 4px;
        width: 100%;
        height: 75vh; /* 75% of viewport height on mobile */
    }
}

/* Enhanced responsive behavior */
@media (max-width: 768px) {
    .wp-store-locator-container {
        margin: 10px 0;
        width: 100%;
        height: 80vh; /* 80% of viewport height on tablets */
    }
}

@media (max-width: 480px) {
    .wp-store-locator-container {
        margin: 5px 0;
        width: 100%;
        height: 70vh; /* 70% of viewport height on small mobile */
    }
}

/* Ensure map is always full width and responsive */
.wp-store-locator-container,
#store-locator-map,
.jvectormap-container,
.jvectormap-container svg {
    width: 100% !important;
    max-width: 100% !important;
    height: 800px !important;
}


/* Override aspect ratio for smaller screens */
@media (max-width: 768px) {
    .wp-store-locator-container {
        padding-bottom: 70%; /* Increased from 60% to 70% for taller mobile map */
    }
    
    #store-locator-map {
        min-height: 450px; /* Increased mobile min-height */
    }
}

@media (max-width: 480px) {
    .wp-store-locator-container {
        padding-bottom: 80%; /* Increased from 70% to 80% for even taller small mobile */
    }
    
    #store-locator-map {
        min-height: 400px; /* Increased small mobile min-height */
    }
}

/* Ensure map scales properly on all devices */
.jvectormap-container {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

.jvectormap-container svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
}

/* Fix for very small screens */
@media (max-width: 320px) {
    .wp-store-locator-container {
        height: 65vh; /* 65% of viewport height on very small screens */
    }
}

/* Loading State */
.wp-store-locator-container.loading {
    position: relative;
}

.wp-store-locator-container.loading::after {
    content: 'Loading map...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 100;
}
/* jQVMap Zoom Controls */
.jqvmap-zoomin,
.jqvmap-zoomout {
    background: #333 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    width: 20px !important;
    height: 20px !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jqvmap-zoomout{
    top: 40px !important;
}
.jqvmap-zoomin:hover,
.jqvmap-zoomout:hover {
    background: #000 !important;
}

.jqvmap-zoomin {
    margin-bottom: 2px !important;
}

    /* jQVMap Zoom Controls - Disabled */

.wp-store-locator-container{
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}