/* Partner Storepoint Frontend Styles */

.psp-map-container {
    position: relative;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.psp-map {
    width: 100%;
    min-height: 300px;
}

.psp-map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.psp-search-box {
    display: flex;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.psp-search-input {
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    width: 200px;
}

.psp-search-button {
    background: #0073aa;
    border: none;
    padding: 10px 15px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psp-search-button:hover {
    background: #005a87;
}

.psp-search-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.psp-brand-filters {
}

.psp-filter-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 12px;
    margin: 3px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.psp-filter-btn:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.psp-filter-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.psp-filter-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border-radius: 2px;
}

/* Popup Styles */
.leaflet-popup-content {
    margin: 15px;
    line-height: 1.4;
}

.psp-popup h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.psp-brand-info {
    color: #0073aa;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.psp-address {
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
    line-height: 1.3;
}

.psp-phone,
.psp-hours {
    margin-bottom: 5px;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.psp-actions {
    margin-top: 12px;
    text-align: center;
}

.psp-order-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
    width: 100%;
}

.psp-order-btn:hover {
    background: #005a87;
}

.psp-order-btn:active {
    transform: translateY(1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .psp-brand-filters {
        position: static;
        margin-bottom: 10px;
        max-height: none;
        overflow-y: visible;
    }
    
    .psp-map-controls {
        position: static;
        padding: 10px;
        background: #f9f9f9;
        border-bottom: 1px solid #ddd;
    }
    
    .psp-search-input {
        width: 150px;
    }
    
    .psp-filter-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .psp-brand-filters {
        padding: 10px;
    }
    
    .psp-filter-btn {
        display: block;
        width: 100%;
        margin: 2px 0;
        text-align: left;
    }
    
    .psp-search-input {
        width: 120px;
    }
}

/* Loading States */
.psp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-size: 16px;
}

.psp-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.psp-error {
    padding: 20px;
    text-align: center;
    color: #d63638;
    background: #fef7f7;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px;
}

/* Accessibility */
.psp-filter-btn:focus,
.psp-search-input:focus,
.psp-search-button:focus,
.psp-order-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .psp-filter-btn {
        border-width: 2px;
    }
    
    .psp-filter-btn.active {
        background: #000;
        color: #fff;
        border-color: #000;
    }
}

/* Sidebar Layout */
.psp-map-layout {
    display: flex;
    height: 100%;
    min-height: 500px;
}

.psp-sidebar {
    width: 350px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.psp-map-area {
    flex: 1;
    position: relative;
}

.psp-search-section {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    background: white;
}

.psp-search-section .psp-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.psp-brand-filters {
    border-bottom: 1px solid #dee2e6;
    background: white;
}

.psp-brand-filters h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.psp-locations-list {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.psp-locations-list h3 {
    margin: 0;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #dee2e6;
    font-size: 16px;
    color: #333;
}

.psp-locations-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.psp-location-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.psp-location-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.psp-location-header {
    margin-bottom: 8px;
}

.psp-location-header h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.psp-location-brand {
    font-size: 12px;
    color: #0073aa;
    font-weight: 500;
}

.psp-location-details p {
    margin: 4px 0;
    font-size: 13px;
    color: #666;
}

.psp-location-address {
    font-weight: 500;
    color: #333 !important;
}

.psp-location-phone,
.psp-location-website {
    font-size: 12px;
}

.psp-location-website a {
    color: #0073aa;
    text-decoration: none;
}

.psp-location-website a:hover {
    text-decoration: underline;
}

.psp-directions-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
    font-weight: 500;
}

.psp-directions-btn:hover {
    background: #218838;
}

.psp-no-locations {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Mobile responsive for sidebar */
@media (max-width: 768px) {
    .psp-map-layout {
        flex-direction: column;
    }
    
    .psp-sidebar {
        width: 100%;
        max-height: 40vh;
        order: 2;
    }
    
    .psp-map-area {
        order: 1;
        min-height: 300px;
    }
}
