/* Base styles */
.lsc-availability-wrapper {
    margin: 20px 0;
}

.lsc-check-availability {
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.lsc-check-availability:hover {
    background: #005a87;
}

.lsc-check-availability:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results container */
.lsc-availability-results {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100% !important;
    max-width: 100% !important;
}

.lsc-loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Header and summary */
.lsc-stock-items h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid #0073aa;
    padding-bottom: 5px;
}

.lsc-summary {
    background: #f0f7ff;
    border-left: 3px solid #0073aa;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 3px;
}

.lsc-summary p {
    margin: 0;
    color: #333;
    font-size: 12px;
    font-weight: 500;
}

/* Single Variant Display - Clean and Simple */
.lsc-single-variant-display {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
}

.lsc-single-variant-display.status-in-stock {
    border-color: #4caf50;
    background: linear-gradient(to right, #f1f8f4 0%, #ffffff 100%);
}

.lsc-single-variant-display.status-low-stock {
    border-color: #ff9800;
    background: linear-gradient(to right, #fff8f0 0%, #ffffff 100%);
}

.lsc-single-variant-display.status-out-of-stock {
    border-color: #f44336;
    background: linear-gradient(to right, #fff5f5 0%, #ffffff 100%);
}

.lsc-variant-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

.lsc-variant-header .status-icon {
    font-size: 18px;
    font-weight: bold;
}

.lsc-variant-header .status-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

.lsc-variant-header .status-text {
    font-size: 14px;
    font-weight: 600;
}

.status-in-stock .lsc-variant-header {
    color: #2e7d32;
}

.status-in-stock .dashicons-yes-alt {
    color: #2e7d32;
}

.status-low-stock .lsc-variant-header {
    color: #f57c00;
}

.status-low-stock .dashicons-warning {
    color: #f57c00;
}

.status-out-of-stock .lsc-variant-header {
    color: #c62828;
}

.status-out-of-stock .dashicons-no-alt {
    color: #c62828;
}

.lsc-variant-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lsc-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
    text-align: right;
}

.detail-value strong {
    font-size: 16px;
    color: #000;
}

/* COMPACT Grid layout for cards */
.lsc-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

/* COMPACT stock cards */
.lsc-stock-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 0;
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
}

.lsc-stock-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* COMPACT Status indicator */
.lsc-card-status {
    padding: 4px 6px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 20px;
}

.status-icon {
    font-size: 11px;
    font-weight: bold;
}

.status-icon .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    vertical-align: middle;
}

/* Status-specific card styling */
.lsc-stock-card.status-in-stock {
    border-color: #4caf50;
}

.lsc-stock-card.status-in-stock .lsc-card-status {
    background: #e8f5e9;
    color: #2e7d32;
}

.lsc-stock-card.status-in-stock .dashicons-yes-alt {
    color: #2e7d32;
}

.lsc-stock-card.status-low-stock {
    border-color: #ff9800;
}

.lsc-stock-card.status-low-stock .lsc-card-status {
    background: #fff3e0;
    color: #f57c00;
}

.lsc-stock-card.status-low-stock .dashicons-warning {
    color: #f57c00;
}

.lsc-stock-card.status-out-of-stock {
    border-color: #f44336;
    opacity: 0.7;
}

.lsc-stock-card.status-out-of-stock .lsc-card-status {
    background: #ffebee;
    color: #c62828;
}

.lsc-stock-card.status-out-of-stock .dashicons-no-alt {
    color: #c62828;
}

/* COMPACT Card content */
.lsc-card-content {
    padding: 8px;
}

.lsc-card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
    line-height: 1.3;
}

.lsc-label {
    color: #666;
    font-weight: 500;
    font-size: 10px;
}

.lsc-value {
    color: #333;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
    font-size: 11px;
}

/* COMPACT Stock quantity display */
.lsc-card-stock {
    text-align: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e0e0e0;
}

.stock-number {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.stock-label {
    display: block;
    font-size: 9px;
    color: #666;
    margin-top: 2px;
}

/* Supplier info - SMALLER */
.lsc-card-supplier {
    text-align: center;
    font-size: 9px;
    color: #666;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e0e0e0;
}

/* Selected variation highlight */
.lsc-stock-card.selected-variation {
    border-color: #0073aa;
    background: #f0f7ff;
    border-width: 2px;
}

/* Supplier groups */
.lsc-supplier-group {
    margin-bottom: 20px;
}

.lsc-supplier-group h5 {
    margin: 15px 0 8px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 1px solid #0073aa;
}

/* Stock on request */
.lsc-stock-on-request {
    text-align: center;
    padding: 25px 15px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 6px;
    border: 2px dashed #999;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Error state */
.lsc-error {
    color: #721c24;
    padding: 12px;
    background: #f8d7da;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #f5c6cb;
    font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lsc-stock-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 6px;
    }
    
    .lsc-stock-card {
        font-size: 11px;
    }
    
    .stock-number {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .lsc-stock-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 5px;
    }
}

/* Ultra-compact mode for MANY variants (10+) */
.lsc-stock-grid:has(> :nth-child(10)) {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 6px;
}

.lsc-stock-grid:has(> :nth-child(10)) .lsc-card-status {
    font-size: 9px;
    padding: 3px 5px;
    min-height: 18px;
}

.lsc-stock-grid:has(> :nth-child(10)) .lsc-card-content {
    padding: 6px;
}

.lsc-stock-grid:has(> :nth-child(10)) .lsc-card-row {
    font-size: 10px;
    margin-bottom: 3px;
}

.lsc-stock-grid:has(> :nth-child(10)) .stock-number {
    font-size: 14px;
}

.lsc-stock-grid:has(> :nth-child(10)) .stock-label {
    font-size: 8px;
}

/* Extra compact for 20+ variants */
.lsc-stock-grid:has(> :nth-child(20)) {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 5px;
}

.lsc-stock-grid:has(> :nth-child(20)) .lsc-card-status {
    font-size: 8px;
    padding: 2px 4px;
}

.lsc-stock-grid:has(> :nth-child(20)) .lsc-card-content {
    padding: 5px;
}

.lsc-stock-grid:has(> :nth-child(20)) .stock-number {
    font-size: 13px;
}

/* Elementor specific */
.elementor-widget-live_stock_checker .lsc-check-availability {
    display: inline-block;
}

.elementor-widget-live_stock_checker .lsc-availability-results {
    width: 100% !important;
}

/* Override any Elementor constraints */
.elementor-widget-container .lsc-stock-grid {
    width: 100% !important;
    max-width: 100% !important;
}