/* ── Bulk RFQ Page Layout ────────────────────────────────────────────────── */

.gb-bulk-rfq-page__body {
  display: grid;
  gap: var(--gb-space-6);
  align-items: start;
}

@media (min-width: 1024px) {
  .gb-bulk-rfq-page__body {
    grid-template-columns: 1fr 340px;
  }
}

/* ── Bulk Row Editor ─────────────────────────────────────────────────────── */

.gb-bulk-editor__upload {
  margin-bottom: var(--gb-space-5);
}

.gb-bulk-editor__section-title {
  font-family: var(--gb-font-heading);
  font-size: var(--gb-text-lg);
  font-weight: 700;
  margin-bottom: var(--gb-space-3);
}

.gb-bulk-editor__template-links {
  display: flex;
  align-items: center;
  gap: var(--gb-space-2);
  margin-top: var(--gb-space-2);
  font-size: var(--gb-text-xs);
}

.gb-bulk-editor__csv-hint {
  font-family: var(--gb-font-mono);
  font-size: var(--gb-text-xs);
  background: var(--gb-color-bg);
  padding: 2px var(--gb-space-2);
  border-radius: var(--gb-radius-sm);
  border: 1px solid var(--gb-color-border);
}

/* ── Divider ─────────────────────────────────────────────────────────────── */

.gb-bulk-editor__divider {
  display: flex;
  align-items: center;
  gap: var(--gb-space-3);
  margin-block: var(--gb-space-5);
  color: var(--gb-color-muted);
  font-size: var(--gb-text-sm);
}

.gb-bulk-editor__divider::before,
.gb-bulk-editor__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--gb-color-border);
}

/* ── Rows section ────────────────────────────────────────────────────────── */

.gb-bulk-editor__rows-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gb-space-3);
  flex-wrap: wrap;
  margin-bottom: var(--gb-space-3);
}

.gb-bulk-editor__rows-actions {
  display: flex;
  gap: var(--gb-space-2);
}

/* ── Stats bar ───────────────────────────────────────────────────────────── */

.gb-bulk-editor__stats {
  display: flex;
  gap: var(--gb-space-4);
  padding: var(--gb-space-2) var(--gb-space-3);
  background: var(--gb-color-bg);
  border-radius: var(--gb-radius);
  border: 1px solid var(--gb-color-border);
  margin-bottom: var(--gb-space-3);
  font-size: var(--gb-text-sm);
}

.gb-bulk-stat--total     { color: var(--gb-color-text); font-weight: 600; }
.gb-bulk-stat--matched   { color: var(--gb-color-success); }
.gb-bulk-stat--unmatched { color: var(--gb-color-error); }

/* ── Bulk table ──────────────────────────────────────────────────────────── */

.gb-bulk-table {
  min-width: 700px;
}

.gb-bulk-row__sku        { width: 160px; }
.gb-bulk-row__description { min-width: 140px; }
.gb-bulk-row__qty        { width: 80px; }
.gb-bulk-row__unit       { width: 70px; }
.gb-bulk-row__notes      { min-width: 120px; }
.gb-bulk-row__match      { min-width: 180px; }

.gb-input--sm {
  font-size: var(--gb-text-sm);
  padding: var(--gb-space-1) var(--gb-space-2);
  min-height: 32px;
}

.gb-input--narrow { width: 64px; }

.gb-select--sm {
  font-size: var(--gb-text-sm);
  padding: var(--gb-space-1) var(--gb-space-2);
  min-height: 32px;
}

/* ── Match cell ──────────────────────────────────────────────────────────── */

.gb-match-cell {
  display: flex;
  align-items: center;
  gap: var(--gb-space-2);
  flex-wrap: wrap;
}

.gb-match-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: var(--gb-text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.gb-match-badge--exact { background: var(--gb-color-success); color: #fff; }
.gb-match-badge--fuzzy { background: var(--gb-color-warning); color: #fff; }
.gb-match-badge--none  { background: var(--gb-color-border); color: var(--gb-color-muted); }

.gb-match-name {
  font-size: var(--gb-text-xs);
  color: var(--gb-color-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gb-button--xs {
  font-size: var(--gb-text-xs);
  padding: 2px var(--gb-space-2);
  min-height: 24px;
}

/* ── Product search ──────────────────────────────────────────────────────── */

.gb-match-search {
  position: relative;
  width: 100%;
}

.gb-match-search__input {
  width: 100%;
}

.gb-match-search__results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  list-style: none;
  background: var(--gb-color-surface);
  border: 1px solid var(--gb-color-border);
  border-radius: var(--gb-radius);
  box-shadow: var(--gb-shadow-md);
  max-height: 200px;
  overflow-y: auto;
}

.gb-match-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gb-space-2);
  padding: var(--gb-space-2) var(--gb-space-3);
  cursor: pointer;
  font-size: var(--gb-text-sm);
  border-bottom: 1px solid var(--gb-color-border);
}

.gb-match-result:last-child { border-bottom: 0; }

.gb-match-result:hover {
  background: var(--gb-color-bg);
}

.gb-match-result__name { flex: 1; }

.gb-match-result__sku {
  font-family: var(--gb-font-mono);
  font-size: var(--gb-text-xs);
  color: var(--gb-color-muted);
}

/* ── Parse / form errors ─────────────────────────────────────────────────── */

.gb-bulk-parse-error {
  padding: var(--gb-space-3) var(--gb-space-4);
  background: var(--gb-color-error-bg);
  color: var(--gb-color-error);
  border: 1px solid var(--gb-color-error);
  border-radius: var(--gb-radius);
  font-size: var(--gb-text-sm);
  margin-top: var(--gb-space-3);
}

/* ── Loading state on dropzone ───────────────────────────────────────────── */

.gb-upload-dropzone.is-loading {
  opacity: 0.6;
  pointer-events: none;
}
