/* =========================================================================
   Moscow-City Club — Event Layer v1 (страница /event)
   Подключается ПОСЛЕ assets/apart.css (общая тёмная тема с золотом,
   карточки t762, hero, силуэт). Здесь — поиск, таблица сравнения, FAQ,
   плавающие кнопки. Анимационные состояния — только при html.ev-js.
   ========================================================================= */

:root { --ev-field-h: 52px; }

/* Tilda ставит заголовку word-break: break-all — слова рвались посередине */
#allrecords .t-rec[data-record-type="712"] .t712__title { word-break: normal !important; overflow-wrap: break-word; hyphens: manual; }

/* ------------------------------------------------------------------ 1. Быстрый поиск в первом экране */
.ev-quick {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 30px; max-width: 620px; padding: 10px;
  border-radius: 20px; border: 1px solid rgba(255, 255, 255, .16);
  background: linear-gradient(160deg, rgba(22, 24, 30, .78), rgba(10, 12, 16, .62));
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9);
}
.ev-quick__f { flex: 1 1 130px; display: flex; flex-direction: column; gap: 6px; padding: 4px 8px; }
.ev-quick__f span { font: 600 11px/1 "TildaSans", Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--ap-ink-3); }
.ev-quick input, .ev-quick select {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--ap-border);
  background: rgba(255, 255, 255, .06); color: var(--ap-ink); font: 500 16px/1 "TildaSans", Arial, sans-serif;
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
}
.ev-quick select, .ev-search select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23FFD600' stroke-width='2'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.ev-quick select option, .ev-search select option { background: #111318; color: var(--ap-ink); }
.ev-quick input:focus, .ev-quick select:focus { outline: none; border-color: var(--ap-gold); box-shadow: 0 0 0 3px rgba(255, 214, 0, .18); }
.ev-quick__btn {
  flex: 1 1 190px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; margin: 4px;
  border: 0; border-radius: 14px; cursor: pointer; background: var(--ap-gold-grad); color: #1A1405;
  font: 700 15px/1 "TildaSans", Arial, sans-serif; letter-spacing: .03em;
  box-shadow: 0 14px 36px -14px rgba(255, 214, 0, .85); transition: transform .2s var(--ap-ease), box-shadow .3s;
}
.ev-quick__btn svg { width: 19px; height: 19px; }
.ev-quick__btn:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -14px rgba(255, 214, 0, 1); }
.ev-quick__btn:active { transform: scale(.97); }
.ev-quick__pop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; max-width: 640px; }
.ev-quick__pop > span { font-size: 13px; color: var(--ap-ink-3); margin-right: 2px; }
.ev-quick__tag {
  min-height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(7, 8, 11, .45); color: var(--ap-ink); font: 500 13px/1 "TildaSans", Arial, sans-serif;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .25s, color .25s, background-color .25s;
}
.ev-quick__tag:hover { border-color: var(--ap-gold); color: var(--ap-gold); }

/* ------------------------------------------------------------------ 2. Панель поиска */
.ev-search {
  position: relative; max-width: 1200px; margin: 34px auto 26px; padding: 30px 30px 22px; box-sizing: border-box;
  width: calc(100% - 40px); border-radius: 28px; border: 1px solid var(--ap-border);
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(255, 214, 0, .09), transparent 70%),
    linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--ap-shadow);
  scroll-margin-top: 90px;
}
.ev-search::before { content: ""; position: absolute; left: 30px; top: 0; width: 72px; height: 2px; background: var(--ap-gold-grad); }
.ev-search__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 20px; }
.ev-search__title { margin: 0; font-family: var(--ap-font-head); font-size: clamp(26px, 2.6vw, 36px); font-weight: 600; line-height: 1.15; color: var(--ap-ink); }
.ev-search__sub { margin: 0; font-size: 15px; color: var(--ap-ink-3); }

.ev-search__row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(170px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr); gap: 12px; }
.ev-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ev-field__l { font: 600 11px/1 "TildaSans", Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--ap-ink-3); }
.ev-field__box {
  position: relative; display: flex; align-items: center; height: var(--ev-field-h); border-radius: 14px;
  border: 1px solid var(--ap-border); background: rgba(7, 8, 11, .55); transition: border-color .25s, box-shadow .25s;
}
.ev-field__box:focus-within { border-color: var(--ap-gold); box-shadow: 0 0 0 3px rgba(255, 214, 0, .16); }
.ev-field__box > svg { flex: none; width: 19px; height: 19px; margin-left: 16px; color: var(--ap-gold); }
.ev-field__box input, .ev-field__box select {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ap-ink);
  font: 500 16px/1 "TildaSans", Arial, sans-serif; padding: 0 14px; outline: none; -webkit-appearance: none; appearance: none;
}
.ev-field__box input::placeholder { color: var(--ap-ink-3); opacity: 1; }
.ev-field__box input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.ev-step input { text-align: center; padding: 0 4px; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.ev-step input::-webkit-outer-spin-button, .ev-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ev-step__b {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: 0 3px; border: 0; border-radius: 11px;
  background: rgba(255, 255, 255, .06); color: var(--ap-ink); cursor: pointer; transition: background-color .2s, color .2s;
  touch-action: manipulation;
}
.ev-step__b svg { width: 16px; height: 16px; }
.ev-step__b:hover { background: rgba(255, 214, 0, .16); color: var(--ap-gold); }

.ev-search__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ev-chip svg { width: 15px; height: 15px; color: var(--ap-gold); }
.ev-chip[aria-pressed="true"] svg { color: #1A1405; }
.ev-search__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ap-border); }
.ev-search__res { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 15px; color: var(--ap-ink-2); }
.ev-search__res b { color: var(--ap-gold); font-variant-numeric: tabular-nums; }
.ev-reset {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ap-border); background: transparent; color: var(--ap-ink-2); font: 500 13px/1 "TildaSans", Arial, sans-serif;
  transition: color .2s, border-color .2s;
}
.ev-reset svg { width: 13px; height: 13px; }
.ev-reset:hover { color: var(--ap-gold); border-color: var(--ap-border-2); }
.ev-search__call { display: inline-flex; align-items: center; gap: 8px; color: var(--ap-gold) !important; text-decoration: none; font-weight: 600; font-size: 15px; }
.ev-search__call svg { width: 17px; height: 17px; }
.ev-search__call:hover span { text-decoration: underline; }

.ev-empty { max-width: 760px; margin: 0 auto 30px; }
.ev-empty p { margin: 0 0 12px; font-size: 16px; line-height: 1.6; }
.ev-empty a { color: var(--ap-gold); font-weight: 700; font-size: 18px; margin-right: 10px; }

/* Подсветка подходящей вместимости */
.ev-card .ap-badge.is-hit { border-color: rgba(255, 214, 0, .7); background: rgba(255, 214, 0, .14); color: var(--ap-gold-soft); }

/* ------------------------------------------------------------------ 3. Статичные секции: сравнение и FAQ */
.ev-rec { padding: 40px 0; }
.ev-sec { max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; color: var(--ap-ink); }
.ev-kicker { margin: 0 0 12px; font: 600 12px/1 "TildaSans", Arial, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--ap-gold); }
.ev-h2 { margin: 0 0 18px; max-width: 900px; font-family: var(--ap-font-head); font-size: clamp(28px, 3vw, 42px); font-weight: 600; line-height: 1.15; color: var(--ap-ink); }
.ev-answer { max-width: 880px; margin: 0 0 26px; font-size: 18px; line-height: 1.7; color: var(--ap-ink-2); }
.ev-answer a, .ev-faq__cta a, .ev-table a { color: var(--ap-gold); }
.ev-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 28px; padding: 0; list-style: none; }
.ev-facts li { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--ap-border); background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); }
.ev-facts b { display: block; font-family: var(--ap-font-head); font-size: clamp(24px, 2.4vw, 34px); line-height: 1; color: var(--ap-gold); font-variant-numeric: tabular-nums; }
.ev-facts span { display: block; margin-top: 8px; font-size: 13px; color: var(--ap-ink-2); }

.ev-table-wrap { overflow-x: auto; border-radius: 22px; border: 1px solid var(--ap-border); background: rgba(255, 255, 255, .025); }
.ev-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; color: var(--ap-ink-2); }
.ev-table caption { caption-side: bottom; padding: 12px 18px; text-align: left; font-size: 12px; color: var(--ap-ink-3); }
.ev-table th { position: sticky; top: 0; padding: 14px 16px; text-align: left; white-space: nowrap; font: 600 11px/1 "TildaSans", Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--ap-ink-3); background: #101218; border-bottom: 1px solid var(--ap-border); }
.ev-table td { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: top; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-table td:nth-child(2) { white-space: normal; min-width: 260px; }
.ev-table td:nth-child(2) span { display: block; margin-top: 4px; font-size: 13px; color: var(--ap-ink-3); }
.ev-table td:first-child b { font-family: var(--ap-font-head); font-size: 22px; color: var(--ap-gold); }
.ev-table tbody tr { transition: background-color .2s; }
.ev-table tbody tr.is-link { cursor: pointer; }
.ev-table tbody tr:hover { background: rgba(255, 214, 0, .05); }
.ev-table tbody tr:last-child td { border-bottom: 0; }

.ev-faq { max-width: 960px; }
.ev-faq details { border-bottom: 1px solid var(--ap-border); }
.ev-faq summary { display: flex; align-items: center; gap: 16px; padding: 22px 0; cursor: pointer; list-style: none; }
.ev-faq summary::-webkit-details-marker { display: none; }
.ev-faq__n { flex: none; width: 34px; font: 600 12px/1 "TildaSans", Arial, sans-serif; letter-spacing: .1em; color: var(--ap-gold); }
.ev-faq__q { flex: 1; margin: 0; font: 600 clamp(17px, 1.5vw, 20px)/1.4 "TildaSans", Arial, sans-serif; color: var(--ap-ink); transition: color .25s; }
.ev-faq summary:hover .ev-faq__q { color: var(--ap-gold-soft); }
.ev-faq__i { flex: none; position: relative; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--ap-border); transition: transform .4s var(--ap-ease), background-color .3s; }
.ev-faq__i::before, .ev-faq__i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; margin: -.75px 0 0 -5.5px; background: var(--ap-ink); transition: transform .4s var(--ap-ease); }
.ev-faq__i::after { transform: rotate(90deg); }
.ev-faq details[open] .ev-faq__i { transform: rotate(180deg); background: var(--ap-gold); border-color: transparent; }
.ev-faq details[open] .ev-faq__i::before, .ev-faq details[open] .ev-faq__i::after { background: #1A1405; }
.ev-faq details[open] .ev-faq__i::after { transform: rotate(0deg); }
.ev-faq__a { margin: 0; padding: 0 50px 22px 50px; font-size: 16px; line-height: 1.7; color: var(--ap-ink-2); }
.ev-faq details[open] .ev-faq__a { animation: ap-faq-in .45s var(--ap-ease); }
.ev-faq__cta { margin: 26px 0 0; font-size: 16px; color: var(--ap-ink-2); }
.ev-faq__cta a { font-weight: 700; }

/* ------------------------------------------------------------------ 4. Плавающие кнопки */
.ev-fab {
  position: fixed; right: 88px; bottom: 22px; z-index: 9989; display: flex; gap: 8px; padding: 6px; border-radius: 999px;
  background: rgba(10, 12, 16, .82); border: 1px solid var(--ap-border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 18px 50px -14px rgba(0, 0, 0, .9);
  transform: translateY(140%); opacity: 0; pointer-events: none; transition: transform .55s var(--ap-ease), opacity .35s;
}
.ev-fab.is-on { transform: none; opacity: 1; pointer-events: auto; }
.ev-fab__b {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 14px/1 "TildaSans", Arial, sans-serif; letter-spacing: .03em; text-decoration: none; touch-action: manipulation;
}
.ev-fab__b svg { width: 18px; height: 18px; }
.ev-fab__b--search { background: var(--ap-gold-grad); color: #1A1405 !important; }
.ev-fab__b--call { background: rgba(255, 255, 255, .08); color: var(--ap-ink) !important; }
.ev-fab__b--call:hover { background: rgba(255, 255, 255, .14); }

/* ------------------------------------------------------------------ 5. Адаптив */
@media (max-width: 1100px) {
  .ev-search__row { grid-template-columns: 1fr 1fr; }
  .ev-field--q { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .ev-quick { margin-top: 22px; }
  .ev-facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ev-search { width: calc(100% - 24px); padding: 24px 16px 18px; border-radius: 22px; margin-top: 24px; }
  .ev-search::before { left: 16px; }
  .ev-search__row { grid-template-columns: 1fr; gap: 10px; }
  .ev-field--f, .ev-field--s { grid-column: auto; }
  .ev-search__chips { flex-wrap: nowrap; overflow-x: auto; margin: 16px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  .ev-search__chips::-webkit-scrollbar { display: none; }
  .ev-search__foot { flex-direction: column; align-items: flex-start; }
  .ev-quick { padding: 8px; }
  .ev-quick__f { flex-basis: 40%; }
  .ev-quick__btn { flex-basis: 100%; }
  .ev-rec { padding: 28px 0; }
  .ev-sec { padding: 0 16px; }
  .ev-answer { font-size: 16px; }
  .ev-facts li { padding: 14px 16px; }
  /* Таблица → карточки */
  .ev-table-wrap { overflow: visible; border: 0; background: none; }
  .ev-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ev-table, .ev-table tbody, .ev-table tr, .ev-table td { display: block; }
  .ev-table tr { margin-bottom: 10px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--ap-border); background: rgba(255, 255, 255, .03); }
  .ev-table td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; white-space: normal; }
  .ev-table td::before { content: attr(data-l); flex: none; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ap-ink-3); }
  .ev-table td:nth-child(2) { display: block; min-width: 0; }
  .ev-table td:nth-child(2)::before { display: block; margin-bottom: 4px; }
  .ev-table caption { display: block; width: auto; padding: 4px 0; }
  .ev-faq summary { gap: 12px; padding: 18px 0; }
  .ev-faq__n { width: 26px; }
  .ev-faq__a { padding: 0 4px 20px 38px; }
  .ev-fab { left: 12px; right: auto; bottom: 78px; }
  .ev-fab__b--call { display: none; } /* на телефоне есть нижняя панель Tilda со звонком */
  .ev-fab__b { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html.ev-js .ev-sec, html.ev-js .ev-search { opacity: 1 !important; transform: none !important; }
}
