/* استایل کلی */
.qof-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* جستجو */
.qof-search-box {
    position: relative;
    margin-bottom: 30px;
}

.qof-search-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.qof-search-input:focus {
    border-color: #007cba;
}

/* نتایج جستجو */
.qof-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.qof-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.qof-result-item:hover {
    background-color: #f8f9fa;
}

.qof-result-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-left: 10px;
}

.qof-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.qof-result-info {
    flex-grow: 1;
}

.qof-result-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 14px;
}

.qof-result-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.qof-price {
    color: #27ae60;
    font-weight: bold;
}

.qof-sku {
    color: #7f8c8d;
}

.qof-stock.instock {
    color: #27ae60;
}

.qof-stock.outofstock {
    color: #e74c3c;
}

.qof-add-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.qof-add-btn:hover {
    background: #005a87;
}

/* لیست محصولات انتخاب شده */
.qof-selected-products {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.qof-selected-products h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.qof-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.5fr;
    gap: 10px;
    padding: 10px;
    background: #e9ecef;
    border-radius: 4px;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
}

.qof-items-list {
    min-height: 100px;
}

.qof-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.5fr;
    gap: 10px;
    padding: 15px 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 8px;
    align-items: center;
    border: 1px solid #eee;
}

.qof-item:hover {
    border-color: #007cba;
}

.qof-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qof-qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qof-qty-btn:hover {
    background: #f8f9fa;
}

.qof-qty-input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.qof-item-price {
    color: #27ae60;
    font-weight: bold;
}

.qof-remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.qof-remove-btn:hover {
    background: #c0392b;
}

/* دکمه‌های عملیات */
.qof-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.qof-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qof-btn-primary {
    background: #007cba;
    color: white;
}

.qof-btn-primary:hover {
    background: #005a87;
}

.qof-btn-secondary {
    background: #6c757d;
    color: white;
}

.qof-btn-secondary:hover {
    background: #545b62;
}

.qof-btn-success {
    background: #28a745;
    color: white;
}

.qof-btn-success:hover {
    background: #218838;
}

/* استایل‌های کمکی */
.qof-loading, .qof-no-results, .qof-error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.qof-empty-list {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* واکنشگرایی */
@media (max-width: 768px) {
    .qof-list-header,
    .qof-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .qof-list-header span {
        display: none;
    }
    
    .qof-actions {
        flex-direction: column;
    }
    
    .qof-btn {
        width: 100%;
    }
}