/**
 * Ticket Buyer styles — public form side.
 * Loaded on form.html, only takes visual effect when ticket-buyer.js
 * activates the .tier-buyer container (formType === 'ticketed_event').
 *
 * Inherits the host's chosen themeColor for accents via CSS variables that
 * form.js already sets on :root: --primary-color, --secondary-color, etc.
 * Falls back to neutral colors when those vars aren't set.
 */

.tier-buyer {
  margin: 1.5rem 0;
  font-family: inherit;
}

.tier-buyer-header {
  margin-bottom: 1rem;
  text-align: center;
}
.tier-buyer-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--text-color, #2a2a2a);
}
.tier-buyer-subtle {
  color: #6a6a6a;
  font-size: 0.95rem;
  margin: 0;
}

.tier-buyer-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.tier-buyer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.tier-buyer-row:hover {
  border-color: var(--primary-color, #888);
}
.tier-buyer-row-info {
  min-width: 0;
}
.tier-buyer-row-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-color, #2a2a2a);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tier-buyer-seats-note {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: #555;
}
.tier-buyer-row-desc {
  color: #6a6a6a;
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}
.tier-buyer-row-price {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary-color, #2a2a2a);
}
.tier-buyer-low {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fff3cd;
  color: #8b6914;
}

.tier-buyer-row-qty {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tier-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #fff;
  color: var(--text-color, #2a2a2a);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
}
.tier-qty-btn:hover {
  border-color: var(--primary-color, #888);
  background: rgba(0, 0, 0, 0.03);
}
.tier-qty-btn:active {
  transform: scale(0.95);
}
.tier-qty-input {
  width: 56px;
  height: 36px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: var(--text-color, #2a2a2a);
  -moz-appearance: textfield;
}
.tier-qty-input::-webkit-outer-spin-button,
.tier-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.tier-buyer-soldout {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c44;
  padding: 0 0.5rem;
}

.tier-buyer-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.1rem;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.tier-buyer-summary-label {
  color: #6a6a6a;
  font-weight: 500;
}
.tier-buyer-summary-amount {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-color, #2a2a2a);
}

.tier-buyer-info {
  margin-top: 1.5rem;
}
.tier-buyer-info h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
  color: var(--text-color, #2a2a2a);
}
.tier-buyer-field {
  margin-bottom: 1rem;
}
.tier-buyer-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-color, #2a2a2a);
}
.tier-buyer-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text-color, #2a2a2a);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tier-buyer-field input:focus {
  outline: none;
  border-color: var(--primary-color, #888);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.tier-buyer-field small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #888;
}
.tier-buyer-field label small {
  display: inline;
  margin: 0 0 0 0.25rem;
  color: #aaa;
  font-weight: 400;
}

/* Empty state — shown in the iframe preview before the host has added tiers */
.tier-buyer-empty {
  text-align: center;
  padding: 3rem 1.5rem;
}
.tier-buyer-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(184, 150, 78, 0.12);
  border: 1px solid rgba(184, 150, 78, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-color, #b8964e);
  margin: 0 auto 1rem;
}
.tier-buyer-empty h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-color, #2a2a2a);
}
.tier-buyer-empty p {
  color: #6a6a6a;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 320px;
}

@media (max-width: 480px) {
  .tier-buyer-row {
    padding: 0.85rem 0.9rem;
    gap: 0.6rem;
  }
  .tier-buyer-row-name {
    font-size: 0.98rem;
  }
  .tier-buyer-row-price {
    font-size: 1rem;
  }
  .tier-qty-btn {
    width: 32px;
    height: 32px;
  }
  .tier-qty-input {
    width: 44px;
    height: 32px;
  }
}
