/**
 * Frontend styles for B2B Portal
 */

/* Warehouse Stock Tab */
.b2b-warehouse-stock {
    margin: 20px 0;
}

.b2b-stock-table {
    width: 100%;
    border-collapse: collapse;
}

.b2b-stock-table th,
.b2b-stock-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.b2b-stock-table th {
    background: #f7f7f7;
    font-weight: 600;
}

/* Quote Request Button */
.b2b-request-quote-btn {
    margin-top: 10px;
}

/* Quote Modal */
#b2b-quote-modal,
#b2b-quote-details-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

#b2b-quote-modal.active,
#b2b-quote-details-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.b2b-quote-modal-content,
.b2b-quote-details-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.b2b-quote-close,
.b2b-quote-details-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.b2b-quote-close:hover,
.b2b-quote-details-close:hover {
    color: #000;
}

#b2b-quote-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

#b2b-quote-form input,
#b2b-quote-form textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

#b2b-quote-details-modal .b2b-quote-details-meta {
    margin-bottom: 20px;
}

#b2b-quote-details-modal .b2b-quote-details-meta p {
    margin: 5px 0;
}

#b2b-quote-details-modal table.shop_table {
    width: 100%;
    margin-top: 10px;
}

/* CSV Upload */
.b2b-csv-upload-section {
    margin-bottom: 20px;
}

.b2b-csv-upload-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

/* CSV Upload Modal */
#b2b-csv-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: auto;
}

#b2b-csv-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.b2b-csv-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.b2b-csv-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.b2b-csv-close:hover {
    color: #000;
    background-color: #f0f0f0;
}

.b2b-csv-modal-content h2 {
    margin-top: 0;
    margin-bottom: 10px;
    padding-right: 40px;
}

.b2b-csv-modal-content > p {
    margin-bottom: 20px;
    color: #666;
}

.b2b-csv-form-group {
    margin-bottom: 20px;
}

.b2b-csv-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.b2b-csv-form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: border-color 0.2s;
}

.b2b-csv-form-group input[type="file"]:hover {
    border-color: #0073aa;
}

.b2b-csv-summary {
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f7ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
}

.b2b-csv-preview {
    margin-top: 10px;
}

.b2b-csv-preview strong {
    display: block;
    margin-bottom: 10px;
    color: #0073aa;
}

.b2b-csv-preview-list {
    max-height: 200px;
    overflow-y: auto;
}

.b2b-csv-preview-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    margin-bottom: 5px;
    background-color: #fff;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.b2b-csv-preview-pn {
    font-weight: 600;
    color: #333;
}

.b2b-csv-preview-qty {
    color: #666;
}

.b2b-csv-preview-more {
    padding: 8px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.b2b-csv-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.b2b-csv-form-actions .button {
    min-width: 120px;
}

#b2b-csv-result {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
}

#b2b-csv-result.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#b2b-csv-result.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.b2b-csv-errors {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.b2b-csv-errors ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.b2b-csv-errors li {
    margin-bottom: 5px;
    font-size: 0.9em;
}

/* Documents & Backorders */
.b2b-documents-filter {
    margin-bottom: 20px;
}

.b2b-documents-filter form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.b2b-backorder-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.b2b-backorder-item h3 {
    margin-top: 0;
}

/* Status badges */
.b2b-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: 600;
}

.b2b-status-pending {
    background: #ffc107;
    color: #fff;
}

.b2b-status-approved {
    background: #28a745;
    color: #fff;
}

.b2b-status-rejected {
    background: #dc3545;
    color: #fff;
}

.b2b-status-converted {
    background: #007bff;
    color: #fff;
}

/* Single Product Page Price Display */
.b2b-product-price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.b2b-product-price-wrapper .b2b-calculated-price {
    font-weight: 600;
    font-size: 1.25em;
    color: #1d2327;
}

.b2b-product-price-wrapper .b2b-calculated-price strong {
    margin-right: 6px;
}

.b2b-product-price-wrapper .b2b-regular-price {
    font-weight: 400;
    font-size: 1em;
    color: #666;
}

.b2b-product-price-wrapper .b2b-regular-price strong {
    margin-right: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .b2b-stock-table {
        font-size: 0.9em;
    }
    
    .b2b-stock-table th,
    .b2b-stock-table td {
        padding: 8px;
    }
    
    #b2b-csv-modal.active {
        padding: 10px;
    }
    
    .b2b-csv-modal-content {
        padding: 20px;
        max-height: 95vh;
    }
    
    .b2b-csv-form-actions {
        flex-direction: column;
    }
    
    .b2b-csv-form-actions .button {
        width: 100%;
    }
}

.woocommerce-page .ast-woocommerce-container div.product div.summary {
    width: 100% !important;
}
.wc-block-cart-item__image,
.wc-block-cart-items__header-image{
    display: none !important;
}
/* B2B Grouped Orders */
.b2b-orders-group {
    margin-bottom: 40px;
}

.b2b-orders-group:last-child {
    margin-bottom: 0;
}

.b2b-orders-group-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e1e1;
    color: #1d2327;
}

.b2b-orders-group .woocommerce-orders-table {
    margin-top: 0;
}