/* Popup B2B */
.b2b-popup { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.6); z-index:9999; }
.b2b-popup-content { background:white; max-width:1000px; margin:60px auto; padding:20px; position:relative; border-radius:6px; max-height:90vh; overflow:auto; font-family:Arial; }
.b2b-close { position:fixed; top:20px; right:30px; font-size:28px; cursor:pointer; z-index:10000; background:#fff; border-radius:50%; border:2px solid #ccc; width:40px; height:40px; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(0,0,0,0.1); }
.b2b-table { width:100%; border-collapse:collapse; font-family:Arial; margin-bottom:10px; }
.b2b-table th, .b2b-table td { border:1px solid #ccc; padding:8px; text-align:left; vertical-align: middle; }
.b2b-status.responded { border:1px solid #2ecc71; color:#2ecc71; padding:2px 6px; border-radius:4px; }
.b2b-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    min-width: 90px;
    text-align: center;
}
.b2b-status.pending {
    background: #fff3cd;
    color: #856404;
}
.b2b-status.received {
    background: #cce5ff;
    color: #004085;
}
.b2b-status.preparing {
    background: #d4edda;
    color: #155724;
}
.b2b-status.shipping {
    background: #e2e3e5;
    color: #383d41;
}
.b2b-status.completed {
    background: #d1e7dd;
    color: #0f5132;
}
.b2b-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}
td[contenteditable] { background:#fefefe; outline:none; min-width:60px; }
.b2b-btn-group button {
    padding: 8px 16px;
    margin-right: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.b2b-btn-send { background-color: #2ecc71; color: white; }
.b2b-btn-draft { background-color: #f39c12; color: white; }
.b2b-response-message {
    background: #f4f4f4;
    border-left: 4px solid #f39c12;
    margin-bottom: 15px;
    padding: 8px 12px;
    font-style: italic;
    white-space: pre-line;
    max-height: 160px;
    overflow-y: auto;
    font-family: monospace;
}
.b2b-table img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}
/* Modal thành công */
#b2b-success-modal {
    display:none; position:fixed; top:0; left:0; width:100vw; height:100vh; background:rgba(0,0,0,0.4); z-index:10001;
}
#b2b-success-modal .modal-content {
    background:#fff; padding:30px 40px; border-radius:8px; box-shadow:0 2px 16px rgba(0,0,0,0.15); font-size:20px; color:#2ecc71; text-align:center; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
}
/* Logo download link */
.b2b-logo-link {
    display: inline-block;
    margin-top: 5px;
}
.b2b-logo-link img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border: 1px solid #ddd;
    padding: 5px;
    background: #fff;
}
/* Attachment icon */
.b2b-attachment {
    font-size: 20px;
    text-decoration: none;
    color: #666;
}
.b2b-attachment:hover {
    color: #333;
}

/* B2B Management Plugin Styles */

/* Custom Checkout Buttons */
.b2b-custom-links {
    margin-top: 10px;
}

.b2b-custom-links .button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin-bottom: 5px;
}

.b2b-custom-links .button:last-child {
    margin-bottom: 0;
}

.b2b-custom-links .button:hover {
    opacity: 0.8;
}

/* Mini Cart Custom Styles */
.b2b-mini-cart-wrapper {
    max-width: 400px;
    margin: 0 auto;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.b2b-empty-cart {
    text-align: center;
    padding: 20px;
}

.b2b-cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.b2b-cart-item:last-child {
    border-bottom: none;
}

.b2b-cart-item-image {
    margin-right: 15px;
    flex-shrink: 0;
}

.b2b-cart-item-image img {
    border-radius: 4px;
}

.b2b-cart-item-details {
    flex: 1;
}

.b2b-cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.b2b-cart-item-details p {
    margin: 2px 0;
    font-size: 12px;
    color: #666;
}

.b2b-cart-total {
    text-align: right;
    margin: 15px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    font-weight: 600;
}

.b2b-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.b2b-cart-actions .button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.b2b-cart-actions .button:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .b2b-mini-cart-wrapper {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .b2b-cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .b2b-cart-item-image {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Form Styles */
.b2b-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.b2b-form-group {
    margin-bottom: 20px;
}

.b2b-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.b2b-form-group input,
.b2b-form-group textarea,
.b2b-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.b2b-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.b2b-submit-btn {
    background-color: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.b2b-submit-btn:hover {
    background-color: #005a87;
}

/* Success Message */
.b2b-success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    margin-bottom: 20px;
}

/* Error Message */
.b2b-error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
}

/* Thêm style cho bảng responsive, popup, trạng thái, icon, toast, loading spinner, nút thao tác, xác nhận xóa, mobile friendly */
/* ... existing code ... */

.b2b-icon-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #b30059;
  font-size: 18px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
}
.b2b-icon-btn:hover {
  background: #f7e6f2;
  color: #d6006d;
}
.b2b-icon-attach {
  color: #007cba;
  font-size: 18px;
  margin-left: 2px;
  display: flex;
  align-items: center;
}
@media (max-width: 600px) {
  .b2b-orders-table td, .b2b-orders-table th {
    padding: 6px 4px;
    font-size: 13px;
  }
  .b2b-icon-btn, .b2b-icon-attach {
    font-size: 16px;
  }
}

/* Toast notification */
.b2b-toast {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 99999;
  background: #222;
  color: #fff;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  opacity: 0.95;
  animation: b2b-toast-in 0.3s;
}
.b2b-toast-success { background: #28a745; }
.b2b-toast-error { background: #dc3545; }
@keyframes b2b-toast-in { from { opacity: 0; transform: translateY(-20px);} to { opacity: 0.95; transform: none; } }

/* Loading spinner */
.b2b-loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #b30059;
  border-radius: 50%;
  animation: b2b-spin 1s linear infinite;
  margin: 0 auto;
}
@keyframes b2b-spin { 100% { transform: rotate(360deg); } }

/* Xác nhận xóa popup */
.b2b-confirm-modal {
  position: fixed;
  z-index: 10000;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
}
.b2b-confirm-box {
  background: #fff;
  padding: 30px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
  min-width: 280px;
  text-align: center;
}
.b2b-confirm-box button {
  margin: 0 10px;
  padding: 8px 18px;
  border-radius: 4px;
  border: none;
  font-weight: 500;
  cursor: pointer;
}
.b2b-confirm-yes { background: #d6006d; color: #fff; }
.b2b-confirm-no { background: #eee; color: #333; }
.b2b-confirm-yes:hover { background: #b30059; }
.b2b-confirm-no:hover { background: #ccc; }

/* Responsive bảng đơn hàng */
.b2b-orders-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.b2b-orders-table th, .b2b-orders-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
}
.b2b-orders-table th {
  background: #f7f7f7;
  font-weight: bold;
  color: #333;
}
.b2b-orders-table tr:last-child td {
  border-bottom: none;
}
@media (max-width: 700px) {
  .b2b-orders-table, .b2b-orders-table thead, .b2b-orders-table tbody, .b2b-orders-table th, .b2b-orders-table td, .b2b-orders-table tr {
    display: block;
  }
  .b2b-orders-table thead tr { display: none; }
  .b2b-orders-table tr { margin-bottom: 18px; background: #fff; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,0.04); }
  .b2b-orders-table td {
    padding: 10px 8px;
    border: none;
    position: relative;
    font-size: 15px;
  }
  .b2b-orders-table td:before {
    content: attr(data-label);
    font-weight: bold;
    color: #888;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
  }
}

/* Popup đơn hàng */
.b2b-popup {
  position: fixed; z-index: 9999; left: 0; top: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center;
}
.b2b-popup-content {
  background: #fff; padding: 30px; border-radius: 8px; min-width: 350px; max-width: 95vw; position: relative; box-shadow: 0 2px 16px rgba(0,0,0,0.13);
}
.b2b-close {
  position: absolute; right: 15px; top: 10px; font-size: 28px; cursor: pointer; color: #888;
}
.b2b-close:hover { color: #d00; }

/* Nút icon thao tác */
.b2b-icon-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #b30059;
  font-size: 18px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
}
.b2b-icon-btn:hover {
  background: #f7e6f2;
  color: #d6006d;
}
.b2b-icon-attach {
  color: #007cba;
  font-size: 18px;
  margin-left: 2px;
  display: flex;
  align-items: center;
}
@media (max-width: 600px) {
  .b2b-orders-table td, .b2b-orders-table th {
    padding: 6px 4px;
    font-size: 13px;
  }
  .b2b-icon-btn, .b2b-icon-attach {
    font-size: 16px;
  }
}

.b2b-error-tooltip {
  color: #dc3545;
  font-size: 13px;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
}
.b2b-error-input {
  border-color: #dc3545 !important;
  background: #fff6f6 !important;
}

body.b2b-popup-open {
  overflow: hidden !important;
  position: relative !important;
  width: 100vw !important;
}

body.customer .b2b-btn-update-order {
  display: none !important;
} 