/*
 * Trade page — Tier 1 of the B2B portal.
 * Auto-loaded by header.php's cache-busting stylesheet helper.
 * Minimal styling for the login form + (later) the wholesale catalogue.
 */

.trade {
  max-width: 32rem;        /* Login form is intentionally narrow — focused */
}

.trade-intro {
  margin-bottom: 1.5rem;
}

.trade-error {
  margin: 1rem 0;
  padding: .75rem 1rem;
  background: var(--color-light);
  color: var(--color-text);
  border-left: 2px solid currentColor;
  font-size: .95rem;
}

.trade-login-form {
  margin-top: 1.5rem;
}

.trade-label {
  display: block;
  font-size: .85rem;
  color: var(--color-text-grey);
  margin-bottom: .5rem;
}

.trade-row {
  display: flex;
  gap: .5rem;
}

.trade-row input[type="password"] {
  flex: 1;
  padding: .75rem 1rem;        /* matches newsletter input — ~44px touch target */
  border: 1px solid var(--color-border, #ccc);
  background: transparent;
  font: inherit;
  color: inherit;
}

.trade-row button {
  padding: .75rem 1.5rem;
  border: 1px solid var(--color-black);
  background: var(--color-black);
  color: var(--color-white);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.trade-row button:hover {
  background: transparent;
  color: var(--color-black);
}


/* ----------------------------------------------------------------------
   Trade catalogue — Step 1b
   ----------------------------------------------------------------------
   List of BPP-published titles with cover + meta + retail and wholesale
   prices. Trade users scan-to-order; the list-row format keeps the
   data easy to read on both desktop and a phone. Visibly different
   from the retail shop's cover grid — wholesale list mode, not browse.
   ---------------------------------------------------------------------- */

.trade-catalogue {
  list-style: none;
  padding: 0;
  margin: 2rem 0 3rem;
  max-width: 50rem;            /* lift the desktop max-width above the .trade login width */
}

/* Lift the article max-width when it's the catalogue view, since the
   list reads better with more room than the login form. Targets just
   the lists that exist on the authenticated trade page. */
.trade:has(.trade-catalogue) {
  max-width: 50rem;
}

.trade-meta-line {
  margin-bottom: 1.5rem;
  color: var(--color-text-grey);
  font-size: .9rem;
}
.trade-meta-line strong {
  color: var(--color-text);
}

.trade-book {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-light);
}
.trade-book:first-child {
  border-top: 0;
  padding-top: 0;
}

.trade-book-cover {
  flex: 0 0 6rem;              /* ~96px square-ish thumb on the left */
  aspect-ratio: 2 / 3;
  background: #f4f4f4;
  overflow: hidden;
}
.trade-book-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.trade-book-cover--empty {
  /* placeholder for books without a cover yet */
}

.trade-book-info {
  flex: 1;
  min-width: 0;                /* allow long titles to wrap */
  display: flex;
  flex-direction: column;
  gap: .2rem;
  line-height: 1.4;
  font-size: .95rem;
}

.trade-book-title  { font-size: 1rem; }
.trade-book-author { color: var(--color-text-grey); }

.trade-book-meta {
  font-size: .85rem;
  color: var(--color-text-grey);
  margin-top: .15rem;
}

.trade-book-prices {
  margin-top: .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}
.trade-book-rrp {
  color: var(--color-text-grey);
}
.trade-book-rrp::before  { content: ""; }
.trade-book-wholesale {
  color: var(--color-text);
}

.trade-footer-actions {
  margin-top: 2rem;
  color: var(--color-text-grey);
  font-size: .9rem;
}


/* ----------------------------------------------------------------------
   Order form — Step 1c
   ----------------------------------------------------------------------
   The catalogue list now lives inside a <form>: each book row gets a
   small quantity input on the right, and a "Your details" fieldset
   sits below. On submit, the template emails Peter and shows a
   confirmation. Step 1d will add sevdesk invoice automation.
   ---------------------------------------------------------------------- */

/* Quantity input column on each catalogue row. */
.trade-book-qty {
  flex: 0 0 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
}
.trade-book-qty label {
  font-size: .75rem;
  color: var(--color-text-grey);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.trade-book-qty input[type="number"] {
  width: 3.5rem;
  padding: .5rem .5rem;
  text-align: right;
  border: 1px solid var(--color-border, #ccc);
  background: transparent;
  font: inherit;
  /* Hide Chrome/Safari number-input spinners — bookshops just type. */
  -moz-appearance: textfield;
}
.trade-book-qty input[type="number"]::-webkit-outer-spin-button,
.trade-book-qty input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* "Your details" fieldset — bookshop contact info. */
.trade-order-details {
  border: 0;
  padding: 0;
  margin: 2.5rem 0 1.5rem;
}
.trade-order-details legend {
  font-size: 1rem;
  margin: 0 0 1.25rem;
  padding: 0;
}
.trade-order-field {
  margin-bottom: 1.25rem;
}
.trade-order-field label {
  display: block;
  font-size: .85rem;
  color: var(--color-text-grey);
  margin-bottom: .35rem;
}
.trade-order-field input,
.trade-order-field textarea {
  width: 100%;
  max-width: 32rem;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border, #ccc);
  background: transparent;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
}
.trade-order-field textarea {
  min-height: 5rem;
  resize: vertical;
  font-family: var(--font-family-sans);
}

/* Submit button — matches .buy-button proportions for visual consistency. */
.trade-order-submit {
  display: inline-block;
  margin-top: .5rem;
  padding: .9rem 2rem;
  background: var(--color-black);
  color: var(--color-white);
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  transition: opacity .2s;
}
.trade-order-submit:hover {
  opacity: .85;
}

/* Validation-error block above the form (multi-line error list). */
.trade-error ul {
  margin: .5rem 0 0 1.25rem;
  padding: 0;
}
.trade-error li {
  margin: .25rem 0;
}

/* Order confirmation summary list. */
.trade-order-summary {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  font-size: .95rem;
  line-height: 1.5;
}
.trade-order-summary li {
  padding: .35rem 0;
  border-top: 1px solid var(--color-light);
}
.trade-order-summary li:first-child {
  border-top: 0;
}


/* ====================================================================
   Delivery method radio group
   ====================================================================
   The "Berlin local — free hand delivery" vs "Standard parcel" choice.
   The group label uses a <span> (no single input to associate with),
   the options are clickable rows the bookshop can tap or click.
   Selected row gets a darker border as a quiet visual cue.
   ==================================================================== */

.trade-order-field-label {
  display: block;
  font-size: .85rem;
  color: var(--color-text-grey);
  margin-bottom: .5rem;
}

.trade-delivery-options {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 32rem;
}

/* Each option row: a <label> wrapping radio + descriptive text. The
   generic .trade-order-field label rule above forces small grey labels;
   we override here because these rows are full-size option blocks. */
label.trade-delivery-option {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  font-size: 1rem;
  color: inherit;
  margin-bottom: 0;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border, #ccc);
  cursor: pointer;
  line-height: 1.4;
  transition: border-color .15s;
}

/* Override the generic .trade-order-field input width:100% rule — radio
   inputs should keep their native compact size, not become full-width. */
.trade-delivery-option input[type="radio"] {
  width: auto;
  max-width: none;
  padding: 0;
  margin: .2rem 0 0 0;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
}

/* Editorial — drop the bold spike on "Berlin local" / "Standard parcel"
   to match the rest of the unified-typography treatment. */
.trade-delivery-option strong {
  font-weight: inherit;
}

.trade-delivery-hint {
  display: block;
  font-size: .85rem;
  color: var(--color-text-grey);
  margin-top: .15rem;
}

/* Quiet visual cue: the chosen row's border darkens. */
.trade-delivery-option:has(input:checked) {
  border-color: var(--color-text);
}
