/* Мобильная НГ и тимбилдинг. */

@media (max-width: 899px) {
  #calculator .calc__ways {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  #calculator .calc__ways-text { margin: 0; }
}

.photo-zoom {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 1.4rem 16px;
  background: rgba(8, 6, 6, 0.97);
}
.photo-zoom[hidden] { display: none !important; }
.photo-zoom__frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
}
.photo-zoom img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.photo-zoom__close {
  position: absolute;
  top: auto;
  right: 0;
  bottom: calc(100% + 12px);
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 16, 16, 0.92);
  color: #fff;
}
.photo-zoom__close svg { width: 18px; height: 18px; }
.photo-zoom__prev,
.photo-zoom__next {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  transform: translateY(-50%);
}
.photo-zoom__prev { left: 0.65rem; }
.photo-zoom__next { right: 0.65rem; }
[data-gallery],
[data-gallery-open] { cursor: zoom-in; }

.hero__photo--m { display: none; }
#zina { display: none; }
#next { display: none; }
.calc__round-info { display: none !important; }

@keyframes next-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
.next__arrow { animation: next-bob 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .next__arrow { animation: none; }
}

@media (max-width: 899px) {
  .hero__gallery .hero__tag,
  .hero__gallery .hero__stamp { display: none !important; }

  .hero__photo--m { display: block; }

  .hero__gallery {
    display: flex !important;
    grid-template-columns: none;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 1rem var(--gutter) 1.5rem;
    margin-inline: calc(50% - 50vw);
    width: 100vw;
    min-height: 0 !important;
    max-width: none !important;
    scrollbar-width: none;
    align-items: flex-start;
  }
  .hero__gallery::-webkit-scrollbar { display: none; }

  .hero__gallery .hero__photo {
    position: static !important;
    flex: 0 0 68vw;
    width: auto !important;
    margin: 0 !important;
    left: auto;
    right: auto;
    top: auto;
    scroll-snap-align: center;
    padding: 8px 8px 10px;
    --polaroid-foot: 0px;
  }
  .hero__gallery .hero__photo--1 { --rot: -2deg !important; }
  .hero__gallery .hero__photo--2 { --rot: 2deg !important; }
  .hero__gallery .hero__photo,
  .hero__gallery .hero__photo[data-reveal],
  .hero__gallery .hero__photo[data-reveal].is-in {
    opacity: 1 !important;
    transform: rotate(var(--rot)) !important;
    animation: none !important;
  }
  .hero__gallery .polaroid__caption { display: none; }

  #product > .container { display: flex; flex-direction: column; }
  #product .section__head,
  #product .product__steps,
  #product .product__media,
  #product .product__step,
  #product .product__shot { order: 0; }
  #product .product__steps { display: block; counter-reset: step; }
  #product .product__kicker { display: none; }
  #product .product__step {
    counter-increment: step;
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    column-gap: 0.65rem;
    row-gap: 0.3rem;
    align-items: baseline;
    margin: 0 0 1.15rem;
    padding: 0;
    background: none;
    background-image: none;
    border: 0;
    box-shadow: none;
    transform: none;
  }
  #product .product__step:hover { transform: none; border-color: transparent; }
  #product .product__step::before {
    content: counter(step);
    grid-column: 1;
    grid-row: 1;
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    line-height: var(--lh-display);
  }
  #product .product__step h3 {
    display: block;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-size: var(--fs-h4);
  }
  #product .product__step p { grid-column: 2; grid-row: 2; margin: 0; }
  #product .product__media {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem var(--gutter) 1.5rem;
    margin: 0.5rem calc(50% - 50vw) 0;
    width: 100vw;
    scrollbar-width: none;
  }
  #product .product__media::-webkit-scrollbar { display: none; }
  #product .product__shot {
    flex: 0 0 68vw;
    margin: 0;
    scroll-snap-align: center;
    padding: 8px 8px 10px;
    background: #fff;
    overflow: hidden;
    transform: rotate(-2deg);
  }
  #product .product__shot:nth-child(2) { transform: rotate(2deg); }
  #product .product__shot:nth-child(3) { transform: rotate(-1deg); }

  #mechanics { padding-bottom: calc(var(--section-y) / 2); }
  #zina .container { display: flex; flex-direction: column; }
  #zina .quote-faq { order: 20; }
  #zina {
    display: block;
    transform: none;
    padding: calc(var(--section-y) / 2) 0 var(--section-y);
    gap: 0;
    scroll-margin-top: 4.75rem;
  }
  #zina-form > .details-toggle,
  #lead-form .details-toggle {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 0.75rem auto;
    text-align: center;
  }
  aside.zina .zina__intro { padding-right: 2.5rem; }
  aside.zina .zina__intro .kicker,
  aside.zina .zina__intro h3 { white-space: normal; overflow-wrap: break-word; }
  aside.zina .zina__clip { right: 0.15rem; top: -8px; }
  #main > .tape--zina { order: 7; }
  #next { display: block; padding-top: var(--section-y); padding-bottom: 1rem; }
  #next .next__sheet { margin-bottom: 1.25rem; padding: 1.35rem 1.15rem 0.35rem; }
  #next h2 { font-size: var(--fs-h4); letter-spacing: var(--ls-display-sm); line-height: var(--lh-h4); }
  #next .next__list { list-style: none; margin: 1rem 0 0; padding: 0; }
  #next .next__item {
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    gap: 0.6rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
    color: inherit;
    text-decoration: none;
  }
  #next .next__num { font-family: var(--font-display); font-size: var(--fs-h4); line-height: 1; padding-top: 0; }
  #next .next__item:not(:has(.next__num)) { grid-template-columns: minmax(0, 1fr); }
  #next .next__item:not(:has(.next__num)) .next__text { width: auto; }
  #next .next__label { min-width: 0; }
  #next .next__text {
    width: auto;
    max-width: 100%;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    border-bottom: 0;
    padding-bottom: 0;
    line-height: 1.35;
  }
  #next .next__go { margin-left: 0.35em; text-decoration: none; }
  #next .next__dots { display: none; }
  #next .next__arrow {
    display: block;
    width: fit-content;
    margin: 0.35rem auto 0;
    color: inherit;
    font-size: 2rem;
    line-height: 1;
    text-decoration: none;
  }
  #cases, #logistics, #fit, #reviews, #faq, #fresh { scroll-margin-top: 3.75rem; }

  #main { display: flex; flex-direction: column; }
  #main > * { order: 20; }
  #main > #hero { order: 1; }
  #main > .tape--hero { order: 2; }
  #main > #product { order: 3; }
  #main > .tape--product { order: 4; }
  #main > #mechanics { order: 5; }
  #main > #proof-strip { order: 6; }
  #main > #zina { order: 7; }
  #main > .tape--zina,
  #main > #next { order: 8; }
  #main > #cases { order: 9; }
  #main > #fresh { order: 10; }
  #proof-strip:not([hidden]) { max-height: 844px; overflow: hidden; padding-top: 1.25rem; padding-bottom: 1.25rem; }
  #main > .tape--fresh { display: none; }
  #calculator .calc__folder { grid-template-columns: 1fr; }
  #calculator .calc__stage > .container { width: 100%; max-width: none; padding-inline: 0; }
  #calculator .calc__panel,
  #calculator .calc__sheet,
  #calculator .range__track { width: 100%; min-width: 0; }

  #zina .zina__card { margin-top: 0.35rem; margin-bottom: 0.85rem; overflow: visible; }
  #zina .msg-pair { display: flex; width: 100%; gap: 0.5rem; }
  #zina .msg-pair .btn { flex: 1 1 0; width: auto; min-width: 0; margin: 0; justify-content: center; padding-inline: 0.4rem; letter-spacing: 0.03em; }
  #zina .zina__or { margin: 0.7rem 0 1rem; text-align: center; color: var(--fg-muted); font-size: var(--fs-small); }
  #zina .zina__invite { margin: 0 0 0.7rem; }
  #modal-dates .modal__close { top: 0.05rem; right: 0.2rem; }
  #modal-dates .modal__body { padding-top: 4.15rem; }
  #modal-dates .cal { --cell: 2.45rem; }
  #modal-dates .cal__grid { grid-template-rows: auto repeat(6, var(--cell)); }
  #modal-dates .cal__day,
  #modal-dates .cal__pad { width: 100%; height: var(--cell); aspect-ratio: auto; }
  #proof .form__lead-in .form__invite {
    display: block;
    margin: 0 0 0.7rem;
    text-align: center;
    font-size: var(--fs-caption);
    line-height: var(--lh-caption);
  }
  #proof .form__lead-in .msg-pair { display: flex; width: 100%; gap: 0.5rem; }
  #proof .form__lead-in .msg-pair .btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin: 0;
    justify-content: center;
    padding-inline: 0.4rem;
    letter-spacing: 0.03em;
  }
  #main .polaroid img,
  #main .product__shot img,
  #main .host__photo,
  #main .case__img img,
  #main .crate__img,
  #main .hosts__crew-photo img,
  #main .turnkey__photos img { cursor: zoom-in; }
  #zina .mini {
    display: block;
    width: auto;
    margin: 0 calc(var(--gutter) * -1) 1.25rem;
    padding: 1.35rem var(--gutter) 1.15rem;
    box-sizing: border-box;
    color: var(--ink-900);
  }
  #zina .mini__label { text-align: center; margin-bottom: 0.35rem; color: var(--ink-900); }
  #zina #mini-people-input { width: 5.5ch; color: var(--ink-900); }
  #zina .mini .range { padding-bottom: 1.75rem; }
  #zina .mini .range__track { width: 100%; background: var(--ink-900); }
  #zina .mini .range__ticks span { background: var(--ink-900); }
  #zina .mini .range__ticks span::after { color: var(--ink-900); }
  #zina .mini__row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.85rem; }
  #zina .mini__row--dates { justify-content: flex-start; gap: 0; margin-top: 0.85rem; }
  .fresh__stage,
  .reviews__grid,
  .hosts__grid,
  .hero__gallery,
  .proof__ugc,
  #product .product__media,
  .steps__list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.45) transparent;
    scroll-snap-type: x proximity;
    overflow-y: auto;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    cursor: grab;
  }
  .fresh__stage::-webkit-scrollbar,
  .reviews__grid::-webkit-scrollbar,
  .hosts__grid::-webkit-scrollbar,
  .hero__gallery::-webkit-scrollbar,
  .proof__ugc::-webkit-scrollbar,
  #product .product__media::-webkit-scrollbar,
  .steps__list::-webkit-scrollbar { display: block; height: 6px; }
  .fresh__stage::-webkit-scrollbar-thumb,
  .reviews__grid::-webkit-scrollbar-thumb,
  .hosts__grid::-webkit-scrollbar-thumb,
  .hero__gallery::-webkit-scrollbar-thumb,
  .proof__ugc::-webkit-scrollbar-thumb,
  #product .product__media::-webkit-scrollbar-thumb,
  .steps__list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.45); border-radius: 3px; }
  #zina .mini__row--round { justify-content: flex-start; gap: 0.4rem; }
  #zina .mini__row--round .check { flex: 0 0 auto; gap: 0; }
  #zina .mini__row--round [data-mini-round-price] { margin-left: auto; }
  #zina .mini__round-link {
    display: inline;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline dashed;
    text-underline-offset: 3px;
    cursor: pointer;
  }
  #zina #mini-total { font-family: var(--font-display); font-size: var(--fs-h3); }
  #zina .field + .field,
  #zina .form__consents { margin-top: 0.75rem; }
  #zina .form__submit { margin-top: 1rem; }

  /* На телефоне наклон только у фото. Кнопки, стикеры и карточки — по прямой. */
  .sticker,
  .sticker--wide,
  .sticker--slate,
  .sticker--slate[data-reveal].is-in,
  [data-reveal].is-in .sticker--slate,
  .tape,
  .tape-strip,
  .review,
  .review:hover,
  .timeline__card,
  .timeline__item--hl .timeline__card,
  .step,
  .alts__add,
  aside.zina,
  .legend-circle {
    --sticker-rotate: 0deg;
    --tape-rotate: 0deg;
    --rot: 0deg;
    transform: none;
    animation: none;
  }
  .btn {
    justify-content: center;
    align-items: center;
    text-align: center;
  }
}

/* Десктоп: Макс и ТГ по центру правой колонки, где лист с формой Зины. */
@media (min-width: 900px) {
  #calculator .calc__ways {
    display: grid;
    grid-template-columns: calc(638 * var(--u)) calc(575 * var(--u));
    column-gap: calc(37 * var(--u));
    row-gap: calc(12 * var(--u));
    margin-left: calc((86 - 111) * var(--u));
    width: calc((638 + 37 + 575) * var(--u));
    max-width: none;
    justify-content: stretch;
    align-items: center;
  }
  #calculator .calc__ways > .calc__ways-text {
    grid-column: 1 / -1;
    margin-left: calc((111 - 86) * var(--u));
    width: calc((1440 - 222) * var(--u));
  }
  #calculator .calc__ways > .msg-pair { grid-column: 2; justify-self: center; }
}

#zina .mini__dates-link {
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding-inline: 0.65rem;
  --btn-fg: var(--ink-900);
  --btn-bg: transparent;
  --btn-bg-hover: rgba(0, 0, 0, 0.05);
  --btn-edge: transparent;
  border-color: rgba(0, 0, 0, 0.45);
  color: var(--ink-900);
  box-shadow: none;
}
#zina .mini__dates-ico { flex: 0 0 16px; width: 16px; height: 16px; }
#zina .mini__dates-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
