/* Base styles remain the same */
.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: 8px;
    padding: 20px;
    margin-top: 20px;
    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 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.lsc-summary {
    background: #f0f7ff;
    border-left: 4px solid #0073aa;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

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

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

/* Individual stock cards */
.lsc-stock-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.lsc-stock-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Status indicator at top of card */
.lsc-card-status {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

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

/* 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-low-stock {
    border-color: #ff9800;
}

.lsc-stock-card.status-low-stock .lsc-card-status {
    background: #fff3e0;
    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;
}

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

.lsc-card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

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

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

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

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

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

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

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

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

.lsc-supplier-group h5 {
    margin: 20px 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #0073aa;
}

/* Stock on request */
.lsc-stock-on-request {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    border: 2px dashed #999;
}

.lsc-stock-on-request .lsc-request-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.lsc-stock-on-request {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

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

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

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

/* Compact mode for many variants */
@media (min-width: 769px) {
    .lsc-stock-grid:has(> :nth-child(10)) {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .lsc-stock-grid:has(> :nth-child(10)) .lsc-stock-card {
        font-size: 12px;
    }
    
    .lsc-stock-grid:has(> :nth-child(10)) .stock-number {
        font-size: 20px;
    }
}

/* 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;
}