/**
 * Custom Product Listing Styles
 * Styling for the wholesale bulk order interface
 */

.zp-product-listing-container {
    max-width: 100%;
    margin: 20px 0;
}

/* Search and Filter Controls */
.zp-product-search-container {
    background-color #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-controls input[type="text"] {
    flex: 1;
    min-width: 250px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.search-controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #007cba;
    color: white;
}

.btn-primary:hover {
    background-color: #005a87;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.category-filter select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Bulk Actions */
.zp-bulk-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-success:hover:not(:disabled) {
    background-color: #218838;
}

.btn-success:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Loading States */
.loading-container {
    text-align: center;
    padding: 40px 20px;
    background-color #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.loading-container p {
    margin: 0;
    color: #6c757d;
    font-style: italic;
}

/* Products Table */
.products-table-container {
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color white;
}

.zp-products-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.zp-products-table th,
.zp-products-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.zp-products-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.zp-products-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Column Widths */
.select-col {
    width: 40px;
    text-align: center;
}

.thumbnail-col {
    width: 80px;
    text-align: center;
}

.product-col {
    min-width: 250px;
}

.sku-col {
    width: 120px;
}

.price-col {
    width: 120px;
}

.stock-col {
    width: 100px;
}

.qty-col {
    width: 100px;
}

/* Product Information */
.product-excerpt {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    line-height: 1.3;
}

/* Pricing */
.wholesale-price {
    font-weight: 600;
    color: #28a745;
    display: block;
}

.regular-price {
    font-size: 12px;
    color: #6c757d;
    text-decoration: line-through;
    display: block;
}

/* Stock Information */
.stock-quantity {
    color: #28a745;
    font-size: 12px;
}

.in-stock {
    color: #28a745;
    font-size: 12px;
    font-weight: 500;
}

/* Form Controls */
.quantity-input {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.quantity-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

input[type="checkbox"] {
    transform: scale(1.2);
    margin: 0;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 20px;
}

.btn-outline-primary {
    background-color: transparent;
    color: #007cba;
    border: 1px solid #007cba;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-outline-primary:hover {
    background-color: #007cba;
    color: white;
}

/* Messages */
.zp-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.btn-close {
    float: right;
    background-color transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

/* No Products Found */
.no-products-found {
    text-align: center;
    padding: 40px 20px;
    background-color #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.no-products-found p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
    }
    
    .search-controls input[type="text"] {
        min-width: auto;
        width: 100%;
    }
    
    .zp-bulk-actions {
        flex-direction: column;
    }
    
    .zp-bulk-actions button {
        width: 100%;
    }
    
    .products-table-container {
        font-size: 14px;
    }
    
    .zp-products-table th,
    .zp-products-table td {
        padding: 8px 4px;
    }
    
    .product-col {
        min-width: 200px;
    }
    
    .thumbnail-col {
        display: none;
    }
    
    .zp-products-table .thumbnail-col {
        display: none;
    }
}

@media (max-width: 576px) {
    .zp-product-listing-container {
        margin: 10px 0;
    }
    
    .zp-product-search-container {
        padding: 15px;
    }
    
    .products-table-container {
        font-size: 12px;
    }
    
    .quantity-input {
        width: 50px;
        font-size: 12px;
    }
    
    .product-excerpt {
        display: none;
    }
}

/* Accessibility Improvements */
.zp-products-table th {
    border-bottom: 2px solid #dee2e6;
}

.product-select:focus,
.quantity-input:focus,
input[type="checkbox"]:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Product thumbnails */
.zp-products-table .thumbnail-col img {
    max-width: 50px;
    height: auto;
    border-radius: 4px;
}

/* Selected row highlighting */
.product-row:has(.product-select:checked) {
    background-color: #e3f2fd !important;
}

.product-row:has(.product-select:checked) td {
    border-color: #2196f3;
}

/* Better spacing for mobile */
@media (max-width: 768px) {
    .zp-product-search-container {
        margin-bottom: 15px;
    }
    
    .zp-bulk-actions {
        margin-bottom: 15px;
    }
}