/* ══════════════════════════════════════════════════════════════════════════════
   MTG BULK — Bulk page
   ══════════════════════════════════════════════════════════════════════════════ */

.mtg-bulk-upload-layout {
  margin: 0;
  padding: 0;
  background-color: var(--lightEggshell);
  padding-bottom: 20px;
  font-family: var(--font-sans);
}

/*─────────────────────── Main Header ──────────────────────────*/
.mtg-bulk-header {
  flex: 1;
  background-color: var(--white);
  padding: calc(var(--spacing) * 4);
  padding-inline: calc(var(--spacing) * 30);
  margin-inline: auto;
  min-height: 100px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 20px;
  position: sticky;
  top: 130px;
  z-index: 49;
}

.mtg-bulk-header-left,
.mtg-bulk-header-right {
  display: flex;

  gap: 12px;
  height: auto;
  flex-direction: column;
}

.mtg-bulk-header-left {
  flex: 3;
  align-items: baseline;
  justify-content: space-between;
}

.mtg-bulk-header-right {
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  display: none; /*if you want to see the 'bulk test upload' - remove this */
}

.mtg-bulk-header-btn-back {
  color: var(--darkBrown);
  background: none;
  font-weight: var(--font-weight-medium);
  font-size: 14px;
  gap: 5px;
  cursor: pointer;
}
.mtg-bulk-header-btn-back:hover {
  color: var(--lightBrown);
}
.mtg-bulk-header-btn-icon {
  color: var(--darkBrown);
}

.mtg-bulk-header-title {
  color: var(--foreground);
  font-weight: var(--font-weight-semibold);
  font-size: 24px;
  font-family: var(--font-serif);
}

.mtg-bulk-header-subtitle {
  color: var(--muted-foreground);
  font-size: 14px;
  margin-top: 0.25rem;
}

.mtg-bulk-header-btn-test {
  background-color: var(--color-purple-100);
  color: var(--color-purple-700);
  font-weight: var(--font-weight-medium);
  font-size: 14px;
  padding: 0.25rem;
  border-radius: 6px;
  gap: 0.3rem;
  align-items: center;
  display: flex;
  cursor: pointer;

  gap: calc(var(--spacing) * 2);
  padding-block: calc(var(--spacing) * 2);
  padding-inline: calc(var(--spacing) * 3);
}
.mtg-bulk-header-btn-test:hover {
  background-color: var(--color-purple-200);
}

.bi-bug {
  color: var(--color-purple-700);
  font-size: 15px;
}

/*─────────────────────── Main Sections ──────────────────────────*/
.mtg-bulk-main {
  margin-inline: calc(var(--spacing) * 30);
  margin-block: calc(var(--spacing) * 8);
  background-color: var(--white);
  border-radius: 6px;
}

.mtg-bulk-main-title {
  font-size: 17px;
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-serif);
  color: var(--foreground);
  padding-block: calc(var(--spacing) * 4);
  padding-inline: calc(var(--spacing) * 6);
  align-items: center;
  border-bottom: 1px solid var(--lightEggshell);
}
.mtg-bulk-main-section {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--foreground);
  padding-block: calc(var(--spacing) * 4);
  padding-inline: calc(var(--spacing) * 6);
  align-items: start;
  border-bottom: 1px solid var(--lightEggshell);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mtg-bulk-main-section-title {
  text-transform: uppercase;
  font-weight: var(--font-weight-medium);
  font-size: 12px;
  color: var(--muted-foreground);
}

.mtg-bulk-main-section-subtitle {
  color: var(--muted-foreground);
  font-size: 13px;
  margin-top: calc(var(--spacing) * -3);
  font-weight: 100;
}

/* Text Section Specific */

.mtg-bulk-main-section-text-subtitles {
  color: var(--foreground);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
}

.mtg-bulk-main-section-subtitle-cards {
  background-color: var(--lightEggshell);
  font-weight: 100;
  font-family: var(--font-mono);
  padding-block: calc(var(--spacing) * 0.5);
  padding-inline: calc(var(--spacing) * 1.5);
  font-size: 11px;
  border-radius: 0.25rem;
}

.mtg-bulk-main-section-text-field {
  font-size: 13px;
  font-family: var(--font-mono);
  padding-block: calc(var(--spacing) * 3);
  padding-inline: calc(var(--spacing) * 4);
  background-color: var(--input-background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  width: -moz-available;
  width: -webkit-fill-available;
  width: stretch;
  height: calc(var(--spacing) * 64);
}

.mtg-bulk-main-section-text-field textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: var(--font-weight-medium);
  color: #333;
  padding: 16px 20px;
  box-sizing: border-box;
  line-height: 1.7;
}

.mtg-bulk-main-section-text-field textarea::placeholder {
  color: #aaa;
  line-height: 1.7;
}

/* Details Section Specific */

.mtg-bulk-main-section-condFoil {
  display: flex;
  margin-top: 10px;
  align-content: center;
  width: 100%;
  height: 40px;
  gap: 10px;
}

.mtg-bulk-main-section-cond {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  height: 100%;
}

.mtg-bulk-main-section-cond-select {
  width: 100%;
  height: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  background: var(--input-background);
  color: #555;
  cursor: pointer;
}
.mtg-bulk-main-section-cond-select:focus {
  outline: none;
  border-color: var(--darkBrown);
}

.mtg-bulk-main-section-foil {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  width: 50px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: var(--input-background);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
  user-select: none;
}

.mtg-bulk-main-section-foil input {
  display: none;
}
.mtg-bulk-main-section-foil:has(input:checked) {
  background: #fef9e7;
  border-color: #c9a84c;
  color: #8a6010;
  font-weight: var(--font-weight-semibold);
}

/* CSV Import Section Specific */
.mtg-bulk-main-section-btn-processCards,
.mtg-bulk-main-section-btn-csvImport {
  display: flex;
  width: -moz-available;
  width: -webkit-fill-available;
  width: stretch;
  padding-block: calc(var(--spacing) * 3);
  padding-inline: calc(var(--spacing) * 4);
  color: #555;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  background: var(--input-background);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.mtg-bulk-main-section-btn-csvImport:hover {
  background-color: var(--input-background-hover);
}
.mtg-bulk-main-section-btn-processCards {
  color: #363636;
  font-weight: var(--font-weight-semibold);
  background: var(--yellow);
}

.mtg-bulk-main-section-btn-processCards:disabled {
  background: var(--input-background);
  font-weight: var(--font-weight-medium);
  cursor: not-allowed;
}

.mtg-bulk-main-section-btn-processCards:not(:disabled):hover {
  background: var(--yellow-hover);
}

/*─────────────────────── Bulk Match ──────────────────────────*/
.mtg-bulk-match-title {
  font-size: 17px;
  font-weight: var(--font-weight-semibold);
  color: var(--foreground);
  padding-block: calc(var(--spacing) * 4) 0;
  padding-inline: calc(var(--spacing) * 6);
  align-items: center;
  font-family: var(--font-serif);
}

.mtg-bulk-match-header-btnGroup {
  width: -moz-available;
  width: -webkit-fill-available;
  width: stretch;
  padding-block: 0 calc(var(--spacing) * 4);
  padding-inline: calc(var(--spacing) * 6);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  display: grid;
  gap: calc(var(--spacing) * 3);
  margin-bottom: calc(var(--spacing) * 5);
}

.mtg-bulk-match-header-btn {
  text-transform: uppercase;
  text-align: left;
  border: 1px solid transparent;
  padding-block: calc(var(--spacing) * 3);
  padding-inline: calc(var(--spacing) * 4);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.mtg-bulk-match-header-btn-title {
  font-weight: var(--font-weight-medium);
  font-size: 10px;
  margin-bottom: calc(var(--spacing) * 3);
}
.mtg-bulk-match-header-btn-title-nr {
  font-weight: var(--font-weight-bold);
  font-size: 20px;
}

.mtg-bulk-match-header-btn--total {
  background-color: color-mix(in oklab, var(--muted) 30%, transparent);
  border-color: var(--border);
  color: var(--muted-foreground);
}

.mtg-bulk-match-header-btn--inventory {
  background-color: var(--color-green-50);
  border-color: var(--color-green-200);
  color: var(--color-green-700);
}

.mtg-bulk-match-header-btn--notFound {
  background-color: var(--color-red-50);
  border-color: var(--color-red-200);
  color: var(--destructive);
}

.mtg-bulk-match-header-addToSell {
  background-color: var(--yellow);
  color: var(--accent-foreground);
  font-weight: var(--font-weight-semibold);
  font-size: 14px;
  padding-block: calc(var(--spacing) * 3);
  border-radius: calc(var(--radius) - 2px);
  border: none;
  gap: calc(var(--spacing) * 2);
  justify-content: center;
  align-items: center;
  width: -moz-available;
  width: -webkit-fill-available;
  width: stretch;
}

.mtg-bulk-match-header-addToSell:hover {
  background-color: var(--yellow-hover);
}

.mtg-bulk-match-header-addToSell--added {
  background-color: var(--color-green-200);
}

/* Matches List */
.mtg-bulk-match-list {
  padding-block: calc(var(--spacing) * 4);
  padding-inline: calc(var(--spacing) * 6);
  border-bottom: 100px;
  display: flex;
  gap: calc(var(--spacing) * 4);
  flex-direction: column;
}

/* Items */

.mtg-bulk-match-item {
  border: 1px solid var(--border);
  padding: calc(var(--spacing) * 4);
  border-radius: var(--radius);
  gap: calc(var(--spacing) * 4);
  display: flex;
  align-items: center;
  background-color: transparent;
}

.mtg-bulk-match-item:hover {
  border-color: var(--yellow);
}

.mtg-bulk-match-item--notFound {
  background-color: var(--color-red-50);
  border-color: var(--color-red-200);
}

.mtg-bulk-match-item-successIcon {
  width: 32px;
  height: 32px;
  background-color: var(--color-green-100);
  color: var(--color-green-600);
  justify-content: center;
  align-items: center;
  border-radius: calc(infinity * 1px);
  display: flex;
  padding: 5px;
}

.mtg-bulk-match-item-successIcon--notFound {
  background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

.mtg-bulk-match-item-cardImg {
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  max-width: 75px;
}

.mtg-bulk-match-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  padding: 25px 10px;
  gap: calc(var(--spacing) * 2);
}
.mtg-bulk-match-item-title-group {
  display: flex;
  align-items: center;
  gap: var(--spacing);
}
.mtg-bulk-match-item-count {
  color: var(--muted-foreground);
  font-weight: var(--font-weight-semibold);
  padding-block: calc(var(--spacing) * 0.5);
  padding-inline: calc(var(--spacing) * 2);
  background-color: #efebe3;
  font-size: 12px;
  border-radius: calc(var(--radius) * 0.5);
}

.mtg-bulk-match-item-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-foreground);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-serif);
}

.mtg-bulk-match-item-subtitle {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.mtg-bulk-match-item-subtitle--notFound {
  color: var(--destructive);
  font-size: 11px;
}

.mtg-bulk-match-item-priceGroup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mtg-bulk-match-item-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--darkBrown);
  line-height: 1.1;
}

.mtg-bulk-match-item-price-market {
  font-size: 12px;
  color: #aaa;
}

.mtg-bulk-match-item-price-none {
  font-size: 12px;
  color: #c0392b;
  font-weight: 500;
}

.mtg-bulk-match-item-price-none a {
  color: #c0392b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mtg-bulk-match-item-addCart {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing);
  padding: 11px 14px;
  border-radius: 8px;
  border: none;
  width: fit-content;
  background: var(--yellow);
  color: #333;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  white-space: nowrap;
}
.mtg-bulk-match-item-addCart:not(:disabled):hover {
  background: #b8973b;
}

.mtg-bulk-match-item-addCart--added {
  background: var(--color-green-100);
  color: var(--color-green-700);
}
/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .mtg-bulk-header {
    flex-direction: column;
    padding-inline: calc(var(--spacing) * 10);
    top: var(--mtg-sticky-top);
  }
  .mtg-bulk-header-subtitle,
  .mtg-bulk-header-left,
  .mtg-bulk-header-right {
    align-items: center;
    text-align: center;
  }

  .mtg-bulk-main {
    margin-inline: calc(var(--spacing) * 2);
  }
}
