:root {
  --bg: #ffffff;
  --panel: #f8f9fa;
  --text: #1a1a1a;
  --muted: #666666;
  --accent: #e19c5a;
  --accent-2: #7ac0c4;
  --stroke: #e0e0e0;
  --card: #ffffff;
  --gradient-1: #f0f0f0;
  --gradient-2: #f5f5f5;
  --header-bg: rgba(255, 255, 255, 0.9);
  --footer-bg: rgba(248, 249, 250, 0.95);
  --nav-mobile-bg: rgba(255, 255, 255, 0.98);
  --btn-primary-dark: #cc8748;
  --btn-primary-border: #b87536;
  --btn-primary-text: #1a120a;
  --input-bg: #ffffff;
  --media-bg: #f5f5f5;
  --media-bg-2: #f0f0f0;
  --media-bg-3: #ececec;
  --gallery-bg: #f5f5f5;
  --overlay-dark: rgba(0, 0, 0, 0.35);
  --overlay-light: rgba(255, 255, 255, 0.25);
  --shadow-sm: rgba(0, 0, 0, 0.04);
  --shadow-md: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
  background: radial-gradient(
      1200px 600px at 100% -10%,
      var(--gradient-1) 0%,
      transparent 60%
    ),
    radial-gradient(900px 500px at -10% 0%, var(--gradient-2) 0%, transparent 55%),
    var(--bg);
  line-height: 1.6;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--stroke);
  box-shadow: 0 2px 8px var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  position: relative;
}
.header-contacts {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}
.header-contacts a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.header-contacts .contact-phone {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header-contacts .contact-email {
  font-size: 13px;
  color: var(--muted);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
  font-size: 26px;
}
.logo img {
  height: 36px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 0 var(--shadow-md));
}
.logo span {
  color: var(--accent);
}
.nav {
  display: flex;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 18px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--shadow-sm);
}

/* Mobile burger menu */
.burger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.burger-line {
  width: 25px;
  height: 3px;
  background-color: var(--text);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.burger-menu.active .burger-line:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.burger-menu.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 60%),
    url("") center/cover no-repeat;
}
.hero-inner {
  padding: 120px 0 90px;
  text-align: center;
}
.hero-title {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.1;
  margin: 0 0 12px;
}
.hero-subtitle {
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto 26px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      50% 40% at 50% 60%,
      rgba(225, 156, 90, 0.22),
      transparent 60%
    ),
    radial-gradient(
      40% 30% at 70% 35%,
      rgba(122, 192, 196, 0.15),
      transparent 70%
    );
  z-index: -1;
}

.btn {
  display: inline-block;
  border: 1px solid var(--stroke);
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.06s ease, background 0.2s, border-color 0.2s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--btn-primary-dark));
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-text);
  box-shadow: 0 6px 18px var(--shadow-lg);
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-ghost {
  background: var(--shadow-sm);
  border-color: var(--stroke);
}
.btn-ghost:hover {
  background: var(--shadow-md);
}
.link-arrow {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.link-arrow:hover {
  text-decoration: underline;
}

.highlights {
  padding: 48px 0;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 8px var(--shadow-sm);
}
.card h3 {
  margin: 8px 0 6px;
  font-family: "Libre Baskerville", Georgia, serif;
}
.card p {
  margin: 0;
  color: var(--muted);
}

.feature {
  padding: 26px 0 64px;
}
.feature-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
}
.feature-copy h2 {
  font-family: "Libre Baskerville", Georgia, serif;
  margin: 0 0 8px;
}
.feature-copy p {
  color: var(--muted);
}
.feature-art {
  height: 320px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  object-fit: cover;
  object-position: center;
}

.page-hero {
  padding: 56px 0;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(122, 192, 196, 0.06), transparent);
}
.page-hero h1 {
  font-family: "Libre Baskerville", Georgia, serif;
  margin: 0 0 8px;
}
.content {
  padding: 30px 0 64px;
}
.narrow {
  max-width: 780px;
}
.checklist {
  padding-left: 18px;
}
.checklist li {
  margin: 6px 0;
}

.about-hero {
  display: flex;
  align-items: center;
  gap: 48px;
  margin: 40px 0;
}
.about-text {
  flex: 1;
}
.about-text h1 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 2.5rem;
  margin: 0 0 24px 0;
  color: var(--text);
}
.hero-description {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.about-logo {
  flex-shrink: 0;
}
.about-logo-img {
  height: 200px;
  width: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e19c5a, #7ac0c4);
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}
.content h2 {
  font-family: "Libre Baskerville", Georgia, serif;
  color: var(--accent);
  margin: 32px 0 16px 0;
  font-size: 1.4rem;
}
.content p {
  margin: 16px 0;
  line-height: 1.7;
}
.content strong {
  color: var(--text);
  font-weight: 600;
}

.filters {
  margin-bottom: 16px;
}
.filters-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.filters label {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}
.filters input,
.filters select,
.form input,
.form textarea {
  background: var(--input-bg);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
/* Legacy support: style old admin-injected cards to match new design */
.inventory-grid a.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.inventory-grid a.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}
.inventory-grid a.card .body {
  padding: 14px;
}
.inventory-grid a.card .body h3 {
  margin: 4px 0 6px;
  font-family: "Libre Baskerville", Georgia, serif;
}
.inventory-grid a.card .body .meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
}
.inventory-grid a.card .price {
  color: var(--accent);
  font-weight: 700;
}
.vehicle-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.vehicle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-md);
  border-color: var(--accent);
}
.vehicle-card h3,
.vehicle-card p {
  text-decoration: none;
  color: inherit;
}
.vehicle-card:hover h3,
.vehicle-card:hover p {
  text-decoration: none;
  color: inherit;
}
.vehicle-media {
  aspect-ratio: 16 / 10;
  height: auto;
  background-color: var(--media-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.vehicle-media.vehicle-media--fit {
  background-size: contain;
}
.vehicle-media.media-2 {
  background-color: var(--media-bg-2);
}
.vehicle-media.media-3 {
  background-color: var(--media-bg-3);
}
.vehicle-body {
  padding: 14px;
}
.vehicle-body h3 {
  margin: 4px 0 6px;
  font-family: "Libre Baskerville", Georgia, serif;
  /* Long titles should wrap neatly to next lines */
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.vehicle-body p {
  margin: 0 0 10px;
  color: var(--muted);
}
.vehicle-meta {
  display: block;
}
.vehicle-meta .meta-line {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vehicle-meta .meta-engine,
.vehicle-meta .meta-trans,
.vehicle-meta .meta-sep {
  color: var(--muted);
  font-weight: 600;
}
.vehicle-meta .price {
  display: block;
  margin-top: 6px;
}
.price {
  font-weight: 700;
  color: var(--accent);
}

.form .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.form button {
  margin-top: 6px;
}

.inquiry-section {
  background: var(--card);
  border-top: 1px solid var(--stroke);
  padding: 60px 0;
}
.inquiry-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.inquiry-content h2 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 2rem;
  margin: 0 0 16px 0;
  color: var(--text);
}
.inquiry-content p {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 32px 0;
  line-height: 1.6;
}
.inquiry-content .form {
  text-align: left;
}

.site-footer {
  border-top: 1px solid var(--stroke);
  background: var(--footer-bg);
  backdrop-filter: saturate(160%) blur(8px);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  color: var(--muted);
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 14px;
}
.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 980px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .feature-inner {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .burger-menu {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--nav-mobile-bg);
    backdrop-filter: saturate(160%) blur(8px);
    flex-direction: column;
    padding: 20px 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-top: 1px solid var(--stroke);
    box-shadow: 0 4px 12px var(--shadow-md);
  }

  .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    margin: 8px 0;
    padding: 12px 20px;
    text-align: center;
    width: 100%;
    border-radius: 0;
  }
}

@media (max-width: 600px) {
  .nav a {
    margin-left: 10px;
  }
  .grid-3,
  .grid-2,
  .card-grid {
    grid-template-columns: 1fr;
  }
  .hero-inner {
    padding: 86px 0 72px;
  }
}

.vehicle-page {
  padding: 30px 0 64px;
}
.vehicle-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}
.gallery {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 2px 8px var(--shadow-sm);
}
.gallery-main {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--gallery-bg);
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--overlay-dark);
  color: #fff;
  border: 1px solid var(--overlay-light);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.gallery-arrow:hover {
  background: var(--shadow-lg);
  border-color: var(--accent);
}
.gallery-arrow.left {
  left: 10px;
}
.gallery-arrow.right {
  right: 10px;
}
.gallery-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.gallery-nav img {
  width: 100%;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  opacity: 0.7;
  cursor: pointer;
  object-fit: cover;
  display: block;
}
.gallery-nav img:hover,
.gallery-nav img.active {
  opacity: 1;
  border-color: var(--accent);
}
.thumb {
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  opacity: 0.7;
  cursor: pointer;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb.active {
  opacity: 1;
  border-color: var(--accent);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.lightbox.open {
  display: flex;
}
.lb-image {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 22px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.lb-left {
  left: 24px;
}
.lb-right {
  right: 24px;
}

html.no-scroll,
body.no-scroll {
  overflow: hidden;
}
.specs {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 8px var(--shadow-sm);
}
.specs h1 {
  font-family: "Libre Baskerville", Georgia, serif;
  margin: 0 0 8px;
  /* Ensure long titles on generated vehicle pages wrap */
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.specs .price {
  font-size: 22px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 10px 0 0;
}
.kv div {
  color: var(--muted);
}
.kv .spec {
  grid-column: 1 / -1;
  display: block;
  margin: 4px 0;
}
.vehicle-description {
  margin-top: 18px;
}
.vehicle-description .card {
  padding: 18px;
}
.vehicle-inquiry {
  margin-top: 16px;
}
.vehicle-inquiry .card {
  padding: 18px;
}

/* Contact buttons */
.contact-buttons {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.btn-contact {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  border: 2px solid;
}

.btn-contact:active {
  transform: translateY(1px);
}

.btn-contact svg {
  flex-shrink: 0;
}

.btn-call {
  background: linear-gradient(180deg, var(--accent), var(--btn-primary-dark));
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-text);
  box-shadow: 0 4px 14px var(--shadow-lg);
}

.btn-call:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px var(--shadow-lg);
}

.btn-message {
  background: var(--shadow-sm);
  border-color: var(--accent-2);
  color: var(--accent-2);
  box-shadow: 0 4px 14px var(--shadow-sm);
}

.btn-message:hover {
  background: var(--shadow-md);
  box-shadow: 0 6px 18px var(--shadow-md);
}

/* Desktop: скрыть mobile кнопки, показать desktop кнопки */
.contact-buttons-mobile {
  display: none;
}

.contact-buttons-desktop {
  display: flex;
  grid-column: 1 / -1; /* Занимаем обе колонки грида */
  margin-top: 6px;
}

@media (max-width: 980px) {
  .vehicle-layout {
    grid-template-columns: 1fr;
  }

  /* Mobile: показать mobile кнопки, скрыть desktop кнопки */
  .contact-buttons-mobile {
    display: flex;
    grid-column: 1 / -1; /* Занимаем всю ширину */
  }

  .contact-buttons-desktop {
    display: none;
  }
}

@media (max-width: 768px) {
  .logo {
    font-size: 22px;
    gap: 8px;
  }
  .logo img {
    height: 28px;
  }
  .header-inner {
    padding: 14px 0 56px;
  }
  .header-contacts {
    left: 0;
    right: 0;
    transform: none;
    bottom: 8px;
    margin: 0 auto;
    text-align: center;
  }
  .about-hero {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }
  .about-logo-img {
    height: 160px;
    width: 160px;
    padding: 16px;
  }
}

/* Form contact info styling */
.form-contact-info {
  margin-top: 20px;
  padding: 16px;
  background-color: var(--panel);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}

.form-contact-info p {
  margin: 8px 0;
  font-size: 14px;
  color: var(--text);
}

.form-contact-info p:last-child {
  font-style: italic;
  color: var(--muted);
  margin-top: 12px;
}
