/* ============================================================
   Альпийская вода — интерфейс: форма, модальные окна,
   корзина, тосты
   ============================================================ */

/* ---------------- Формы ---------------- */
.form { display: grid; gap: 0; }
.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: .01em;
}
.field > span small { font-weight: 500; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfd;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 62px; }
.field select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d8595' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(34, 119, 202, .12);
}
.field input::placeholder,
.field textarea::placeholder { color: #9db0bb; }
.field__error {
  display: none;
  font-style: normal;
  font-size: 11px;
  color: #c0392b;
}
.field.is-invalid input,
.field.is-invalid select { border-color: #d9705f; background: #fff7f5; }
.field.is-invalid .field__error { display: block; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 16px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid rgba(11, 36, 56, .25);
  border-radius: 5px;
  background: #fff;
  transition: .2s;
}
.check__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg) scale(.4);
  opacity: 0;
  transition: .2s;
}
.check input:checked + .check__box { background: var(--green); border-color: var(--green); }
.check input:checked + .check__box::after { opacity: 1; transform: rotate(40deg) scale(1); }
.check input:focus-visible + .check__box { outline: 3px solid rgba(34, 119, 202, .4); outline-offset: 2px; }
.check a { color: var(--blue-600); }
.form__hint { margin-top: 12px; font-size: 12px; color: var(--muted); text-align: center; }
.form__hint a { color: var(--ink); font-weight: 700; }

/* ---------------- Модальные окна ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 25, 44, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal__dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 34px;
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(.98);
  transition: transform .3s var(--ease);
}
.modal.is-open .modal__dialog { transform: none; }
.modal__dialog--wide {
  width: min(100%, 940px);
  padding: 0;
  overflow: hidden;
}
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  background: rgba(255, 255, 255, .9);
}
.modal__dialog--wide .modal__close { background: #fff; box-shadow: var(--shadow-sm); }

/* ---------------- Оформление заказа ---------------- */
.order {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
}
.order__aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 34px 28px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(62, 147, 222, .35), transparent 60%),
    var(--navy-900);
  color: #fff;
}
.order__aside h3 { color: #fff; font-size: 1.4rem; }
.order__sub { font-size: 12.5px; color: rgba(255, 255, 255, .6); margin-top: -6px; }
.order__product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
}
.order__product img { width: 46px; height: auto; flex: none; }
.order__product strong { display: block; font-size: 13px; line-height: 1.35; }
.order__product span { font-size: 11.5px; color: rgba(255, 255, 255, .6); }
.order__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .7);
}
.order__aside .qty { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.order__aside .qty__btn { background: rgba(255, 255, 255, .14); color: #fff; }
.order__aside .qty__btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.order__aside .qty__input { color: #fff; }
.order__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 13px;
  color: rgba(255, 255, 255, .65);
}
.order__total strong { font-size: 1.5rem; color: #fff; letter-spacing: -.02em; }
.order__benefits { display: grid; gap: 7px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 11.5px; color: rgba(255, 255, 255, .62); }
.order__benefits li { display: flex; align-items: flex-start; gap: 7px; }
.order__benefits .icon { width: 14px; height: 14px; margin-top: 2px; color: var(--green); }

.order__main { display: flex; flex-direction: column; justify-content: center; padding: 32px; }
.order__main > form { max-width: 100%; }

.order__success,
.callback__success { text-align: center; padding: 18px 0 8px; }
.order__success-ico {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: #eef8e7;
  color: var(--green-600);
}
.order__success-ico .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.order__success h4,
.callback__success h4 { font-size: 1.3rem; margin-bottom: 8px; }
.order__success p,
.callback__success p { font-size: .93rem; color: var(--ink-2); max-width: 38ch; margin-inline: auto; }
.order__success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

/* ---------------- Звонок ---------------- */
.callback { display: grid; gap: 10px; }
.callback h3 { font-size: 1.35rem; }
.callback__sub { font-size: .92rem; color: var(--ink-2); max-width: 40ch; }
.callback .form { margin-top: 6px; gap: 12px; }

/* ---------------- Корзина ---------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.drawer.is-open { opacity: 1; visibility: visible; }
.drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 25, 44, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .35s var(--ease);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.drawer__head h3 { font-size: 1.15rem; }
.drawer__body {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px 24px;
  overflow: auto;
}
.drawer__foot {
  padding: 18px 24px 22px;
  border-top: 1px solid var(--line);
  background: var(--ice-50);
}
.drawer__sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
}
.drawer__sum strong { font-size: 1.4rem; color: var(--ink); letter-spacing: -.02em; }
.drawer__note { margin: 6px 0 14px; font-size: 11.5px; color: var(--muted); }
.drawer__foot .btn { width: 100%; }

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: 0; padding-bottom: 0; }
.cart-item img { width: 56px; height: auto; filter: drop-shadow(0 6px 10px rgba(9, 58, 97, .2)); }
.cart-item__info strong { display: block; font-size: 13px; line-height: 1.35; }
.cart-item__info span { font-size: 11.5px; color: var(--muted); }
.cart-item__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-item__sum { font-size: 13.5px; font-weight: 800; }
.cart-item__remove {
  border: 0;
  background: none;
  padding: 0;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.cart-item__remove:hover { color: #c0392b; }
.cart-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 50px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.cart-empty .icon { width: 40px; height: 40px; color: rgba(34, 119, 202, .3); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 130;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--navy-900);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: .3s var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { width: 18px; height: 18px; color: var(--green); }
.toast__link {
  padding-left: 10px;
  margin-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- Адаптив UI ---------------- */
@media (max-width: 860px) {
  .modal__dialog--wide { width: min(100%, 560px); overflow: auto; max-height: calc(100vh - 24px); }
  .order { grid-template-columns: 1fr; }
  .order__aside { padding: 26px 22px; }
  .order__aside h3 { padding-right: 40px; }
  .order__main { padding: 22px; }
  .modal__close { position: fixed; top: 12px; right: 12px; background: #fff; }
  .modal__dialog { padding: 26px 22px; }
  .form__grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .modal { padding: 8px; }
  .modal__dialog { border-radius: 20px; max-height: calc(100vh - 16px); }
  .modal__dialog--wide { border-radius: 20px; }
  .order__product img { width: 38px; }
  .order__aside { padding: 20px 18px; }
  .order__aside h3 { font-size: 1.2rem; }
  .order__benefits { display: none; }
  .order__main { padding: 18px; }
  .toast { font-size: 12.5px; padding: 11px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Печать: показываем всё, скрываем интерфейсные слои */
@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
  .site-header, .to-top, .drawer, .modal, .toast, .marquee, .reviews__controls, .scroll-progress { display: none !important; }
  .hero { min-height: auto; padding-top: 24px; }
  body { color: #000; }
  .section { padding: 24px 0; }
  .review { flex: 0 0 100%; }
}

