/* Дополнения главной: окно покупки и ссылки в подвале. Токены — из стилей главной (--stone, --black…) */

.footer__legal { display: flex; flex-wrap: wrap; gap: 0 24px; flex-basis: 100%; }
.footer__legal .link { font-size: 15px; color: var(--ash); }
.footer__company { flex-basis: 100%; color: var(--ash); font-size: 14px; }

.buy {
  width: min(100%, 680px); max-width: 100%; max-height: 100%;
  margin: auto; padding: 0; border: 0;
  background: var(--stone); color: var(--black);
}
.buy::backdrop { background: rgba(0, 0, 0, .72); }
.buy__panel { padding: clamp(20px, 4vw, 40px); }
.buy__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.buy__title { font-size: clamp(28px, 4vw, 40px); line-height: 1.05; font-weight: 500; letter-spacing: -.02em; }
.buy__close {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center;
  margin: -8px -8px 0 0; padding: 0; border: 0; background: none; cursor: pointer;
}
.buy__lead { color: var(--graphite); font-size: 17px; margin-bottom: 24px; max-width: 34em; }

.buy__guests { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.guest { padding: 20px; background: rgba(255, 255, 255, .45); }
.guest__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.guest__title { font-size: 20px; font-weight: 500; }
.guest__remove {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font-size: 16px; text-decoration: underline; text-underline-offset: 5px;
}
.guest__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field__label { font-size: 15px; color: var(--graphite); }
.field__input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; font-size: 17px; color: var(--black);
  background: #fff; border: 1px solid #A3A19C; border-radius: 0;
}
.field__input:focus-visible { outline: 3px solid var(--black); outline-offset: 0; border-color: var(--black); }
.is-invalid { border-color: #A11B1B !important; box-shadow: inset 0 0 0 1px #A11B1B; }

.extra { border: 0; padding: 0; margin: 4px 0 0; }
.extra__options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.extra__option { position: relative; display: block; cursor: pointer; }
.extra__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.extra__option span {
  display: grid; place-content: center; text-align: center;
  min-height: 80px; padding: 8px 4px;
  background: #fff; border: 1px solid #A3A19C;
  font-size: 16px; line-height: 1.25;
}
.extra__option b { display: block; font-size: 18px; font-weight: 500; }
.extra__option small { display: block; font-size: 13px; color: var(--graphite); }
.extra__option input:checked + span { background: var(--black); color: #fff; border-color: var(--black); }
.extra__option input:checked + span small { color: #DAD8D3; }
.extra__option input:focus-visible + span { outline: 3px solid var(--black); outline-offset: 2px; }

.buy__add {
  display: inline-flex; align-items: center; min-height: 48px; margin: 12px 0 20px; padding: 0 20px;
  font: inherit; font-size: 17px; background: none; border: 2px solid var(--black); cursor: pointer;
}
.buy__add:hover { background: var(--black); color: var(--stone); }

.check { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 20px; font-size: 16px; line-height: 1.4; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: #000; }
.check a { color: inherit; text-underline-offset: 3px; }

.buy__total {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 16px;
  padding: 16px 0; border-top: 1px solid rgba(0, 0, 0, .18);
}
.buy__total span { font-size: 18px; }
.buy__total strong { justify-self: end; font-size: 34px; font-weight: 500; letter-spacing: -.02em; }
.buy__total small { grid-column: 1 / -1; color: var(--graphite); font-size: 15px; }
.buy__error { min-height: 1.4em; margin: 4px 0 12px; color: #A11B1B; font-size: 16px; }
.buy__submit { width: 100%; }
.buy__submit:disabled { opacity: .6; cursor: progress; }

.buy__result { font-size: 18px; }
.buy__result p { margin: 0 0 16px; }
.buy__result a { color: inherit; }
.buy__wait { padding: 32px 0; }
.buy__done { font-size: 28px; font-weight: 500; margin-bottom: 12px; }
.buy__done:focus, .buy__wait:focus { outline: none; }
.buy__tickets { list-style: none; padding: 0; display: grid; gap: 12px; }
.buy__ticket {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; align-items: baseline;
  padding: 18px 20px; background: var(--black); color: #fff !important; text-decoration: none;
}
.buy__ticket span { color: #A3A19C; font-size: 15px; }
.buy__ticket b { font-weight: 500; font-size: 20px; }
.buy__ticket small { grid-column: 2; color: #A3A19C; font-size: 15px; }
.buy__ticket em { grid-column: 2; font-style: normal; text-decoration: underline; text-underline-offset: 5px; margin-top: 6px; }

@media (max-width: 600px) {
  .buy { width: 100%; height: 100%; }
  .guest { padding: 16px; }
  .guest__row { grid-template-columns: 1fr; gap: 0; }
  .extra__options { grid-template-columns: repeat(2, 1fr); }
}
