/* Frontend Styles for WooCommerce Multi Store Locations */

/* Location Selector */
.wc-msl-location-selector {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wc-msl-location-selector h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.wc-msl-location-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.wc-msl-current-location {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wc-msl-location-icon {
    width: 16px;
    height: 16px;
    fill: #666;
}

.wc-msl-location-name {
    font-weight: 600;
    color: #333;
}

.wc-msl-location-address {
    color: #666;
    font-size: 13px;
}

/* Store Locator */
.wc-msl-store-locator {
    margin: 20px 0;
}

.wc-msl-locator-search {
    margin-bottom: 20px;
}

.wc-msl-search-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wc-msl-search-button {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

.wc-msl-search-button:hover {
    background: #005a87;
}

.wc-msl-map-container {
    height: 400px;
    width: 100%;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.wc-msl-locations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.wc-msl-location-card {
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wc-msl-location-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.wc-msl-location-card .address {
    margin-bottom: 10px;
    color: #666;
    line-height: 1.5;
}

.wc-msl-location-card .contact {
    margin-bottom: 10px;
}

.wc-msl-location-card .contact span {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.wc-msl-location-card .hours {
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.wc-msl-location-card .actions {
    display: flex;
    gap: 10px;
}

.wc-msl-select-location,
.wc-msl-get-directions {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.wc-msl-select-location {
    background: #0073aa;
    color: #fff;
}

.wc-msl-select-location:hover {
    background: #005a87;
    color: #fff;
}

.wc-msl-get-directions {
    background: #f7f7f7;
    color: #333;
    border: 1px solid #ccc;
}

.wc-msl-get-directions:hover {
    background: #ececec;
    color: #333;
}

/* Product Stock Display */
.wc-msl-stock-info {
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
}

.wc-msl-stock-available {
    color: #46b450;
    font-weight: 600;
}

.wc-msl-stock-low {
    color: #ffb900;
    font-weight: 600;
}

.wc-msl-stock-out {
    color: #dc3232;
    font-weight: 600;
}

.wc-msl-nearby-locations {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.wc-msl-nearby-locations h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.wc-msl-nearby-location {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.wc-msl-nearby-location:last-child {
    border-bottom: none;
}

.wc-msl-nearby-location .name {
    font-weight: 600;
    color: #333;
}

.wc-msl-nearby-location .distance {
    color: #666;
    font-size: 13px;
}

.wc-msl-nearby-location .stock {
    color: #46b450;
    font-size: 13px;
}

/* Fulfillment Options */
.wc-msl-fulfillment-options {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wc-msl-fulfillment-options h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.wc-msl-fulfillment-option {
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.wc-msl-fulfillment-option:hover {
    border-color: #0073aa;
}

.wc-msl-fulfillment-option input[type="radio"] {
    margin-right: 10px;
}

.wc-msl-fulfillment-option label {
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.wc-msl-fulfillment-option .description {
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

/* Loading States */
.wc-msl-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
}

.wc-msl-loading::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: wc-msl-spin 1s linear infinite;
}

@keyframes wc-msl-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.wc-msl-error {
    padding: 10px;
    background: #fff5f5;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    color: #721c24;
}

/* Success States */
.wc-msl-success {
    padding: 10px;
    background: #f0f8f0;
    border: 1px solid #c6e1c6;
    border-radius: 4px;
    color: #155724;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-msl-locations-list {
        grid-template-columns: 1fr;
    }
    
    .wc-msl-location-card .actions {
        flex-direction: column;
    }
    
    .wc-msl-search-button {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .wc-msl-nearby-location {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* WooCommerce Integration */
.woocommerce .wc-msl-location-selector {
    margin-bottom: 20px;
}

.woocommerce .wc-msl-stock-info {
    margin-top: 10px;
}

.single-product .wc-msl-location-selector {
    margin: 20px 0;
}

/* Checkout Integration */
.woocommerce-checkout .wc-msl-fulfillment-options {
    margin: 20px 0;
}

/* Cart Integration */
.woocommerce-cart .wc-msl-location-selector {
    margin: 20px 0;
}

/* Store Locator Shortcode */
.wc-msl-store-locator-shortcode {
    margin: 20px 0;
}

.wc-msl-store-locator-shortcode .wc-msl-map-container {
    margin-bottom: 30px;
}

/* Location Status Indicators */
.wc-msl-location-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.wc-msl-location-status.active {
    background: #d4edda;
    color: #155724;
}

.wc-msl-location-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.wc-msl-location-status.maintenance {
    background: #fff3cd;
    color: #856404;
}

/* Distance Display */
.wc-msl-distance {
    font-size: 13px;
    color: #666;
    margin-left: 5px;
}

.wc-msl-distance::before {
    content: "(";
}

.wc-msl-distance::after {
    content: ")";
}
