.pbot {
  --pbot-bg: #f6f7f8;
  --pbot-panel: #fff;
  --pbot-ink: #1d2329;
  --pbot-muted: #66727d;
  --pbot-line: #dfe4e8;
  --pbot-soft: #eef1f3;
  --pbot-accent: #c9162e;
  --pbot-accent-dark: #9f1023;
  --pbot-yellow: #f5bc25;
  --pbot-blue: #276d96;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  color: var(--pbot-ink);
  font-family: Arial, Helvetica, sans-serif;
}

.pbot *,
.pbot *::before,
.pbot *::after {
  box-sizing: border-box;
}

.pbot button,
.pbot input,
.pbot select {
  font: inherit;
}

.pbot button {
  cursor: pointer;
}

.pbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 18px 22px;
  background: #20252b;
  color: #fff;
  border-radius: 8px;
}

.pbot__eyebrow {
  margin: 0 0 5px;
  color: var(--pbot-yellow);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pbot h2 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.pbot__customer {
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.pbot__customer span {
  color: #dce3e8;
  font-size: 12px;
}

.pbot__customer strong {
  color: #fff;
}

.pbot__notice {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #e7d38a;
  border-radius: 8px;
  background: #fff8df;
  color: #3d3320;
}

.pbot__notice strong {
  font-size: 14px;
}

.pbot__notice span {
  color: #5f5540;
  font-size: 13px;
  line-height: 1.4;
}

.pbot__toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 360px);
  gap: 14px;
  align-items: end;
  margin-bottom: 10px;
  padding: 14px;
  background: var(--pbot-panel);
  border: 1px solid var(--pbot-line);
  border-radius: 8px;
}

.pbot__search,
.pbot__select {
  display: grid;
  gap: 6px;
}

.pbot__search span,
.pbot__select span {
  color: var(--pbot-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pbot__search input,
.pbot__select select {
  height: 42px;
  border: 1px solid var(--pbot-line);
  border-radius: 6px;
  background: #fff;
  color: var(--pbot-ink);
  outline: none;
}

.pbot__search input {
  width: 100%;
  padding: 0 14px;
}

.pbot__select {
  min-width: 0;
}

.pbot__select select {
  width: 100%;
  padding: 0 36px 0 12px;
}

.pbot__search input:focus,
.pbot__select select:focus,
.pbot__qty input:focus {
  border-color: var(--pbot-accent);
  box-shadow: 0 0 0 3px rgba(201, 22, 46, 0.14);
}

.pbot__cartbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--pbot-panel);
  border: 1px solid var(--pbot-line);
  border-radius: 8px;
}

.pbot__cart-main {
  display: grid;
  gap: 3px;
}

.pbot__cart-main strong {
  font-size: 14px;
}

.pbot__cart-main span,
.pbot__cart-items {
  color: var(--pbot-muted);
  font-size: 13px;
}

.pbot__cart-items {
  display: flex;
  gap: 6px;
  overflow: hidden;
  flex-wrap: wrap;
}

.pbot__cart-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 260px;
  min-height: 28px;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid var(--pbot-line);
  border-radius: 999px;
  background: #f9fafb;
  color: var(--pbot-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pbot__cart-chip strong {
  color: var(--pbot-muted);
  font-size: 12px;
  font-weight: 700;
}

.pbot__cart-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.pbot__cart-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--pbot-accent);
  border-radius: 6px;
  color: var(--pbot-accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.pbot__cart-actions a:hover {
  background: var(--pbot-accent);
  color: #fff;
}

.pbot__workspace {
  display: block;
}

.pbot__table-wrap {
  overflow: auto;
  max-height: calc(100vh - 235px);
  min-height: 420px;
  background: var(--pbot-panel);
  border: 1px solid var(--pbot-line);
  border-radius: 8px;
}

.pbot__table {
  width: 100%;
  min-width: 980px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.pbot__table th,
.pbot__table td {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--pbot-line);
  text-align: left;
  vertical-align: middle;
}

.pbot__table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 44px;
  background: #f9fafb;
  color: #4f5a64;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pbot__table tbody tr:hover {
  background: #fff9e8;
}

.pbot__product-cell {
  display: grid;
  grid-template-columns: 54px minmax(260px, 1fr);
  gap: 10px;
  align-items: center;
}

.pbot[data-show-images="no"] .pbot__product-cell {
  grid-template-columns: minmax(260px, 1fr);
}

.pbot__thumb {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #f7f8f9;
  border: 1px solid var(--pbot-line);
  border-radius: 6px;
}

.pbot__product-name {
  display: block;
  width: fit-content;
  color: var(--pbot-ink);
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.pbot__product-name:hover {
  color: var(--pbot-accent);
  text-decoration: underline;
}

.pbot__sku,
.pbot__desc,
.pbot__stock {
  display: block;
  max-width: 520px;
  margin-top: 3px;
  color: var(--pbot-muted);
  font-size: 12px;
  line-height: 1.35;
}

.pbot__desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pbot__stock {
  color: #247a4d;
}

.pbot__category {
  width: 180px;
  color: #43505b;
  font-size: 13px;
}

.pbot__price {
  width: 112px;
  font-weight: 700;
}

.pbot__price.is-quote {
  color: var(--pbot-blue);
}

.pbot__qty {
  display: grid;
  grid-template-columns: 36px 58px 36px;
  width: 130px;
  border: 1px solid var(--pbot-line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.pbot__qty button {
  height: 38px;
  padding: 0;
  border: 0;
  background: var(--pbot-soft);
  color: var(--pbot-ink);
  font-weight: 700;
}

.pbot__qty input {
  width: 58px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  appearance: textfield;
}

.pbot__qty input::-webkit-outer-spin-button,
.pbot__qty input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.pbot__line-total {
  width: 118px;
  font-weight: 700;
}

.pbot__row-action {
  min-width: 78px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: var(--pbot-ink);
  color: #fff;
  font-weight: 700;
}

.pbot__row-action:hover:not(:disabled) {
  background: var(--pbot-accent);
}

.pbot__row-action:disabled {
  cursor: not-allowed;
  background: #d8dde2;
  color: #66727d;
}

.pbot__loading {
  height: 180px;
  color: var(--pbot-muted);
  text-align: center;
}

.pbot__status {
  margin: 0;
  padding: 10px 2px 0;
  color: var(--pbot-muted);
  font-size: 12px;
  line-height: 1.4;
}

.pbot__status[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .pbot__cartbar {
    grid-template-columns: 1fr;
  }

  .pbot__table-wrap {
    max-height: none;
  }
}

@media (max-width: 1040px) {
  .pbot__toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .pbot__header,
  .pbot__toolbar {
    grid-template-columns: 1fr;
  }

  .pbot__header {
    display: grid;
    align-items: stretch;
    padding: 16px;
  }

  .pbot h2 {
    font-size: 24px;
  }

  .pbot__customer {
    min-width: 0;
  }

  .pbot__cartbar {
    padding: 12px;
  }

  .pbot__cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pbot__cart-actions a {
    justify-content: center;
  }

  .pbot__table-wrap {
    min-height: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .pbot__table,
  .pbot__table tbody,
  .pbot__table tr,
  .pbot__table td {
    display: block;
    width: 100%;
  }

  .pbot__table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .pbot__table thead {
    display: none;
  }

  .pbot__table tbody {
    display: grid;
    gap: 10px;
  }

  .pbot__table tbody tr {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--pbot-line);
    border-radius: 8px;
    background: var(--pbot-panel);
  }

  .pbot__table tbody tr:hover {
    background: var(--pbot-panel);
  }

  .pbot__table td {
    padding: 0;
    border-bottom: 0;
  }

  .pbot__table td:not(.pbot__product-cell):not(.pbot__action-cell) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 30px;
  }

  .pbot__table td[data-label]::before {
    content: attr(data-label);
    color: var(--pbot-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .pbot__product-cell {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .pbot[data-show-images="no"] .pbot__product-cell {
    grid-template-columns: minmax(0, 1fr);
  }

  .pbot__thumb {
    width: 58px;
    height: 58px;
  }

  .pbot__product-name {
    width: auto;
  }

  .pbot__desc {
    white-space: normal;
  }

  .pbot__category,
  .pbot__price,
  .pbot__line-total {
    width: auto;
  }

  .pbot__qty {
    width: 124px;
    grid-template-columns: 34px 56px 34px;
  }

  .pbot__row-action {
    width: 100%;
    min-height: 42px;
  }
}
