/**
 * Zonesoft Multistore Styles
 * 
 * Styles for the multistore functionality including store switcher
 */

/* Store Switcher Styles */
.zonesoft-store-switcher {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.store-switcher-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.store-switcher-label {
    font-weight: 600;
    color: #495057;
    margin: 0;
    white-space: nowrap;
}

.store-switcher-select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.store-switcher-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.store-switcher-select:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

.store-switcher-loading {
    color: #6c757d;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
}

.store-switcher-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #6c757d;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Notification Styles */
.zonesoft-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.zonesoft-notification-success {
    background-color: #28a745;
    border-left: 4px solid #1e7e34;
}

.zonesoft-notification-error {
    background-color: #dc3545;
    border-left: 4px solid #bd2130;
}

.zonesoft-notification-info {
    background-color: #17a2b8;
    border-left: 4px solid #117a8b;
}

/* Store Information in Cart */
.woocommerce-cart-form__cart-item .store-info {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 4px;
}

.woocommerce-cart-form__cart-item .store-info::before {
    content: "📍 ";
}

/* Product Store Availability */
.product-store-availability {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #28a745;
}

.product-store-availability h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #495057;
}

.store-availability-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.store-availability-list li {
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.store-name {
    font-weight: 500;
    color: #495057;
}

.store-stock-cell {
    display: flex;
    align-items: center;
}

.store-stock-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.store-stock-dot--in-stock {
    background-color: #28a745;
}

.store-stock-dot--low-stock {
    background-color: #fd7e14;
}

.store-stock-dot--out-of-stock {
    background-color: #dc3545;
}

.store-stock {
    font-size: 0.9em;
    color: #6c757d;
}

.store-stock.in-stock {
    color: #28a745;
}

.store-stock.out-of-stock {
    color: #dc3545;
}

.store-stock.low-stock {
    color: #fd7e14;
}

/* Responsive Design */
@media (max-width: 768px) {
    .store-switcher-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .store-switcher-select {
        min-width: auto;
    }
    
    .zonesoft-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* WooCommerce Integration */
.woocommerce .zonesoft-store-switcher {
    margin-bottom: 1.5em;
}

.single-product .zonesoft-store-switcher {
    margin-bottom: 1em;
}

/* Admin Bar Spacing */
body.admin-bar .zonesoft-notification {
    top: 52px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .zonesoft-notification {
        top: 66px;
    }
}

/* Theme Compatibility */
.theme-storefront .zonesoft-store-switcher,
.theme-astra .zonesoft-store-switcher,
.theme-oceanwp .zonesoft-store-switcher {
    margin-bottom: 1.618em;
}

/* Loading State */
.zonesoft-store-switcher.loading {
    opacity: 0.7;
    pointer-events: none;
}

.zonesoft-store-switcher.loading .store-switcher-select {
    cursor: not-allowed;
}

/* Success State */
.zonesoft-store-switcher.success {
    border-color: #28a745;
    background-color: #f8fff9;
}

/* Error State */
.zonesoft-store-switcher.error {
    border-color: #dc3545;
    background-color: #fff8f8;
} 