/**
 * WC Multi-Location Inventory - Frontend Styles
 */

/* Location Trigger */
.wc-mli-location-trigger {
    margin: 15px 0;
}

.wc-mli-open-panel {
    display: inline-flex;
    align-items: center;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.wc-mli-open-panel:hover {
    color: #005177;
    text-decoration: underline;
}

.wc-mli-open-panel::before {
    content: "\f341";
    font-family: dashicons;
    margin-right: 5px;
}

/* Current Location Stock Display */
.wc-mli-current-location-stock {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.wc-mli-location-name {
    margin-bottom: 8px;
    font-size: 14px;
}

.wc-mli-location-name .label {
    color: #666;
}

.wc-mli-stock-info {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.wc-mli-stock-info.stock-status-instock {
    color: #28a745;
}

.wc-mli-stock-info.stock-status-outofstock {
    color: #dc3545;
}

.wc-mli-stock-info.stock-status-onbackorder {
    color: #ffc107;
}

.wc-mli-stock-info .stock-quantity {
    font-size: 24px;
    margin-right: 5px;
}

.wc-mli-section-info {
    font-size: 13px;
    color: #666;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.wc-mli-section-info .section {
    font-weight: 500;
    color: #333;
}

/* Shop Loop Stock Indicator */
.wc-mli-loop-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-mli-loop-stock.stock-status-instock {
    background: #d4edda;
    color: #28a745;
}

.wc-mli-loop-stock.stock-status-outofstock {
    background: #f8d7da;
    color: #dc3545;
}

.wc-mli-loop-stock .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Slide Panel */
.wc-mli-slide-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}

.wc-mli-slide-panel.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.wc-mli-panel-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.wc-mli-panel-content {
    position: absolute;
    top: 0;
    right: -400px;
    bottom: 0;
    width: 400px;
    max-width: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.wc-mli-slide-panel.is-open .wc-mli-panel-content {
    right: 0;
}

.wc-mli-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.wc-mli-panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.wc-mli-panel-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.wc-mli-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Location Items */
.wc-mli-locations-list {
    padding: 0;
}

.wc-mli-location-item {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

.wc-mli-location-item:hover {
    background: #f8f9fa;
}

.wc-mli-location-item.is-selected {
    background: #e8f4fd;
    border-left: 3px solid #0073aa;
}

.wc-mli-location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.wc-mli-location-item h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wc-mli-selected-badge {
    background: #0073aa;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}

.wc-mli-location-address {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.wc-mli-location-stock {
    margin-bottom: 10px;
}

.wc-mli-location-stock .wc-mli-loading {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

.wc-mli-location-stock .stock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.wc-mli-location-stock .stock-status.instock {
    color: #28a745;
}

.wc-mli-location-stock .stock-status.outofstock {
    color: #dc3545;
}

.wc-mli-location-stock .stock-status.onbackorder {
    color: #ffc107;
}

.wc-mli-location-stock .stock-status.is-low-stock {
    color: #fd7e14;
}

.wc-mli-location-stock .stock-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wc-mli-location-stock .stock-icon.instock {
    background: #d4edda;
}

.wc-mli-location-stock .stock-icon.outofstock {
    background: #f8d7da;
}

.wc-mli-location-section {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.wc-mli-location-section .section-label {
    font-weight: 500;
}

.wc-mli-select-location {
    width: 100%;
    padding: 10px 15px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

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

.wc-mli-location-item.is-selected .wc-mli-select-location {
    background: #666;
}

/* Price Disclaimer */
.wc-mli-price-disclaimer {
    padding: 15px 20px;
    background: #fff3cd;
    color: #856404;
    font-size: 12px;
    border-top: 1px solid #e9ecef;
}

/* Location Selector Shortcode */
.wc-mli-location-dropdown {
    margin: 15px 0;
}

.wc-mli-location-dropdown label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.wc-mli-location-dropdown select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wc-mli-location-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.wc-mli-location-button {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-mli-location-button:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.wc-mli-location-button.is-active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.wc-mli-location-button .address {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.wc-mli-location-button.is-active .address {
    color: rgba(255, 255, 255, 0.8);
}

/* Cart Location */
.wc-mli-cart-location {
    color: #666;
    font-weight: normal;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .wc-mli-panel-content {
        width: 100%;
        right: -100%;
    }

    .wc-mli-location-buttons {
        flex-direction: column;
    }

    .wc-mli-location-button {
        width: 100%;
    }
}

/* Animation for stock updates */
@keyframes wc-mli-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.wc-mli-stock-updated {
    animation: wc-mli-pulse 0.3s ease;
}

/* Loading state */
.wc-mli-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: wc-mli-spin 1s linear infinite;
}

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

/* Also Available At Widget */
.wc-mli-other-stores {
    margin: 15px 0;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

.wc-mli-other-stores-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
}

.wc-mli-other-stores-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wc-mli-other-store-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #e9ecef;
}

.wc-mli-other-store-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.wc-mli-other-store-item .store-name {
    font-weight: 500;
    color: #333;
}

.wc-mli-other-store-item .store-stock {
    color: #28a745;
    font-size: 12px;
}

.wc-mli-other-store-item .store-section {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.wc-mli-view-all-stores {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
}

.wc-mli-view-all-stores:hover {
    text-decoration: underline;
}

.wc-mli-other-stores-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* Section Info Display - Minimalist Design */
.wc-mli-section-display {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 16px 0;
    font-size: 14px;
    color: #666;
}

.wc-mli-section-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #888;
}

.wc-mli-section-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.wc-mli-section-label {
    color: #666;
    font-weight: 400;
}

.wc-mli-section-value {
    color: #333;
    font-weight: 500;
}

/* Native WC Product Page - Location Selector Wrapper */
.wc-mli-location-selector-wrapper {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.wc-mli-location-selector-wrapper h4 {
    color: #333;
}

/* Detect Location Button */
.wc-mli-detect-location-wrap {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.wc-mli-detect-location,
#wc-mli-detect-location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #0073aa;
    color: #0073aa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wc-mli-detect-location:hover,
#wc-mli-detect-location:hover {
    background: #0073aa;
    color: #fff;
}

.wc-mli-detect-location:hover svg,
#wc-mli-detect-location:hover svg {
    stroke: #fff;
}

.wc-mli-detect-location.is-loading,
#wc-mli-detect-location.is-loading {
    opacity: 0.7;
    cursor: wait;
}

/* Location Messages */
.wc-mli-location-message {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.wc-mli-location-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wc-mli-location-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Native WC Product Page - Stock Display */
.wc-mli-stock-display {
    min-height: 60px;
}

.wc-mli-loading-stock {
    color: #666;
    font-size: 14px;
    padding: 15px 0;
}

.wc-mli-stock-error {
    color: #dc3545;
    font-size: 14px;
    padding: 10px 0;
}

.wc-mli-no-location {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.wc-mli-current-stock {
    padding: 0;
    border-radius: 0;
    background: transparent;
    border-left: none;
}

.wc-mli-current-stock.stock-status-instock {
    border-left-color: transparent;
    background: transparent;
}

.wc-mli-current-stock.stock-status-outofstock {
    border-left-color: transparent;
    background: transparent;
}

.wc-mli-current-stock.is-low-stock {
    border-left-color: transparent;
    background: transparent;
}

.wc-mli-stock-header {
    margin-bottom: 8px;
}

.wc-mli-stock-label {
    font-size: 13px;
    color: #666;
}

.wc-mli-stock-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-mli-stock-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wc-mli-stock-icon.instock {
    background: #d4edda;
    color: #28a745;
}

.wc-mli-stock-icon.outofstock {
    background: #f8d7da;
    color: #dc3545;
}

.wc-mli-stock-text {
    font-size: 16px;
    font-weight: 600;
}

.stock-status-instock .wc-mli-stock-text {
    color: #28a745;
}

.stock-status-outofstock .wc-mli-stock-text {
    color: #dc3545;
}

.is-low-stock .wc-mli-stock-text {
    color: #fd7e14;
}

.wc-mli-current-stock .wc-mli-section-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 13px;
}

.wc-mli-current-stock .wc-mli-section-label {
    color: #666;
}

.wc-mli-current-stock .wc-mli-section-value {
    font-weight: 500;
    color: #333;
}

/* Other stores compact display */
.wc-mli-other-stores-compact {
    margin-top: 10px;
    font-size: 13px;
}

.wc-mli-other-label {
    color: #28a745;
    font-weight: 500;
}

/* ===========================================
   SINGLE PRODUCT PAGE - MINIMAL STORE SELECTOR
   v1.0.7 - Nuclear override for WordPress blocks
   =========================================== */

/* Remove ALL backgrounds - maximum specificity override */
.single-product .wc-mli-location-selector-wrapper,
.single-product .wc-mli-location-selector-wrapper.wp-block-group,
.single-product .wc-mli-location-selector-wrapper.has-background,
.single-product .wc-mli-location-selector-wrapper.has-base-background-color,
.single-product .wp-block-group.wc-mli-location-selector-wrapper,
.wc-mli-location-selector-wrapper.wp-block-group.has-background,
.wc-mli-location-selector-wrapper.wp-block-group.has-base-background-color.has-background,
body.single-product .wc-mli-location-selector-wrapper,
body .wc-mli-location-selector-wrapper[class*="has-background"],
body .wc-mli-location-selector-wrapper[class*="has-base"] {
    background: transparent !important;
    background-color: transparent !important;
    --wp--preset--color--base: transparent !important;
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 16px 0 !important;
    box-shadow: none !important;
}

/* Title - simple */
.single-product .wc-mli-location-selector-wrapper h4,
.wc-mli-location-selector-wrapper h4.wp-block-heading {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

/* Location buttons container - simple list */
.single-product .wc-mli-location-buttons,
.wc-mli-location-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: 200px;
    overflow-y: auto;
}

/* Each location button - MINIMAL plain text with radio */
.single-product .wc-mli-location-button,
.wc-mli-location-button {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1px solid #e5e5e5 !important;
    border-radius: 0 !important;
    text-align: left !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #333 !important;
    box-shadow: none !important;
    transition: color 0.15s ease !important;
}

.single-product .wc-mli-location-button:last-child,
.wc-mli-location-button:last-child {
    border-bottom: none !important;
}

.single-product .wc-mli-location-button:hover,
.wc-mli-location-button:hover {
    color: #0073aa !important;
    background: transparent !important;
}

.single-product .wc-mli-location-button.is-active,
.wc-mli-location-button.is-active {
    color: #0073aa !important;
    font-weight: 600 !important;
    background: transparent !important;
}

/* Address in button */
.single-product .wc-mli-location-button .address,
.wc-mli-location-button .address {
    font-size: 13px !important;
    color: #888 !important;
    font-weight: 400 !important;
    margin-left: 4px !important;
}

/* Radio indicator - circle before each option */
.single-product .wc-mli-location-button::before,
.wc-mli-location-button::before {
    content: '' !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid #ccc !important;
    border-radius: 50% !important;
    background: transparent !important;
    transition: all 0.15s ease !important;
    flex-shrink: 0 !important;
}

.single-product .wc-mli-location-button:hover::before,
.wc-mli-location-button:hover::before {
    border-color: #0073aa !important;
}

.single-product .wc-mli-location-button.is-active::before,
.wc-mli-location-button.is-active::before {
    border-color: #0073aa !important;
    background: #0073aa !important;
    box-shadow: inset 0 0 0 3px #fff !important;
}

/* Use my location - minimal text link */
.single-product .wc-mli-detect-location-wrap,
.wc-mli-detect-location-wrap {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #e5e5e5 !important;
}

.single-product .wc-mli-detect-location,
.wc-mli-detect-location,
#wc-mli-detect-location {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: transparent !important;
    border: none !important;
    color: #0073aa !important;
    font-size: 13px !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.single-product .wc-mli-detect-location:hover,
.wc-mli-detect-location:hover,
#wc-mli-detect-location:hover {
    text-decoration: underline !important;
    background: transparent !important;
}

/* ===========================================
   SIMPLE SELECTED STORE DISPLAY
   v1.0.13 - Clean store display with change link
   =========================================== */

/* Container - minimal inline display */
.wc-mli-selected-store {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 0;
    margin: 12px 0;
    font-size: 14px;
}

/* Store info section */
.wc-mli-selected-store-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* "Your store:" label */
.wc-mli-selected-label {
    color: #666;
    font-weight: 400;
}

/* Store name - prominent */
.wc-mli-selected-name {
    color: #333;
    font-weight: 600;
}

/* Change store link */
.wc-mli-change-store-link,
#wc-mli-open-store-selector {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.wc-mli-change-store-link:hover,
#wc-mli-open-store-selector:hover {
    color: #005177;
    text-decoration: underline;
}

/* Responsive - stack on mobile */
@media screen and (max-width: 480px) {
    .wc-mli-selected-store {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ===========================================
   HEADER STORE SELECTOR
   Positioned next to the Kadence cart icon
   =========================================== */

.wc-mli-header-store {
    display: flex;
    align-items: center;
    margin-right: 12px;
}

.wc-mli-header-store-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: opacity 0.2s ease;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}

.wc-mli-header-store-trigger:hover {
    opacity: 0.7;
    text-decoration: none;
    color: inherit;
}

.wc-mli-header-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.wc-mli-header-store-name {
    font-weight: 500;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile: icon only */
@media screen and (max-width: 768px) {
    .wc-mli-header-store-name {
        display: none;
    }
    .wc-mli-header-store {
        margin-right: 8px;
    }
}
