/* ============================================
   BUY — окно покупки (js/buy.js): email → Stripe Checkout.
   Подключается на главной, в кабинете и на /checkout/cancel/.
   ============================================ */

.buy-dialog {
  width: min(100% - 2rem, 420px);
  max-height: calc(100svh - 2rem);
  margin: 8svh auto auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--white);
  color: var(--warm-black);
  box-shadow: var(--shadow-card-hover);
}

.buy-dialog::backdrop {
  background: rgba(26, 23, 20, 0.55);
}

.buy-inner {
  position: relative;
  padding: 1.75rem 1.5rem 1.5rem;
}

.buy-close {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: 0;
  cursor: pointer;
}

.buy-close:hover {
  color: var(--warm-black);
}

.buy-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.2;
  padding-right: 2rem;
  margin-bottom: 0.5rem;
}

.buy-text {
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.buy-label {
  display: block;
  font-size: var(--text-caps);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.buy-input {
  width: 100%;
  font: 500 1.3125rem/1.3 var(--font-body);
  font-variant-numeric: lining-nums;
  color: var(--warm-black);
  background: var(--white);
  border: 1px solid var(--text-muted);
  border-radius: 2px;
  padding: 0.85rem 1rem;
}

.buy-dialog .buy-input:focus {
  /* сильнее общего :focus-visible ниже: у поля своя рамка, без второго контура */
  outline: none;
  border-color: var(--warm-black);
  box-shadow: 0 0 0 1px var(--warm-black);
}

.buy-error {
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--gold);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--warm-black);
}

.buy-error a {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

.buy-error[hidden] {
  display: none;
}

.buy-submit {
  width: 100%;
  min-height: 3rem;
  margin-top: 1rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  letter-spacing: 0.1em;
}

.buy-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.buy-note {
  margin-top: 0.875rem;
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--text-muted);
}

.buy-dialog :focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
}
