:root {
  --zauna-blue: #0b0b8f;
  --zauna-blue-hover: #00008b;
  --zauna-border: rgba(0, 0, 0, .10);
  --zauna-bottom-nav-h: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  min-height: 100vh;
  opacity: 1;
  transition: opacity .18s ease, transform .18s ease, filter .18s ease;
}

body.zauna-page-leaving {
  opacity: .92;
  transform: translateY(6px);
  filter: saturate(.96);
}

body.zauna-page-ready {
  opacity: 1;
}

.zauna-hide-mobile {
  display: none !important;
}

.zauna-common-wrapper {
  position: relative;
  z-index: 20;
}

.zauna-header-container {
  position: relative;
  max-width: 1400px;
  margin: 10px auto 0;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .92) !important;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.zauna-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.zauna-logo-link,
.zauna-logo-link img {
  display: block;
}

.zauna-logo-link {
  flex: 0 0 auto;
}

.zauna-logo-link img {
  width: 60px;
  height: auto;
}

.zauna-social-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.zauna-social-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zauna-social-buttons img {
  width: 30px;
  height: 30px;
  display: block;
}

.zauna-nav-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  /* точка отсчёта для едущей полоски */
  position: relative;
}

/* Полоска под активным пунктом меню. При переходе между страницами
   common.js ставит её на прежнее место и сразу двигает на новое —
   получается переезд, хотя страница успела перезагрузиться. */
.zauna-nav-underline {
  position: absolute;
  /* с отступом: вплотную к кнопке того же цвета полоска читалась
     как часть самой кнопки, а не как указатель страницы */
  bottom: -10px;
  left: 0;
  height: 3px;
  width: 0;
  border-radius: 999px;
  background: #4f6dff;
  opacity: 0;
  pointer-events: none;
  transform: translateX(0);
  transition: transform .34s cubic-bezier(.34, .01, .2, 1),
              width .34s cubic-bezier(.34, .01, .2, 1),
              opacity .2s ease;
}

.zauna-nav-underline.is-visible {
  opacity: 1;
}

.zauna-header-actions {
  margin-left: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.zauna-nav-button {
  cursor: pointer;
  background: var(--zauna-blue);
  color: #fff !important;
  border: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
  will-change: transform;
}

button.zauna-nav-button {
  font-family: inherit;
}

.zauna-nav-button:hover {
  background: var(--zauna-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(11, 11, 143, .18);
}

.zauna-user-section-container,
.zauna-cart-button {
  position: static !important;
  top: auto !important;
  right: auto !important;
  z-index: auto !important;
}

.zauna-user-section-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zauna-user-section {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .95);
  padding: 8px 12px;
  border-radius: 50px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .10);
}

.zauna-user-name {
  color: var(--zauna-blue);
  margin-right: 6px;
  font-weight: 500;
}

.zauna-cart-button {
  position: relative !important;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.zauna-cart-button img {
  display: block;
}

.zauna-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff6b6b;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zauna-common-footer {
  /* Прижимаем подвал к низу окна на коротких страницах. На «Товар не найден»
     или «Заказ не найден» содержимого мало, и подвал повисал посреди экрана,
     а под ним оставалась голая подложка. У body уже стоит min-height: 100vh,
     поэтому липкое положение с отступом в высоту экрана опускает подвал вниз,
     а на длинных страницах он ведёт себя как обычно. */
  position: sticky;
  top: 100vh;
  background-color: rgba(0, 0, 0, 0.8) !important;
  color: #fff !important;
  padding: 30px 20px !important;
  text-align: center;
  margin: 40px 0 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100%;
  box-sizing: border-box;
}

.zauna-common-footer .footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.zauna-common-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.zauna-common-footer .footer-links a {
  color: #fff !important;
  text-decoration: none;
}

.zauna-common-footer .footer-links a:hover {
  text-decoration: underline;
}

.zauna-common-footer p {
  margin: 0;
  color: #fff !important;
}

.zauna-page-loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 248, 252, .78);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s ease;
  z-index: 9999;
}

.zauna-page-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.zauna-page-loader__box {
  min-width: 150px;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .14);
  display: flex;
  align-items: center;
  gap: 12px;
}

.zauna-page-loader__spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(11, 11, 143, .18);
  border-top-color: var(--zauna-blue);
  animation: zauna-spin .65s linear infinite;
  flex: 0 0 auto;
}

.zauna-page-loader__text {
  color: var(--zauna-blue);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
}

@keyframes zauna-spin {
  to {
    transform: rotate(360deg);
  }
}

.zauna-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--zauna-bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .98);
  border-top: 1px solid var(--zauna-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 2000;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .10);
}

.zauna-bottom-nav a {
  flex: 1;
  text-decoration: none;
  color: #7a7a7a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  padding: 8px 4px;
}

.zauna-bottom-nav .zauna-nav-ico {
  font-size: 22px;
  line-height: 1;
}

.zauna-bottom-nav a.active {
  color: var(--zauna-blue);
  font-weight: 600;
}

.zauna-bottom-nav .zauna-badge {
  position: absolute;
  margin-left: 18px;
  margin-top: -20px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff6b6b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 1180px) {
  .zauna-header-container {
    gap: 10px;
    padding: 10px 14px;
  }

  .zauna-header-left,
  .zauna-nav-buttons {
    gap: 8px;
  }

  .zauna-header-actions {
    gap: 8px;
  }

  .zauna-nav-button {
    font-size: 13px;
    padding: 8px 11px;
  }

  .zauna-cart-button {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 920px) {
  .zauna-header-container {
    align-items: flex-start;
  }

  .zauna-header-left {
    gap: 12px;
  }

  .zauna-nav-buttons {
    width: 100%;
    padding-top: 2px;
  }

  .zauna-user-section {
    padding: 6px 10px;
  }
}

/* ============ МЕЛКИЕ АНИМАЦИИ ПО ВСЕМУ САЙТУ ============
   Правило одно: анимируем только то, на что человек нажал или что
   появилось. Длительности 0.15–0.34 сек — заметно, но не заставляет ждать.
   Двигаем исключительно transform и opacity: их браузер рисует на
   видеокарте и не пересчитывает раскладку страницы. */

@keyframes zaunaFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes zaunaPop {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1);
  }
}

/* Появление блоков при прокрутке. Класс вешает common.js, и только
   если он реально дошёл до элемента, — без JS всё видно сразу. */
.zauna-reveal {
  opacity: 0;
  transform: translateY(10px);
}

.zauna-reveal.zauna-revealed {
  animation: zaunaFadeUp .34s cubic-bezier(.34, .01, .2, 1) both;
}

/* Отклик на нажатие: кнопка чуть проседает под пальцем. */
button:active,
.zauna-nav-button:active,
.btn:active,
[class*="-btn"]:active,
[class*="-button"]:active {
  transform: scale(.97);
}

/* Поля ввода: плавная подсветка рамки вместо резкого скачка. */
input,
textarea,
select {
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

/* Значок с числом (корзина, уведомления) подпрыгивает при изменении. */
.zauna-bump {
  animation: zaunaPop .32s cubic-bezier(.34, .01, .2, 1);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body,
  .zauna-page-loader,
  .zauna-nav-button,
  .zauna-nav-underline {
    transition: none !important;
  }

  .zauna-page-loader__spinner {
    animation-duration: 1.2s;
  }

  /* Человек попросил систему не анимировать — уважаем это целиком:
     блоки просто есть на месте, ничего не выезжает и не прыгает. */
  .zauna-reveal,
  .zauna-reveal.zauna-revealed {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .zauna-bump {
    animation: none;
  }

  button:active,
  .zauna-nav-button:active,
  .btn:active,
  [class*="-btn"]:active,
  [class*="-button"]:active {
    transform: none;
  }
}

@media (min-width: 768px) {
  .zauna-bottom-nav {
    display: none !important;
  }

  body {
    padding-bottom: 0;
  }
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(var(--zauna-bottom-nav-h) + env(safe-area-inset-bottom));
  }

  .cart-button,
  .user-section-container,
  .nav-buttons,
  .zauna-cart-button,
  .zauna-user-section-container,
  .zauna-nav-buttons,
  .zauna-header-actions {
    display: none !important;
  }

  .zauna-header-container {
    justify-content: flex-start;
    padding: 12px 14px;
    gap: 12px;
  }

  .zauna-header-left {
    flex-wrap: nowrap;
    gap: 10px;
  }

  .zauna-logo-link img {
    width: 54px;
  }

  .zauna-social-buttons {
    gap: 8px;
  }

  .zauna-social-buttons img {
    width: 26px;
    height: 26px;
  }

  .zauna-common-footer {
    margin-top: 24px;
    padding: 24px 16px !important;
  }

  .zauna-common-footer .footer-links {
    gap: 12px;
    margin-bottom: 14px;
  }

  .zauna-page-loader__box {
    min-width: 136px;
    padding: 14px 16px;
  }
}
