/* B2B Partner Orders – Frontend CSS */
/* Design tokenek: #0A2240 (primary), #F28B2F (accent), #4E4E4E (text), #F0F0F0 (bg light) */

.b2b-wrap { max-width: 1300px; margin: 0 auto; padding: 20px 0; font-family: 'Noto Sans', 'Roboto', Arial, sans-serif; color: #4E4E4E; }

/* --- Alap kártya --- */
.b2b-card { background: #fff; border-radius: 20px; padding: 32px 28px; box-shadow: 0 8px 40px rgba(0,0,0,.09); border: 1px solid #E0E0E0; margin-bottom: 24px; }
.b2b-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.b2b-card-title { font-size: 28px; font-weight: 700; color: #0A2240; margin: 0 0 24px; }

/* --- Form alap --- */
.b2b-form-row { margin-bottom: 16px; }
.b2b-form-row label { display: block; font-size: 14px; font-weight: 600; color: #4E4E4E; margin-bottom: 6px; }
.b2b-req { color: #e53e3e; }

.b2b-wrap input[type="text"],
.b2b-wrap input[type="email"],
.b2b-wrap input[type="number"],
.b2b-wrap select,
.b2b-wrap textarea {
  width: 100%;
  height: 48px;
  border: 1px solid #E0E0E0;
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
  font-size: 15px;
  color: #1e2a36;
  box-sizing: border-box;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.b2b-wrap input:focus,
.b2b-wrap select:focus { border-color: #F28B2F; box-shadow: 0 0 0 3px rgba(242,139,47,.12); }
.b2b-wrap input[disabled] { background: #F0F0F0; color: #aaa; cursor: not-allowed; }

/* --- Grid --- */
.b2b-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.b2b-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 14px; }
.b2b-grid-order-line { display: grid; grid-template-columns: 1.8fr 0.5fr; gap: 14px; }

/* --- Checkbox --- */
.b2b-checkbox-label { display: flex !important; align-items: center; gap: 10px; cursor: pointer; margin: 4px 0; font-weight: 400 !important; }
.b2b-checkbox-label input[type="checkbox"] { width: 18px !important; height: 18px !important; }

/* --- Gombok --- */
.b2b-btn-primary, .b2b-btn-secondary, .b2b-btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  border-radius: 10px; transition: background .2s, color .2s;
  text-decoration: none;
}
.b2b-btn-primary  { background: #F28B2F; color: #fff; padding: 0 24px; min-height: 48px; font-size: 15px; }
.b2b-btn-primary:hover  { background: #0A2240; color: #fff; }
.b2b-btn-secondary { background: #0A2240; color: #fff; padding: 0 20px; min-height: 44px; font-size: 14px; }
.b2b-btn-secondary:hover { background: #1C1D1D; }
.b2b-btn-large { min-height: 54px; font-size: 17px; padding: 0 32px; width: 100%; }
.b2b-btn-sm { background: #F0F0F0; color: #0A2240; padding: 5px 12px; font-size: 12px; min-height: 0; border-radius: 6px; border: 1px solid #E0E0E0; }
.b2b-btn-sm:hover { background: #0A2240; color: #fff; }
.b2b-btn-edit   { background: #EBF4FF; color: #185FA5; border-color: #B5D4F4; }
.b2b-btn-delete { background: #FEF3F2; color: #B42318; border-color: #FECDCA; }
.b2b-btn-delete:hover { background: #B42318; color: #fff; }
.b2b-remove-line-btn { background: none; border: none; color: #B42318; font-size: 13px; cursor: pointer; padding: 4px 8px; font-family: inherit; }
.b2b-remove-line-btn:hover { text-decoration: underline; }

/* --- Üzenet sávok --- */
.b2b-message { padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; line-height: 1.5; }
.b2b-message a { font-weight: 700; }
.b2b-message-success { background: #ECFDF3; color: #027A48; border: 1px solid #ABEFC6; }
.b2b-message-error   { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }
.b2b-access-denied   { padding: 16px 20px; border-radius: 10px; background: #FEF3F2; border: 1px solid #FECDCA; color: #B42318; font-size: 14px; }

/* --- Keresődoboz --- */
.b2b-search-wrap { position: relative; }
.b2b-results { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #E0E0E0; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); z-index: 100; max-height: 280px; overflow-y: auto; }
.b2b-result-item { padding: 10px 14px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #F0F0F0; }
.b2b-result-item:last-child { border-bottom: none; }
.b2b-result-item:hover { background: #F0F0F0; }
.b2b-no-result { color: #aaa; cursor: default; }

/* --- Partner info badge --- */
.b2b-partner-info { margin-top: 8px; }
.b2b-partner-badge { display: inline-block; background: #ECFDF3; color: #027A48; border: 1px solid #ABEFC6; border-radius: 8px; padding: 6px 14px; font-size: 14px; }

/* --- Section label --- */
.b2b-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #F28B2F; margin-bottom: 10px; margin-top: 8px; padding-bottom: 6px; border-bottom: 1px solid #F0F0F0; }

/* --- Rendeléssor --- */
.b2b-order-line { background: #FAFAFA; border: 1px solid #E0E0E0; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.b2b-line-inner { }
.b2b-line-actions { text-align: right; margin-top: 8px; }
.b2b-product-name { margin-top: 6px; font-size: 13px; font-weight: 600; color: #0A2240; }
.b2b-qty-hint { margin-top: 6px; font-size: 12px; color: #888; }

/* --- Ár részletező --- */
.b2b-line-price-detail { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #E0E0E0; }
.b2b-price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.b2b-price-cell { background: #fff; border: 1px solid #E0E0E0; border-radius: 8px; padding: 8px 10px; }
.b2b-price-cell-hl { border-color: #F28B2F; background: #FFF8F0; }
.b2b-price-cell-total { border-color: #0A2240; background: #EBF4FF; }
.b2b-price-label { display: block; font-size: 10px; color: #888; margin-bottom: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.b2b-price-cell span:not(.b2b-price-label) { font-size: 14px; font-weight: 700; color: #0A2240; }
.b2b-price-cell-hl span:not(.b2b-price-label) { color: #F28B2F; }

/* --- Order layout --- */
.b2b-order-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.b2b-order-main { min-width: 0; }
.b2b-order-sidebar { position: sticky; top: 24px; }

/* --- Összegző kártya --- */
.b2b-summary-card { padding: 24px 20px; }
.b2b-summary-title { font-size: 18px; font-weight: 700; color: #0A2240; margin-bottom: 16px; }
.b2b-summary-lines { margin-bottom: 16px; max-height: 280px; overflow-y: auto; }
.b2b-summary-line-row { padding: 8px 0; border-bottom: 1px solid #F0F0F0; font-size: 13px; }
.b2b-sl-name  { display: block; font-weight: 600; color: #0A2240; }
.b2b-sl-qty   { display: inline; color: #888; font-size: 12px; }
.b2b-sl-price { display: block; color: #4E4E4E; margin-top: 2px; }
.b2b-summary-totals { border-top: 2px solid #E0E0E0; padding-top: 12px; }
.b2b-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #F0F0F0; font-size: 14px; }
.b2b-summary-row:last-child { border-bottom: none; }
.b2b-summary-grand { font-size: 16px; font-weight: 700; padding-top: 12px; margin-top: 4px; }
.b2b-summary-grand span { color: #0A2240; }
.b2b-summary-grand strong { color: #F28B2F; font-size: 20px; }

/* --- Táblázat (discount manager) --- */
.b2b-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.b2b-table th { text-align: left; padding: 10px 12px; background: #0A2240; color: #fff; font-size: 12px; font-weight: 700; }
.b2b-table td { padding: 10px 12px; border-bottom: 1px solid #F0F0F0; vertical-align: middle; }
.b2b-table tr:hover td { background: #FAFAFA; }
.b2b-loading { text-align: center; color: #aaa; padding: 24px; }

/* --- Modal --- */
.b2b-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.b2b-modal { background: #fff; border-radius: 16px; width: 560px; max-width: 96vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.b2b-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #E0E0E0; }
.b2b-modal-header h4 { font-size: 18px; font-weight: 700; color: #0A2240; margin: 0; }
.b2b-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #888; line-height: 1; padding: 0 4px; }
.b2b-modal-body   { padding: 24px; }
.b2b-modal-footer { padding: 16px 24px; border-top: 1px solid #E0E0E0; display: flex; justify-content: flex-end; gap: 10px; }

/* --- Reszponzív --- */
@media (max-width: 1024px) {
  .b2b-order-layout { grid-template-columns: 1fr; }
  .b2b-order-sidebar { position: static; }
}
@media (max-width: 767px) {
  .b2b-card { padding: 20px 16px; border-radius: 14px; }
  .b2b-card-title { font-size: 22px; }
  .b2b-grid-2, .b2b-grid-3, .b2b-grid-order-line { grid-template-columns: 1fr; }
  .b2b-price-grid { grid-template-columns: 1fr 1fr; }
  .b2b-card-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* --- Partner ár megjelenítés webshop frontenden --- */
.b2b-price-wrap { display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; }
.b2b-list-price-del { color:#aaa !important; font-size:0.9em; }
.b2b-list-price-del .woocommerce-Price-amount { color:#aaa !important; }
.b2b-partner-price-ins { text-decoration:none !important; }
.b2b-partner-price-ins .woocommerce-Price-amount { color:#F28B2F !important; font-weight:700; }
ins.b2b-partner-price-ins { text-decoration:none !important; }
.b2b-discount-badge {
  display:inline-block; background:#F28B2F; color:#fff;
  font-size:11px; font-weight:700; padding:2px 7px;
  border-radius:20px; line-height:1.5; white-space:nowrap;
}
/* Összesítő kedvezmény zöld */
#b2b-total-discount { color:#27ae60 !important; }
