/* ТК ЕВА — components */

/* ---------- buttons ---------- */
.btn {
  --bw: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  border-radius: var(--r-sm);
  min-height: 48px;
  transition:
    transform 0.18s var(--ease),
    background 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    color 0.25s var(--ease);
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn--ghost:hover {
  box-shadow: inset 0 0 0 1px var(--accent-line);
  color: var(--accent-2);
}
.btn--block {
  width: 100%;
}
.btn--lg {
  padding: 1.1rem 2rem;
  font-size: 1rem;
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--accent-2);
  transition: gap 0.2s var(--ease);
}
.textlink svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}
.textlink:hover {
  gap: 0.75rem;
}
.textlink:hover svg {
  transform: translateX(2px);
}

/* ---------- chips / tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.tag .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--bg-0);
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--ink-2);
}
.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: var(--topbar-h);
  flex-wrap: wrap;
}
.topbar__group {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-block: 3px; /* a11y WCAG 2.5.8 — lift small links to ≥24px target height */
  transition: color 0.2s var(--ease);
}
.topbar a:hover {
  color: var(--accent-2);
}
.footer__legal a {
  display: inline-block;
  padding-block: 3px; /* a11y WCAG 2.5.8 — ≥24px target height for small legal links */
}
.topbar svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}
.topbar__hours {
  color: var(--ink-3);
}

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.3s var(--ease);
}
.header.scrolled {
  border-color: var(--line-2);
  box-shadow: var(--shadow-1);
}
.header__row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}
.brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.brand__sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-top: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.05rem;
  margin-left: auto;
}
.nav__item {
  position: relative;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.55rem 0.62rem;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.nav__link:hover,
.nav__item:hover .nav__link,
.nav__link[aria-current="page"] {
  color: var(--ink);
}
.nav__link[aria-current="page"] {
  color: var(--accent-2);
}
.nav__link .chev {
  width: 14px;
  height: 14px;
  transition: transform 0.25s var(--ease);
}
.nav__item:hover .chev {
  transform: rotate(180deg);
}

/* mega menu */
.mega {
  position: absolute;
  /* touch the trigger (no dead zone); the 10px visual gap is a transparent top
     border that stays part of the menu's own hover area — so dragging from the
     nav link into the menu never loses :hover, regardless of header stacking */
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 320px;
  padding: 0.6rem;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-top: 10px solid transparent;
  background-clip: padding-box;
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0.22s;
  z-index: 20;
}
.mega--wide {
  min-width: 560px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}
.nav__item:hover .mega,
.nav__item:focus-within .mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mega__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.92rem;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease);
}
.mega__link:hover {
  background: var(--bg-3);
  color: var(--ink);
}
.mega__link .ico {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.header__call {
  padding-inline: 1.1rem;
  white-space: nowrap;
}
@media (max-width: 1320px) {
  .header__phone span {
    display: none;
  }
}
@media (max-width: 600px) {
  .header__call {
    display: none;
  }
}
.iconbtn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  border: 1px solid var(--line);
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.iconbtn:hover {
  color: var(--accent-2);
  border-color: var(--accent-line);
}
.iconbtn svg {
  width: 20px;
  height: 20px;
}
.header__phone {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
  font-family: var(--font-display);
}
.header__phone b {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.header__phone span {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--ink-3);
  font-weight: 500;
}

/* burger */
.burger {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.burger span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition:
    transform 0.25s var(--ease),
    opacity 0.25s var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- mobile drawer ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--bg-0);
  padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  visibility: hidden;
}
.drawer.open {
  transform: none;
  visibility: visible;
}
.drawer__group {
  border-bottom: 1px solid var(--line);
}
.drawer__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.05rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.drawer__toggle svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  transition: transform 0.25s var(--ease);
}
.drawer__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.drawer__sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease);
}
.drawer__sub.open {
  grid-template-rows: 1fr;
}
.drawer__sub > div {
  overflow: hidden;
}
.drawer__sub a {
  display: block;
  padding: 0.6rem 0 0.6rem 1rem;
  color: var(--ink-2);
  border-left: 2px solid var(--line);
}
.drawer__sub a:hover {
  color: var(--accent-2);
  border-color: var(--accent);
}
.drawer__cta {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

/* ---------- modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(6, 7, 9, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s var(--ease),
    visibility 0.3s;
}
.overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal {
  width: min(480px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  box-shadow: var(--shadow-2);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.3s var(--ease);
  position: relative;
}
.overlay.open .modal {
  transform: none;
}
.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
}
.modal__close:hover {
  color: var(--accent-2);
  background: var(--bg-3);
}
.modal__close svg {
  width: 22px;
  height: 22px;
}
.modal h3 {
  font-size: var(--fs-h3);
  text-transform: uppercase;
}
.modal p.sub {
  color: var(--ink-2);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

/* form */
.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.field label .req {
  color: var(--accent);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-0);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--ink);
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.field.invalid input {
  border-color: var(--danger);
}
.field__error {
  font-size: 0.8rem;
  color: var(--danger);
  display: none;
}
.field.invalid .field__error {
  display: block;
}
.consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-bottom: 1.2rem;
}
.consent input {
  margin-top: 3px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.consent a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.form__success {
  display: none;
  text-align: center;
  padding: 1rem 0;
}
.form__success svg {
  width: 56px;
  height: 56px;
  color: var(--ok);
  margin: 0 auto 1rem;
}
.modal.done form {
  display: none;
}
.modal.done .form__success {
  display: block;
}

/* ---------- cookie banner ---------- */
.cookie {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: var(--z-overlay);
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  transform: translateY(140%);
  transition: transform 0.5s var(--ease);
}
.cookie.show {
  transform: none;
}
.cookie p {
  flex: 1 1 240px;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.cookie a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie .btn {
  padding: 0.6rem 1.2rem;
  min-height: 40px;
}

/* to-top */
.totop {
  position: fixed;
  right: clamp(1rem, 2vw, 2rem);
  bottom: clamp(1rem, 2vw, 2rem);
  z-index: var(--z-header);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease),
    background 0.2s var(--ease);
}
.totop.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.totop:hover {
  background: var(--accent-2);
}
.totop svg {
  width: 22px;
  height: 22px;
}

/* ---------- mobile sticky CTA ---------- */
.mcta {
  display: none;
}
@media (max-width: 767px) {
  .mcta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-header);
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem calc(0.6rem + env(safe-area-inset-bottom));
    background: rgba(12, 13, 15, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    transform: translateY(120%);
    /* visibility:hidden also drops the links out of the tab order while the bar
       is off-screen (focusable controls must not live in an aria-hidden subtree) */
    visibility: hidden;
    transition:
      transform 0.4s var(--ease),
      visibility 0.4s;
  }
  .mcta.show {
    transform: none;
    visibility: visible;
  }
  /* reserve space so the fixed bar never hides the last strip of the footer */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .mcta__btn {
    flex: 1;
    min-height: 50px;
    padding-inline: 0.8rem;
    white-space: nowrap;
  }
  /* lift the to-top FAB above the sticky bar so they never overlap */
  .totop {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
  /* trim the reviews wall on mobile — first 5, rest live behind "Все отзывы" */
  #reviews-wall .review:nth-child(n + 6) {
    display: none;
  }
}

/* ---------- preloader (intro: hollow logo → camera flies through the letters → site) ---------- */
html.is-loading,
html.is-loading body {
  overflow: hidden;
}
html.preloaded .preloader {
  display: none;
}
.preloader {
  --logo-w: min(72vw, 760px);
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: transparent; /* the see-through happens via the veil's letter holes */
  animation: preIn 3.2s var(--ease) forwards;
  will-change: opacity;
}
/* dark cover for the whole screen, punched through ONLY at the logo letters */
.preloader__zoom {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  animation: preZoom 3.2s both;
  will-change: transform;
}
.preloader__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 58% at 50% 50%, rgba(254, 108, 23, 0.13), transparent 70%), var(--bg-0);
  transform: translateZ(0);
  -webkit-mask-image: linear-gradient(#000, #000), url(/tkeva/assets/preloader-holes.png);
  -webkit-mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: center, center;
  -webkit-mask-size:
    100% 100%,
    var(--logo-w) auto;
  -webkit-mask-composite: xor;
  mask-image: linear-gradient(#000, #000), url(/tkeva/assets/preloader-holes.png);
  mask-repeat: no-repeat, no-repeat;
  mask-position: center, center;
  mask-size:
    100% 100%,
    var(--logo-w) auto;
  mask-composite: exclude;
}
/* the logo artwork (wings/plate) sits exactly over the holes so the full mark reads */
.preloader__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--logo-w);
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.preloader__tag {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + var(--logo-w) * 0.118 + clamp(0.9rem, 2.4vw, 1.7rem));
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.92rem, 0.78rem + 1.4vw, 1.9rem);
  letter-spacing: clamp(0.2em, 0.1em + 0.9vw, 0.42em);
  text-indent: clamp(0.2em, 0.1em + 0.9vw, 0.42em);
  text-transform: uppercase;
  color: #fff;
  animation: preTag 3.2s both;
  will-change: transform, opacity;
}
@keyframes preIn {
  0% {
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  93% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}
@keyframes preZoom {
  0% {
    transform: scale(1);
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  13% {
    transform: scale(1.03);
  }
  40% {
    transform: scale(1.06);
    animation-timing-function: cubic-bezier(0.5, 0, 0.92, 0.22);
  }
  100% {
    transform: scale(34);
  }
}
@keyframes preTag {
  0%,
  8% {
    opacity: 0;
    transform: translateY(16px);
  }
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  38% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .preloader {
    animation: preInRM 0.6s ease 0.9s forwards;
  }
  .preloader__zoom,
  .preloader__tag {
    animation: none;
  }
  @keyframes preInRM {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
      visibility: hidden;
    }
  }
}
