/* ============================================================
   777niva.ru — собственные стили (попапы, форма заказа, футер,
   служебные страницы). Всё, что не входит в перенесённую
   сетку Тильды (tilda.css) и стили зеро-блоков в index.html.
   ============================================================ */

:root {
  --accent: #5497ea;
  --dark: #1f1f1f;
  --dark-2: #272727;
}

html { scroll-behavior: smooth; }
body.t-body { background: var(--dark); }
body.popup-open { overflow: hidden; }

/* ---------- Попап товара ---------- */
.np-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(0,0,0,.75);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.np-overlay.is-open { opacity: 1; pointer-events: auto; }

.np-popup {
  position: fixed; inset: 0; z-index: 9991;
  display: none; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.np-popup.is-open { display: block; }

.np-popup__box {
  position: relative;
  width: 100%; max-width: 790px;
  margin: 68px auto;
  background: #fff;
}
.np-popup__close {
  position: fixed; top: 20px; right: 24px; z-index: 9995;
  width: 36px; height: 36px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
.np-popup__close svg { width: 100%; height: 100%; display: block; }

.np-popup__gallery { position: relative; background: #f5f5f5; }
.np-popup__img {
  width: 100%; height: auto; aspect-ratio: 3 / 2;
  object-fit: contain; display: block;
}
.np-popup__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.np-popup__nav_prev { left: 14px; }
.np-popup__nav_next { right: 14px; }
.np-popup__nav[hidden] { display: none; }

.np-popup__body { padding: 30px 60px 40px; }
.np-popup__title {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 28px; font-weight: 600; color: #000;
  line-height: 1.25; margin: 0 0 8px;
}
.np-popup__sku {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 15px; color: #8a8a8a; margin: 0 0 18px;
}
.np-popup__price {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 24px; font-weight: 600; color: #000; margin: 0 0 20px;
}
.np-popup__descr {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 16px; line-height: 1.55; color: #111; margin: 0 0 28px;
  white-space: pre-line;
}
.np-popup__buy {
  display: inline-block;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 16px; font-weight: 600; color: #fff;
  background: var(--accent);
  border: 0; border-radius: 40px; cursor: pointer;
  padding: 18px 48px;
  transition: opacity .2s ease;
}
.np-popup__buy:hover { opacity: .85; }
.np-popup__buy[disabled] {
  background: #f5d0a9; color: #8a8a8a; cursor: default;
}

@media screen and (max-width: 780px) {
  .np-popup__box { margin: 0 auto; min-height: 100%; }
  .np-popup__body { padding: 24px 20px 36px; }
  .np-popup__close { top: 12px; right: 12px; }
  .np-popup__close svg g { fill: #000; }
}

/* ---------- Плавающая кнопка корзины ---------- */
.np-cart-btn {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9989;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #fca237;
  border: 0;
  color: #1f1f1f;
  cursor: pointer;
  display: inline-flex;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .2s ease;
}
.np-cart-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.3); }
.np-cart-btn__count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px;
  background: #1f1f1f; color: #fff;
  font: 700 12px/20px 'Manrope', Arial, sans-serif;
  text-align: center;
  box-sizing: border-box;
}
.np-cart-btn__pop {
  animation: np-cart-pop .35s cubic-bezier(.16, 1, .3, 1);
}
@keyframes np-cart-pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .np-cart-btn__pop { animation: none; }
}

/* ---------- Попап корзины ---------- */
.np-cart__box {
  position: relative;
  width: 100%; max-width: 620px;
  margin: 68px auto;
  background: #fff;
  padding: 32px 32px 28px;
  border-radius: 6px;
}
.np-cart__title {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 26px; font-weight: 600; color: #111;
  margin: 0 0 20px;
}
.np-cart__items { margin-bottom: 20px; }
.np-cart__item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}
.np-cart__item:last-child { border-bottom: 0; }
.np-cart__item-img {
  width: 64px; height: 64px;
  background: #f5f5f5; border-radius: 4px;
  object-fit: contain; display: block;
}
.np-cart__item-info {
  font-family: 'Manrope', Arial, sans-serif;
  min-width: 0;
}
.np-cart__item-title {
  font-size: 15px; font-weight: 600; color: #111;
  margin: 0 0 4px;
  overflow: hidden; text-overflow: ellipsis;
}
.np-cart__item-price {
  font-size: 13px; color: #666; margin: 0;
}
.np-cart__item-price .np-cart__promo-note {
  color: #f08a1c; font-weight: 600;
  margin-left: 8px;
}
.np-cart__item-side {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 8px;
  font-family: 'Manrope', Arial, sans-serif;
}
.np-cart__qty {
  display: inline-flex; align-items: center;
  border: 1px solid #ddd; border-radius: 20px;
  overflow: hidden;
}
.np-cart__qty button {
  width: 30px; height: 30px;
  background: #fff; border: 0; cursor: pointer;
  color: #111; font-size: 18px; line-height: 1;
}
.np-cart__qty button:hover { background: #f5f5f5; }
.np-cart__qty span {
  min-width: 28px; text-align: center;
  font-size: 14px; font-weight: 600;
}
.np-cart__item-total {
  font-size: 15px; font-weight: 600; color: #111;
  white-space: nowrap;
}
.np-cart__item-remove {
  background: none; border: 0; padding: 0;
  color: #999; font-size: 12px; cursor: pointer;
}
.np-cart__item-remove:hover { color: #d33; }

.np-cart__empty {
  padding: 40px 0;
  text-align: center;
  font-family: 'Manrope', Arial, sans-serif;
  color: #999;
}
.np-cart__summary {
  border-top: 1px solid #eee;
  padding-top: 16px;
}
.np-cart__row {
  display: flex; justify-content: space-between;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 15px; color: #444;
  margin-bottom: 8px;
}
.np-cart__row_promo { color: #f08a1c; font-weight: 600; }
.np-cart__row_total {
  font-size: 18px; font-weight: 700; color: #111;
  padding-top: 10px; margin-top: 6px;
  border-top: 1px solid #eee;
}
.np-cart__checkout {
  width: 100%;
  margin-top: 18px;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 16px; font-weight: 600; color: #fff;
  background: var(--accent);
  border: 0; border-radius: 40px;
  padding: 16px 20px; cursor: pointer;
  transition: opacity .2s ease;
}
.np-cart__checkout:hover { opacity: .9; }

@media screen and (max-width: 640px) {
  .np-cart__box { margin: 0 auto; min-height: 100%; border-radius: 0; padding: 24px 20px 28px; }
  .np-cart-btn { top: 12px; right: 12px; width: 46px; height: 46px; }
}

/* ---------- Форма заказа ---------- */
.np-order__box {
  position: relative;
  width: 100%; max-width: 560px;
  margin: 68px auto;
  background: var(--dark-2);
  padding: 44px 48px 48px;
  border-radius: 6px;
}
.np-order__title {
  font-family: 'ReformaGrotesk', Arial, sans-serif;
  font-size: 40px; font-weight: 600; color: #fff;
  letter-spacing: .5px; margin: 0 0 6px;
}
.np-order__subtitle {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 15px; color: #b9b9b9; margin: 0 0 26px; line-height: 1.5;
}
.np-order__product {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 15px; color: #fff;
  background: rgba(84,151,234,.15);
  border: 1px solid rgba(84,151,234,.5);
  border-radius: 6px; padding: 10px 14px; margin-bottom: 22px;
}
.np-field { margin-bottom: 16px; }
.np-field label {
  display: block;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 13px; color: #b9b9b9; margin-bottom: 6px;
}
.np-field input, .np-field textarea {
  width: 100%; box-sizing: border-box;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 16px; color: #fff;
  background: #1a1a1a; border: 1px solid #3a3a3a; border-radius: 6px;
  padding: 13px 14px; outline: none;
  transition: border-color .15s ease;
}
.np-field input:focus, .np-field textarea:focus { border-color: var(--accent); }
.np-field textarea { min-height: 80px; resize: vertical; }
.np-field input.np-invalid { border-color: #e05c5c; }
.np-order__submit {
  width: 100%;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 16px; font-weight: 600; color: #fff;
  background: var(--accent); border: 0; border-radius: 40px;
  padding: 18px 20px; cursor: pointer; margin-top: 8px;
  transition: opacity .2s ease;
}
.np-order__submit:hover { opacity: .85; }
.np-order__submit[disabled] { opacity: .5; cursor: wait; }
.np-order__note {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 12px; color: #777; margin-top: 14px; line-height: 1.5;
}
.np-order__note a { color: #999; }
.np-order__msg {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 15px; line-height: 1.5; margin-top: 16px;
  display: none;
}
.np-order__msg.ok { display: block; color: #7fd48a; }
.np-order__msg.err { display: block; color: #e05c5c; }

@media screen and (max-width: 600px) {
  .np-order__box { margin: 0 auto; min-height: 100%; border-radius: 0; padding: 40px 20px; }
}

/* ---------- Футер ---------- */
.site-footer {
  background: #111;
  padding: 26px 20px;
}
.site-footer__inner {
  max-width: 1160px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.site-footer__copy {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 13px; color: #777;
}
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer__nav a {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 13px; color: #999; text-decoration: none;
}
.site-footer__nav a:hover { color: #fff; }
@media screen and (max-width: 640px) {
  .site-footer__inner { flex-direction: column; text-align: center; }
}

/* ---------- Hero: slide-in текста + параллакс мокапов ---------- */
.np-slide-in {
  opacity: 0;
  transform: translate3d(-60px, 0, 0);
  transition: opacity .9s cubic-bezier(.22, 1, .36, 1),
              transform  .9s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}
.np-slide-in.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
[data-parallax] { will-change: transform; }

/* Падение сверху для карточек товаров (второй экран) */
.np-drop-in {
  opacity: 0;
  transform: translate3d(0, -80px, 0);
  transition: opacity .8s cubic-bezier(.22, 1, .36, 1),
              transform  .8s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}
.np-drop-in.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .np-slide-in,
  .np-drop-in {
    transition: none;
    opacity: 1;
    transform: none;
  }
  [data-parallax] { transform: none !important; }
}

/* ---------- Служебные страницы (усл., оферта, реквизиты) ---------- */
.legal-page {
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.legal {
  flex: 1 0 auto;
  max-width: 760px; margin: 0 auto; width: 100%;
  box-sizing: border-box;
  padding: 60px 20px;
  font-family: 'Manrope', Arial, sans-serif;
  font-size: 17px; line-height: 1.55; color: #111;
}
.legal h1 { font-size: 20px; font-weight: 700; margin: 0 0 18px; }
.legal h2 { font-size: 17px; font-weight: 700; margin: 28px 0 12px; }
.legal p { margin: 0 0 12px; }
.legal a { color: #ff8562; text-decoration: none; }
.legal-page .site-footer { flex-shrink: 0; }
