/* Promotions (packs/ticketing): checkout's "Have a code?" (closed until asked for: the field and Apply side by side where they fit, the applied line in the
   success color with a way to take the code off), the one-line automatic offer on the buy pages, and an office's Promotions page (TicketingPromotionsComponent:
   one card per promotion, its name and whether it is on first, then what it does, where and when, and how often it was used and what it took off, so an office
   sees at a glance whether it is working; the switch at the end of the card). The "New promotion" form is the shared form fields in steps.

   Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on the light shell
   and the console, in light and in dark, and mirrors in a right-to-left language. Nothing pinned to an edge, no height in vh, and everything that holds
   words may shrink and wrap, so a language 40% longer never widens the page (WCAG 1.4.10). */

/* ── Checkout: Have a code? ─────────────────────────────────────────────── */
.ticketing-code {
  max-inline-size: 40rem;
  margin-block-start: var(--space-4);
}

.ticketing-code__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: flex-end;
  min-inline-size: 0;
}

.ticketing-code__row > .field {
  flex: 1 1 12rem;
  min-inline-size: 0;
  margin-block-end: 0;
}

.ticketing-code__applied {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
  margin-block: var(--space-3) 0;
  color: var(--tone-good-fg);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ── The buy pages: an automatic offer in one line ──────────────────────── */
.ticketing-offer {
  margin-block: var(--space-2) 0;
  color: var(--tone-good-fg);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticketing-offer--quiet {
  font-size: var(--text-sm);
}

/* ── An office's Promotions (TicketingPromotionsComponent) ──────────────── */
.ticketing-promotions {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
}

.ticketing-promotions__title {
  margin-block: 0;
}

.ticketing-promotions__lede {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.ticketing-promotions__list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticketing-promotions__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-4);
  align-items: start;
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.ticketing-promotions__item[data-on="false"] {
  background: var(--surface-2);
}

.ticketing-promotions__head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
  min-inline-size: 0;
}

.ticketing-promotions__name {
  margin-block: 0;
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.ticketing-promotions__code {
  font-family: var(--font-mono);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticketing-promotions__facts {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  min-inline-size: 0;
}

.ticketing-promotions__facts p {
  margin: 0;
  overflow-wrap: anywhere;
}

.ticketing-promotions__what {
  font-weight: 600;
}

.ticketing-promotions__where {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.ticketing-promotions__uses {
  font-variant-numeric: tabular-nums;
}

.ticketing-promotions__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

/* A phone: the switch goes under the card's words. */
@media (max-width: 40rem) {
  .ticketing-promotions__item {
    grid-template-columns: minmax(0, 1fr);
  }

  .ticketing-promotions__actions {
    justify-content: flex-start;
  }
}

/* ── New promotion: the kind first, as five plain choices ──────────────── */
.ticketing-promotion-kinds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticketing-promotion-kinds__choice {
  display: grid;
  gap: var(--space-1);
  min-block-size: var(--target-min);
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--fg1);
  text-decoration: none;
}

.ticketing-promotion-kinds__choice:hover {
  border-color: var(--accent-line);
}

.ticketing-promotion-kinds__choice:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ticketing-promotion-kinds__label {
  font-weight: 600;
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.ticketing-promotion-kinds__example {
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.ticketing-promotion-uses__total {
  margin-block: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ticketing-promotion-uses__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* ── Shareable ?promo=CODE copy link & batch CSV management ────────────── */
.ticketing-promo-banner__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-inline-size: 0;
}

.ticketing-promo-share {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: 0;
}

.ticketing-promo-share__status {
  color: var(--tone-good-fg);
  font-size: var(--text-xs);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ticketing-promo-share__status:empty {
  display: none;
}

.ticketing-promo-share-box {
  display: grid;
  gap: var(--space-2);
  max-inline-size: 40rem;
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface);
  min-inline-size: 0;
}

.ticketing-promo-share-box__title {
  margin-block: 0;
  font-size: var(--text-md);
  overflow-wrap: anywhere;
}

.ticketing-promo-share-box__help {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.ticketing-promo-share-box__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
  min-inline-size: 0;
}

.ticketing-promo-share-box__row > .field {
  flex: 1 1 14rem;
  min-inline-size: 0;
  margin-block-end: 0;
}

.ticketing-promo-batch-fields {
  display: grid;
  gap: var(--space-3);
  min-inline-size: 0;
}

.ticketing-promo-batches {
  display: grid;
  gap: var(--density-gap);
  min-inline-size: 0;
}

.ticketing-promo-batch__meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-text);
}

.ticketing-promo-batch__codes {
  margin-block-start: var(--space-3);
  min-inline-size: 0;
}

.ticketing-promo-batch__code-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticketing-promo-batch__code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding-block: var(--space-1);
  border-block-end: 1px solid var(--rule);
  min-inline-size: 0;
}

.ticketing-promo-batch__code-row:last-child {
  border-block-end: 0;
}
