/* Bulk Orders System Styles */

#bulk-orders-system {
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bulk-orders-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.bulk-orders-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 700;
}

.bulk-orders-header p {
    margin: 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.bulk-orders-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    margin-bottom: 40px;
}


/* Categories Sidebar */

.categories-sidebar {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.categories-header h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.categories-list {
    max-height: 600px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.category-item.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.category-name {
    font-weight: 500;
    font-size: 12px;
}

.product-count {
    font-size: 0.85em;
    opacity: 0.7;
}


/* Products Main */

.products-main {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f8f9fa;
}

#current-category-name {
    margin: 0;
    color: #333;
    font-size: 1em;
    font-weight: 600;
}

.search-box {
    flex: 0 0 300px;
}

#product-search {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#product-search:focus {
    outline: none;
    border-color: #667eea;
}

.no-category-selected,
.loading-products,
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 12px;
}


/* Products List Layout */

.products-list-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    gap: 15px;
}

.product-list-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.product-list-image {
    flex: 0 0 80px;
}

.product-list-image img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
}

.product-list-info {
    flex: 1;
}

.product-list-name {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 13px;
    font-weight: 700;
}

.product-list-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 8px;
}

.product-list-price {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1em;
}

.product-list-stock {
    font-size: 0.85em;
    padding: 3px 8px;
    border-radius: 10px;
}

.product-list-stock.in-stock {
    background: #d4edda;
    color: #155724;
}

.product-list-stock.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.product-list-sku {
    font-size: 0.85em;
    color: #6c757d;
}

.product-list-desc {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 0;
}

.product-list-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.qty-btn:hover {
    background: #f8f9fa;
}

.product-list-item .quantity-input {
    width: 60px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.add-to-summary {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    min-width: 80px;
}

.add-to-summary:hover {
    background: #5a6fd8;
}

.add-to-summary.added {
    background: #28a745;
}

.add-to-summary.added:hover {
    background: #218838;
}

.product-image {
    text-align: center;
    margin-bottom: 15px;
}

.product-image img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
}

.product-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1em;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
}

.product-price {
    font-size: 1.2em;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 8px;
}

.stock-status {
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 8px;
}

.stock-status.in-stock {
    background: #d4edda;
    color: #155724;
}

.stock-status.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.product-sku {
    font-size: 0.8em;
    color: #6c757d;
    margin-bottom: 10px;
}


/* Quantity Controls */

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.qty-btn:hover {
    background: #f8f9fa;
}

.quantity-input {
    width: 50px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.add-to-summary {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-to-summary:hover {
    background: #5a6fd8;
}

.add-to-summary.added {
    background: #28a745;
}

.add-to-summary.added:hover {
    background: #218838;
}


/* Order Summary */

.order-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.summary-header h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.summary-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.empty-summary {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.item-details {
    display: flex;
    gap: 10px;
    font-size: 0.8em;
    color: #666;
}

.item-price,
.item-quantity,
.item-total {
    white-space: nowrap;
}

.remove-item {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.remove-item:hover {
    background: #c82333;
}

.summary-total {
    border-top: 2px solid #dee2e6;
    padding-top: 15px;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.2em;
}

.total-amount {
    color: #28a745;
}

.summary-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}


/* Modal Styles */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.customer-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}


/* Responsive Design */

@media (max-width: 1200px) {
    .bulk-orders-layout {
        grid-template-columns: 1fr;
    }
    .categories-sidebar,
    .order-summary {
        position: static;
    }
    .categories-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
        max-height: none;
    }
    .category-item {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    .search-box {
        flex: none;
    }
    .bulk-orders-header h1 {
        font-size: 2em;
    }
    .summary-actions {
        flex-direction: column;
    }
}


/* Cart button states */

#add-to-cart:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

#add-to-cart:disabled:hover {
    background: #6c757d;
    transform: none;
}

.cart-icon {
    margin-right: 5px;
}


/* Loading state */

.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}

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

.quotation-actions {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.btn-primary {
    background: #007cba;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
}

.add-to-quotation.added {
    background: #28a745;
}

#quotation-actions {
    text-align: center;
}


/* WordPress-style notifications */

.bo-notification {
    position: fixed;
    margin: 15px 0;
    padding: 12px 15px;
    border-radius: 4px;
    border-left: 4px solid;
    background: #e9f6e2;
    color: #000;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
    z-index: 1000;
    right: 30px;
    top: 100px;
}

.bo-notification.alert-success {
    border-left-color: #46b450;
    background: #f7f7f7;
}

.bo-notification.alert-error {
    border-left-color: #dc3232;
    background: #f7f7f7;
}

.alert-icon {
    font-weight: bold;
    margin-right: 10px;
}

.alert-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

.alert-close:hover {
    color: #000;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* new css */

.category-item:hover {
    background-color: #f8f9fa;
}

.category-item.active {
    background-color: #4A90E2;
    color: white;
}

.toggle-arrow {
    display: inline-block;
    width: 20px;
    cursor: pointer;
    font-size: 10px;
    color: #888;
}

.category-children {
    border-left: 1px dashed #ddd;
    /* Visual guide for hierarchy */
    margin-left: 10px;
}