/* Match fallback widths while the brand fonts load. */
@font-face {
  font-family: TildaSansFallback;
  src: local("Arial"), local("Roboto");
  size-adjust: 92%;
}
@font-face {
  font-family: TildaSansFallback;
  src: local("Arial Bold"), local("Roboto Bold");
  font-weight: 700;
  size-adjust: 92%;
}
@font-face {
  font-family: DespairDisplayFallback;
  src: local("Arial Bold"), local("Roboto Bold");
  font-weight: 700;
  size-adjust: 103%;
}
:root {
  --paper: #fff;
  --background: #f4f6fa;
  --surface: #fff;
  --ink: #191c1b;
  --muted: #4c5d56;
  --line: #d6dfdc;
  --outline: #0c7659;
  --br-text-font: TildaSans, TildaSansFallback, Arial, sans-serif;
  --br-title-font: DespairDisplay, DespairDisplayFallback, TildaSans, Arial, sans-serif;
  font: 400 16px/1.5 var(--br-text-font);
  color: var(--ink);
  background: var(--background);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible, .br-winter-primary:focus-visible { outline: 2px solid var(--outline); outline-offset: 3px; }
.skip { position: absolute; top: 8px; left: 12px; z-index: 5; background: var(--surface); padding: 8px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.shell { width: min(1400px, calc(100% - 48px)); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-nav { min-height: 66px; display: flex; align-items: center; gap: 28px; font-size: 15px; }
.site-nav a { text-decoration: none; }
.site-nav a:hover, .site-nav [aria-current] { text-decoration: underline; text-underline-offset: 4px; }
.brand { display: block; flex: none; }
.brand img { display: block; width: 155px; height: auto; }
.contact { margin-inline-start: auto; white-space: nowrap; }
.intro { margin: 42px 0 34px; }
h1, h2, legend {
  margin: 0;
  font: 700 30px/1.15 var(--br-title-font);
  letter-spacing: -.015em;
  text-transform: uppercase;
}
h1 { font: 700 clamp(30px, 4.35vw, 62px)/1.08 var(--br-title-font); text-wrap: balance; }
.mobile-break { display: none; }
.intro p { max-width: 680px; margin: 14px 0 0; color: var(--muted); }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: 36px; align-items: start; }
.order-form { min-width: 0; display: grid; gap: 30px; }
.order-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { max-width: 100%; margin-bottom: 8px; padding: 0; }
.hint, .art-current { color: var(--muted); font-size: 15px; }
.order-form fieldset > .hint { margin: 0 0 12px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.amount-option, .photo-option { position: relative; cursor: pointer; min-width: 0; }
.amount-option input, .photo-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.amount-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 580;
  font-size: 15px;
}
.amount-option:hover span { border-color: var(--outline); }
.amount-option input:checked + span {
  background: #def8ef;
  border-color: #19bf92;
  color: #0c5541;
}
.amount-option input:focus-visible + span, .photo-option input:focus-visible + span {
  outline: 2px solid var(--outline);
  outline-offset: 2px;
}
#custom-field { margin-top: 14px; max-width: 245px; }
.art-current { margin: 14px 0 7px; }
.art-picker { position: relative; }
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 44px) / 5);
  gap: 11px;
  padding: 4px;
  overflow: auto hidden;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
}
.gallery::-webkit-scrollbar { display: none; }
.photo-option { scroll-snap-align: start; font-size: 13px; line-height: 1.2; }
.photo-option span { display: block; border-radius: 14px 14px 4px 4px; overflow-wrap: anywhere; }
.photo-option img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  margin: 0 0 7px;
  object-fit: cover;
  border-radius: 14px;
  background: var(--surface);
}
.photo-option input:checked + span img { outline: 2px solid var(--outline); outline-offset: 2px; }
.gallery-arrow, .secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--outline);
}
.gallery-arrow {
  position: absolute;
  top: 42%;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  padding: 0 0 3px;
  border-radius: 50%;
  transform: translateY(-50%);
  font-size: 27px;
  line-height: 1;
}
.gallery-arrow.previous { left: -12px; }
.gallery-arrow.next { right: -12px; }
.gallery-arrow:disabled { visibility: hidden; }
.field { display: grid; gap: 5px; margin-top: 12px; color: var(--muted); font-size: 15px; }
.field input, .field textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--br-button-min-height);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--br-button-radius);
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
}
input::placeholder, textarea::placeholder { color: #65746c; }
.short-field { max-width: 390px; }
.name-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
textarea { resize: vertical; }
.personalize-footer { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.show-preview { display: none; }
.character-count { margin-inline-start: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.order-form .order-contact { padding: 14px 20px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.order-contact legend { padding-inline: 6px; margin-inline-start: -6px; font-size: 23px; }
.order-contact .br-winter-primary { margin-top: 14px; }
.br-winter-primary:disabled { opacity: .6; cursor: default; }
#request-fallback { display: grid; gap: 8px; margin-top: 14px; }
#request-fallback p { margin: 0; }
.request-number { overflow-wrap: anywhere; }
.request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.secondary { min-height: 44px; padding: 6px 13px; border-radius: var(--br-button-radius); }
.order-preview { position: sticky; top: 20px; min-width: 0; scroll-margin-top: 14px; }
.preview-label { margin: 0 0 8px; color: var(--muted); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 5px solid var(--br-button-background);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  container-type: inline-size;
}
.preview-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: #edf3ef; }
.preview-paper { padding: clamp(16px, 5.5cqw, 25px); }
.preview-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: clamp(15px, 4.5cqw, 20px);
}
.preview-brand img { display: block; width: min(43%, 140px); height: auto; }
.preview-kind { margin: 0; color: var(--outline); font-size: clamp(11px, 3cqw, 14px); text-align: right; }
.preview-paper h2 { font-size: clamp(21px, 7.1cqw, 32px); line-height: 1.08; text-wrap: balance; overflow-wrap: anywhere; }
.preview-overline { color: var(--muted); font-size: clamp(12px, 3cqw, 15px); margin: 0 0 5px; overflow-wrap: anywhere; }
.preview-names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5cqw; margin: 4cqw 0 0; font-size: clamp(12px, 3.2cqw, 16px); }
.preview-names dt { color: var(--muted); }
.preview-names dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.preview-names div:only-of-type { grid-column: 1 / -1; }
.preview-greeting { margin: 4cqw 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: clamp(13px, 3.1cqw, 16px); }
.preview-details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: clamp(15px, 4.5cqw, 20px);
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.preview-amount { display: grid; gap: 1px; min-width: 0; margin: 0; padding: 6px 12px; border-radius: 8px; background: #def8ef; }
.preview-amount span { color: var(--outline); font-size: 11px; letter-spacing: .055em; text-transform: uppercase; }
.preview-amount strong { font-size: clamp(20px, 5.6cqw, 27px); line-height: 1.2; overflow-wrap: anywhere; }
.preview-terms { margin: 0; color: var(--muted); font-size: clamp(11px, 3cqw, 14px); }
.preview-caption { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.details { margin-top: 49px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); counter-increment: step; }
.steps li::before { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; content: "Шаг " counter(step); }
.steps p, .faqs p { margin: 5px 0 0; color: var(--muted); font-size: 15px; }
.faqs { max-width: 800px; }
.faqs h2 { margin-bottom: 15px; }
.faqs details { padding: 12px 0; border-top: 1px solid var(--line); }
.faqs summary { cursor: pointer; }
.footer { margin-top: 46px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); }
.footer .shell { display: flex; flex-wrap: wrap; gap: 8px 28px; }
@media (max-width: 1020px) {
  .order-layout { grid-template-columns: minmax(0, 1fr) minmax(270px, 37%); gap: 26px; }
  .gallery { grid-auto-columns: calc((100% - 22px) / 3); }
}
@media (max-width: 730px) {
  .shell { width: calc(100% - 34px); }
  .site-nav { min-height: 62px; gap: 10px 18px; }
  .site-nav .nav-link { display: none; }
  .brand img { width: 135px; }
  .contact { font-size: 14px; }
  .intro { margin: 27px 0; }
  .intro p { font-size: 16px; }
  .mobile-break { display: initial; }
  .order-layout { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .order-form { display: contents; }
  .personalize { order: 1; }
  .order-contact { order: 2; }
  .order-preview { position: static; width: min(100%, 460px); margin-inline: auto; }
  h2, legend { font-size: 24px; }
  .amount-option span { min-height: 42px; padding-inline: 11px; font-size: 14px; }
  .gallery { grid-auto-columns: 42%; }
  .gallery-arrow { top: 36%; }
  .show-preview { display: inline-block; padding: 8px 0; font-size: 15px; text-underline-offset: 3px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 405px) {
  .denomination .choices { display: grid; grid-template-columns: repeat(3, minmax(0, max-content)); }
  .denomination .amount-option:last-child { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 360px) {
  .name-fields, .steps { grid-template-columns: minmax(0, 1fr); }
  .name-fields { gap: 0; }
}
