:root {
  --bg: #08090b;
  --bg-elevated: #0f1116;
  --surface: #15171d;
  --surface-2: #1c1f27;
  --border: #2b2f3a;
  --text: #f1f3f7;
  --text-muted: #97a0b0;
  --accent: #3d7bf5;
  --accent-hover: #5b93ff;
  /* Заливка кнопок — глубже основного синего, чтобы белый текст проходил по контрасту */
  --accent-fill: #2158d8;
  --accent-fill-hover: #2f6ae8;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(61, 123, 245, 0.13);
  --accent-line: rgba(61, 123, 245, 0.34);
  --accent-line-strong: rgba(61, 123, 245, 0.55);
  --radius: 14px;
  --radius-sm: 9px;
  --container: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* Атрибут hidden должен побеждать любые display из стилей ниже */
[hidden] { display: none !important; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--text-muted); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }

.btn-accent {
  background: var(--accent-fill);
  color: var(--accent-contrast);
}
.btn-accent:hover { background: var(--accent-fill-hover); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 9px 18px; font-size: 14px; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 10, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 76px;
}

.logo { display: flex; align-items: center; gap: 11px; }

/* flex-shrink: 0 — иначе flexbox сжимает только ширину картинки, искажая пропорции лого */
.logo-img { height: 34px; width: auto; display: block; flex-shrink: 0; }

.admin-badge {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 30px;
  margin-right: auto;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.site-nav a:hover, .site-nav a.active { color: var(--text); }
.site-nav a.active { color: var(--accent); }

.header-cta { display: flex; align-items: center; gap: 18px; }

.header-phone {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
.header-phone:hover { color: var(--accent); }

.nav-toggle { display: none; }
.nav-burger { display: none; }

/* ---------- Хиро ---------- */

.hero {
  position: relative;
  padding: 110px 0 96px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 480px at 78% 8%, rgba(61, 123, 245, 0.18), transparent 68%),
    radial-gradient(700px 420px at 8% 92%, rgba(120, 140, 175, 0.10), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 780px; }

.hero-eyebrow {
  display: inline-block;
  padding: 7px 15px;
  margin-bottom: 26px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 100px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.hero h1 .accent { color: var(--accent); }

.hero-sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-muted);
  max-width: 570px;
  margin-bottom: 38px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 62px; }

.hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.stat {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-value {
  display: block;
  font-size: 27px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label { font-size: 14px; color: var(--text-muted); }

/* ---------- Секции ---------- */

.section { padding: 90px 0; }
.section-alt { background: var(--bg-elevated); border-block: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 42px;
}

.section-head h2 {
  font-size: clamp(27px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-head p { color: var(--text-muted); margin-top: 10px; max-width: 560px; }

/* ---------- Карточки авто ---------- */

.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 26px;
}

.car-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}

.car-card:hover {
  border-color: var(--accent-line-strong);
  transform: translateY(-4px);
}

.car-photo {
  position: relative;
  background: var(--surface-2);
}

/* ---------- Галерея ---------- */

.gallery {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}

.gallery:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Одно соотношение сторон везде на сайте — фото приводятся к нему при загрузке
   в админке (lib/processPhoto.js), поэтому object-fit: cover ложится без обрезки. */
.gallery-card { aspect-ratio: 16 / 10; }
.gallery-detail { aspect-ratio: 16 / 10; border-radius: var(--radius); }

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.gallery-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-slide img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(8, 9, 11, 0.66);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.22s, background 0.22s, border-color 0.22s;
}

.gallery-nav svg { width: 20px; height: 20px; }
.gallery-nav:hover { background: var(--accent-fill); border-color: var(--accent-fill); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery:hover .gallery-nav,
.gallery:focus-within .gallery-nav { opacity: 1; }

.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 7px;
}

.gallery-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  background: rgba(241, 243, 247, 0.42);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}

.gallery-dot.active { background: var(--accent); width: 20px; border-radius: 4px; }

/* На тач-устройствах стрелки видны всегда — наведения там нет */
@media (hover: none) {
  .gallery-nav { opacity: 1; }
}

.car-class {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 12px;
  background: rgba(8, 8, 10, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.car-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px;
}

.car-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.car-title a:hover { color: var(--accent); }

.car-desc {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.car-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 12px;
  margin: 20px 0;
  padding: 16px 0;
  border-block: 1px solid var(--border);
}

.car-specs li { display: flex; flex-direction: column; gap: 2px; }
.spec-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.spec-value { font-size: 14px; font-weight: 600; }

.car-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
}

.car-actions { display: flex; gap: 8px; }

.price-value { display: block; font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.price-unit { font-size: 13px; color: var(--text-muted); }

/* ---------- Страница автомобиля ---------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 26px;
  font-size: 14px;
  color: var(--text-muted);
}
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .current { color: var(--text); }

.car-detail-section { padding: 30px 0 20px; }

.car-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 36px;
  align-items: start;
}

.detail-info { padding-top: 34px; }

.car-class-inline {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 100px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.detail-info h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 28px;
}

.detail-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.detail-specs li { display: flex; flex-direction: column; gap: 4px; }

.detail-description, .detail-terms { margin-top: 34px; }
.detail-description h2, .detail-terms h2 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 12px;
}
.detail-description p { color: var(--text-muted); }

/* pre-line — переносы строк ровно такие, как ввёл администратор, без автоматической разбивки на абзацы */
.description-text { white-space: pre-line; }

.terms-list { display: grid; gap: 10px; }
.terms-list li {
  position: relative;
  padding-left: 24px;
  color: var(--text-muted);
}
.terms-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 10px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

/* ---------- Блок бронирования ---------- */

.detail-side { position: sticky; top: 100px; }

.booking-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.booking-price { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.booking-price-value {
  display: block;
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.15;
}
.booking-price-unit { font-size: 14px; color: var(--text-muted); }

.booking-label { font-size: 14px; color: var(--text-muted); }

.booking-days {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0;
}

.days-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.days-btn {
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text);
  font-size: 19px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.days-btn:hover { background: var(--accent-fill); color: #fff; }

.days-input {
  width: 46px;
  padding: 6px 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}
.days-input::-webkit-outer-spin-button,
.days-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.days-input:focus { outline: none; }

.booking-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 8px;
  border-top: 1px solid var(--border);
}

.booking-total-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.booking-total-value { font-size: 23px; font-weight: 800; }

/* Цена без скидки — мелко и зачёркнуто, рядом с итоговой */
.booking-total-old {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.booking-saving {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
}

.discount-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  background: var(--accent-fill);
  border-radius: 100px;
  color: var(--accent-contrast);
  font-size: 13px;
  font-weight: 700;
}

.discount-text { font-size: 13px; color: var(--text); }
.discount-text b { font-weight: 700; }

.booking-note { font-size: 13px; color: var(--text-muted); margin-top: 14px; }

/* Отступ задаётся самим блоком кнопок, чтобы он не пропадал
   вместе со скрытой подсказкой или блоком скидки */
.booking-actions { display: grid; gap: 10px; margin-top: 22px; }
.booking-btn { width: 100%; }
.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

.booking-hours {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Шаги ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.step {
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  color: var(--accent);
  font-size: 19px;
  font-weight: 800;
}

.step h3 { font-size: 19px; font-weight: 700; margin-bottom: 9px; }
.step p { color: var(--text-muted); font-size: 15px; }

/* ---------- Фильтр каталога ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-chip {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}

.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-contrast); }

.page-head { padding: 66px 0 42px; border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: clamp(32px, 4.6vw, 48px); font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--text-muted); margin-top: 12px; max-width: 620px; }

/* ---------- Баннеры разделов (фоновые изображения) ---------- */

.banner {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* Затемнение снизу — текст остаётся читаемым на любом участке фото,
   плюс плавный переход в сплошной фон страницы у нижнего края. */
.banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 9, 11, 0.2) 0%, rgba(8, 9, 11, 0.62) 65%, var(--bg) 100%);
  pointer-events: none;
}

.banner > .container { position: relative; z-index: 1; }

.page-head.banner {
  display: flex;
  align-items: flex-end;
  min-height: 260px;
  padding-bottom: 46px;
}

.section-banner {
  display: flex;
  align-items: flex-end;
  min-height: 210px;
  padding: 58px 0 34px;
  border-bottom: 1px solid var(--border);
}

.section-banner .section-head { margin-bottom: 0; width: 100%; }

.empty-state {
  padding: 70px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

/* ---------- Контакты ---------- */

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.contact-card {
  padding: 30px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-card h3 { font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; font-weight: 600; }
.contact-card .value { font-size: 20px; font-weight: 700; }
.contact-card a.value:hover { color: var(--accent); }
.contact-card .sub { color: var(--text-muted); font-size: 14px; margin-top: 8px; }

.about-block {
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 60px;
}
.about-block h2 { font-size: 27px; font-weight: 800; margin-bottom: 16px; }
.about-block p { color: var(--text-muted); max-width: 780px; }
.about-block p + p { margin-top: 12px; }

.faq-item {
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.faq-item + .faq-item { margin-top: 14px; }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 22px; line-height: 1; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { color: var(--text-muted); margin-top: 12px; font-size: 15px; }

/* ---------- CTA-полоса ---------- */

.cta-band {
  padding: 54px 44px;
  background: linear-gradient(120deg, rgba(61, 123, 245, 0.16), rgba(61, 123, 245, 0.03));
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.cta-band h2 { font-size: clamp(24px, 3vw, 33px); font-weight: 800; letter-spacing: -0.02em; }
.cta-band p { color: var(--text-muted); margin-top: 8px; }
.cta-band .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Футер ---------- */

.site-footer {
  margin-top: 90px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
}

.footer-brand p { margin-top: 16px; font-size: 15px; max-width: 380px; }

.footer-col h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; color: var(--text-muted); font-weight: 600; }
.footer-col a { display: block; font-size: 15px; padding: 4px 0; color: var(--text); }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 22px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* ---------- 404 ---------- */

.error-page { padding: 130px 0; text-align: center; }
.error-page h1 { font-size: 72px; font-weight: 800; color: var(--accent); }
.error-page p { color: var(--text-muted); margin: 12px 0 28px; }

/* ---------- Админ-панель ---------- */

.admin-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.admin-header { border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.admin-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.admin-header-actions { display: flex; align-items: center; gap: 10px; }

.admin-main { padding: 42px 24px 80px; }

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.admin-page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.small { font-size: 13px; }

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th {
  padding: 15px 18px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }

.admin-thumb { width: 84px; height: 56px; object-fit: cover; border-radius: 8px; }
.admin-thumb-empty {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-muted);
}

.admin-row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.admin-row-actions form { display: inline; }

.btn-danger { background: transparent; border-color: #6b2c2c; color: #e08585; }
.btn-danger:hover { background: #6b2c2c; color: #fff; }

/* ---------- Формы ---------- */

.admin-form {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea { resize: vertical; }
.field input[type="file"] { font-size: 14px; color: var(--text-muted); }
.field small { font-size: 13px; }

.checkbox-field { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; cursor: pointer; }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--accent); }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.photo-list-hint { margin: -6px 0 12px; font-size: 13px; }

.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.photo-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.photo-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }

.photo-cover-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 3px 9px;
  background: var(--accent-fill);
  border-radius: 100px;
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.photo-item-controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.photo-remove { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.photo-remove input { accent-color: #e08585; }

.photo-move {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
}
.photo-move:hover:not(:disabled) { background: var(--accent-fill); }
.photo-move:disabled { opacity: 0.3; cursor: default; }

.preview-move-controls { display: flex; gap: 4px; justify-content: center; }
.preview-move {
  width: 24px;
  height: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
}
.preview-move:hover:not(:disabled) { background: var(--accent-fill); }
.preview-move:disabled { opacity: 0.3; cursor: default; }

.alert {
  padding: 14px 18px;
  margin-bottom: 22px;
  background: rgba(224, 133, 133, 0.1);
  border: 1px solid #6b2c2c;
  border-radius: var(--radius-sm);
  color: #e8a0a0;
  font-size: 14px;
}

/* ---------- Экран входа ---------- */

.admin-auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }

.admin-auth-card {
  width: 100%;
  max-width: 400px;
  padding: 38px 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-auth-card h1 { font-size: 23px; font-weight: 800; margin: 22px 0 24px; }
.admin-auth-card .btn { width: 100%; margin-top: 6px; }
.back-link { display: block; margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-muted); }
.back-link:hover { color: var(--accent); }

/* ---------- Адаптив ---------- */

@media (max-width: 980px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .car-detail { grid-template-columns: 1fr; gap: 26px; }
  .detail-side { position: static; }
  .detail-info { padding-top: 4px; }
}

@media (max-width: 860px) {
  .header-inner { height: 66px; gap: 16px; }
  .logo-img { height: 22px; }
  .nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
  }
  .nav-burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    background: var(--bg-elevated);
    border-bottom: 1px solid transparent;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }
  .site-nav a { padding: 15px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
  .nav-toggle:checked ~ .site-nav {
    max-height: 260px;
    padding: 8px 24px 16px;
    border-bottom-color: var(--border);
  }

  .header-cta { order: -1; margin-left: auto; }
  .header-phone { display: none; }

  .hero { padding: 74px 0 66px; }
  .section { padding: 66px 0; }
  .cta-band { padding: 36px 26px; }
  .about-block { padding: 28px 24px; }
}

@media (max-width: 520px) {
  .container, .admin-container { padding: 0 18px; }
  .admin-main { padding: 30px 18px 60px; }
  .admin-form { padding: 22px 18px; }
  .hero-stats { grid-template-columns: 1fr; }
  .cars-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .car-footer { flex-direction: column; align-items: stretch; }
  .car-actions { width: 100%; }
  .car-actions .btn { flex: 1; }
  .gallery-detail { border-radius: var(--radius-sm); }
  .booking-card { padding: 22px 18px; }
}

/* ---------- Зона загрузки фото в админке ---------- */

.photo-zone {
  position: relative;
  padding: 18px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, background 0.2s;
}

.photo-zone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.photo-zone.has-error { border-color: #e0574f; }

.photo-zone.has-error::after {
  content: attr(data-error);
  display: block;
  margin-top: 10px;
  color: #ff8a82;
  font-size: 13px;
}

.photo-zone input[type='file'] { max-width: 100%; }

.photo-zone-hint {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.photo-zone-hint kbd {
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: inherit;
  font-size: 12px;
}

.photo-zone-count {
  margin-top: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.photo-preview:empty { margin-top: 0; }

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 120px;
}

.preview-item-thumb {
  position: relative;
  width: 120px;
  height: 90px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.preview-item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(8, 9, 11, 0.78);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.preview-remove:hover { background: #e0574f; border-color: #e0574f; color: #fff; }
