/**
 * Brezenshop Store Locator Styles
 */

/* Main Container */
.brezenshop-store-locator {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Search Box */
.store-locator-search {
    margin-bottom: 20px;
}

.search-container {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 20px;
}

.branch-search-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.branch-search-input:focus {
    outline: none;
    border-color: #96588a;
}

.branch-search-button,
.branch-locate-button {
    padding: 12px 20px;
    font-size: 16px;
    background: #96588a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.branch-search-button:hover,
.branch-locate-button:hover {
    background: #7a4571;
}

.branch-locate-button {
    padding: 12px 15px;
}

.branch-search-button .dashicons,
.branch-locate-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Search Results */
.search-results {
    max-width: 600px;
    margin: 0 auto;
}

.search-results.has-results {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

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

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.search-result-address {
    font-size: 14px;
    color: #666;
}

.search-result-distance {
    font-size: 13px;
    color: #96588a;
    font-weight: bold;
}

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

/* Map Container */
.store-locator-map-container {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.branch-map {
    min-height: 400px;
}

/* Custom Marker Popup */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.branch-popup {
    min-width: 200px;
}

.branch-popup-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.branch-popup-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.branch-popup-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.branch-popup-button {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    background: #96588a;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s;
}

.branch-popup-button:hover {
    background: #7a4571;
}

.branch-popup-button.secondary {
    background: #f0f0f0;
    color: #333;
}

.branch-popup-button.secondary:hover {
    background: #e0e0e0;
}

/* Branch List */
.store-locator-list {
    margin-top: 30px;
}

.store-locator-list h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.branch-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.branch-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s, transform 0.3s;
    cursor: pointer;
}

.branch-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.branch-card-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.branch-card-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.branch-card-info {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
}

.branch-card-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

.branch-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.branch-card-button {
    flex: 1;
    padding: 10px 15px;
    font-size: 14px;
    background: #96588a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s;
}

.branch-card-button:hover {
    background: #7a4571;
}

.branch-card-button.secondary {
    background: #f0f0f0;
    color: #333;
}

.branch-card-button.secondary:hover {
    background: #e0e0e0;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #96588a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

/* Status Badges */
.branch-status {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
    font-weight: bold;
}

.branch-status.active {
    background: #d4edda;
    color: #155724;
}

.branch-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Opening Hours */
.opening-hours {
    font-size: 13px;
    margin-top: 10px;
}

.opening-hours-day {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.opening-hours-day:last-child {
    border-bottom: none;
}

.opening-hours-label {
    font-weight: bold;
    color: #333;
}

.opening-hours-time {
    color: #666;
}

.opening-hours-closed {
    color: #999;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
    }
    
    .branch-list {
        grid-template-columns: 1fr;
    }
    
    .branch-popup-actions {
        flex-direction: column;
    }
}

/* Checkout Integration */
.brezenshop-branch-selection {
    margin: 20px 0;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 5px;
}

.brezenshop-branch-selection h3 {
    margin-top: 0;
    color: #333;
}

.branch-details {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.branch-details h4 {
    margin-top: 0;
    color: #96588a;
}

.branch-details p {
    margin: 5px 0;
    color: #666;
}

.branch-selector-link {
    margin-top: 15px;
}

.branch-selector-link .button {
    display: inline-block;
    padding: 10px 20px;
    background: #96588a;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.branch-selector-link .button:hover {
    background: #7a4571;
}
