/**
 * Nearby Stores Styles
 *
 * @package WC_Multi_Location_Inventory
 */

/* Use My Location Button */
.wc-mli-use-my-location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wc-mli-use-my-location:hover {
    background: #e9e9e9;
    border-color: #ccc;
}

.wc-mli-use-my-location.loading {
    opacity: 0.7;
    pointer-events: none;
}

.wc-mli-use-my-location::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cline x1='12' y1='2' x2='12' y2='4'/%3E%3Cline x1='12' y1='20' x2='12' y2='22'/%3E%3Cline x1='2' y1='12' x2='4' y2='12'/%3E%3Cline x1='20' y1='12' x2='22' y2='12'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

/* Check Nearby Button */
.wc-mli-check-nearby {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #0073aa;
    border-radius: 4px;
    color: #0073aa;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.wc-mli-check-nearby:hover {
    background: #0073aa;
    color: #fff;
}

.wc-mli-check-nearby.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Distance Display */
.wc-mli-distance {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    margin-left: 8px;
}

/* Nearby Stores Modal */
.wc-mli-nearby-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wc-mli-nearby-modal--visible {
    opacity: 1;
    visibility: visible;
}

.wc-mli-nearby-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.wc-mli-nearby-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.wc-mli-nearby-modal--visible .wc-mli-nearby-modal-content {
    transform: translateY(0);
}

.wc-mli-nearby-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
}

.wc-mli-nearby-modal-close:hover {
    color: #333;
}

.wc-mli-nearby-modal h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
    padding-right: 30px;
}

.wc-mli-nearby-count {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 14px;
}

.wc-mli-no-nearby {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Nearby Store List */
.wc-mli-nearby-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wc-mli-nearby-store {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.wc-mli-nearby-store-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-mli-nearby-store-name {
    font-size: 15px;
    color: #333;
}

.wc-mli-nearby-distance {
    font-size: 13px;
    color: #0073aa;
}

.wc-mli-nearby-stock {
    font-size: 13px;
    color: #46b450;
}

.wc-mli-nearby-stock.low-stock {
    color: #ffb900;
}

.wc-mli-nearby-section {
    font-size: 12px;
    color: #888;
}

.wc-mli-nearby-store-select {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.wc-mli-nearby-store-select:hover {
    background: #005177;
}

/* Current Location Display */
.wc-mli-current-location {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 16px;
}

.wc-mli-current-location-icon {
    width: 24px;
    height: 24px;
    fill: #0073aa;
}

.wc-mli-current-location-info {
    flex: 1;
}

.wc-mli-current-location-name {
    font-weight: 600;
    color: #333;
}

.wc-mli-current-location-distance {
    font-size: 13px;
    color: #666;
}

/* Loading Animation */
.wc-mli-use-my-location.loading::before,
.wc-mli-check-nearby.loading::before {
    animation: wc-mli-pulse 1s infinite;
}

@keyframes wc-mli-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .wc-mli-nearby-modal-content {
        width: 95%;
        padding: 16px;
        max-height: 85vh;
    }

    .wc-mli-nearby-store {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .wc-mli-nearby-store-select {
        width: 100%;
        text-align: center;
    }
}
