/* ====== СЕКЦИЯ: ГЛОБАЛЬНЫЕ СТИЛИ ====== */
:root {
  --bg: #F8F9FA;          /* Светлый фон секций и страниц */
  --bg-2: #F8F9FA;        /* Вторичный светлый фон */
  --accent: #2D313A;      /* Темно-графитовый для кнопок и заголовков */
  --text: #1E1F22;        /* Основной текст — глубокий серо-черный */
  --text-invert: #F8F9FA; /* Инвертированный текст (на тёмных кнопках) */
  --gray-panel: #2B3037;  /* Тёмный фон панели фильтров */
}

/* === ПЛАВНАЯ ПРОКРУТКА === */
html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ====== СЕКЦИЯ: ТИПОГРАФИКА ====== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Orbitron', sans-serif;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 15px;
  letter-spacing: 0.5px;
}

h1 {
  font-size: 3.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h2 {
  font-size: 2.4rem;
}

h3 {
  font-size: 1.8rem;
}

p, li, a, span, label, input, textarea {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.6;
}

/* ====== СЕКЦИЯ: ССЫЛКИ ====== */
a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
  color: var(--text);
  text-shadow: 0 0 8px rgba(45, 49, 58, 0.3);
}

.card-link {
  text-decoration: none;
  color: inherit;
}

/* ====== СЕКЦИЯ: ШАПКА САЙТА ====== */
.site-header {
  background: var(--bg);
  color: var(--accent);
  padding: 15px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  user-select: text;
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.logo a {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.5rem;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
}

.nav a {
  position: relative;
  color: var(--accent);
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(45, 49, 58, 0.6), 0 0 20px rgba(45, 49, 58, 0.4);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(45, 49, 58, 0.7);
  transition: all 0.35s ease;
  transform: translateX(-50%);
  opacity: 0;
}

.nav a:hover::after,
.nav a.active::after {
  width: 70%;
  opacity: 1;
}

/* ====== СЕКЦИЯ: МОБИЛЬНАЯ ШАПКА ====== */
@media (max-width: 768px) {
  /* Компактная шапка для мобильных устройств */
  .site-header {
    padding: 5px 0;
  }

  .logo a {
    font-size: 11px;
  }

  .nav ul {
    gap: 5px;
  }

  .nav ul li a {
    font-size: 9px;
  }
}

/* ====== СЕКЦИЯ: HERO (ГЛАВНЫЙ БАННЕР) ====== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 75vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--bg);
  color: var(--text);
  padding: 80px 20px 100px;
}

.hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(249, 245, 240, 0.65);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  opacity: 0;
  transform: translateY(40px);
  animation: heroFadeUp 1.2s ease-out forwards;
  animation-delay: 0.5s;
}

.hero-content h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 3.2rem;
  color: var(--accent);
  margin-bottom: 20px;
  line-height: 1.25;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s ease forwards, breathe 6s ease-in-out infinite;
  animation-delay: 0.6s, 2s;
  text-shadow: 0 0 12px rgba(45, 49, 58, 0.25);
}

.hero .tagline {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 30px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1.2s ease forwards, breathe 8s ease-in-out infinite;
  animation-delay: 0.9s, 2.5s;
}

.hero-content .tagline {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1.2s ease forwards;
  animation-delay: 0.9s;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1.3s ease forwards;
  animation-delay: 1.3s;
}

.hero-content .hero-buttons {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1.3s ease forwards;
  animation-delay: 1.3s;
}

.hero-content .hero-buttons .btn {
  animation: fadeUp 1.3s ease forwards, pulseSoft 5s ease-in-out infinite;
  animation-delay: 1.3s, 3s;
}

.hero-buttons .btn,
.hero-buttons .contact-btn {
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.hero-buttons .btn {
  background: var(--accent);
  color: var(--text-invert);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: none;
}

.hero-buttons .btn:hover {
  background: var(--text);
  color: var(--text-invert);
}

.hero-buttons .contact-btn {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.hero-buttons .contact-btn:hover {
  background: var(--accent);
  color: var(--text-invert);
}

/* ====== СЕКЦИЯ: ОСНОВНЫЕ СЕКЦИИ ====== */
.section {
  background: var(--bg);
  padding: 50px 0;
  text-align: center;
}

.section h2 {
  margin-bottom: 30px;
  font-family: 'Orbitron', sans-serif;
  color: var(--accent);
  font-size: 2rem;
}

/* ====== СЕКЦИЯ: ГАЛЕРЕЯ АВТО (КАРТОЧКИ) ====== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--bg-2);
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(43, 48, 55, 0.12);
  overflow: hidden;
  transition: all 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(43, 48, 55, 0.12);
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 15px;
  box-shadow: 0 0 0 rgba(45, 49, 58, 0);
  transition: box-shadow 0.4s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(43, 48, 55, 0.22);
}

.card:hover::after {
  box-shadow: 0 0 25px rgba(45, 49, 58, 0.25);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 15px;
  text-align: center;
  color: var(--text);
}

.card-body h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.card-body p {
  margin: 4px 0;
  font-size: 0.9rem;
}

.card-body .price {
  color: var(--accent);
  font-weight: bold;
  font-size: 1rem;
}

.view-details {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
}

/* ====== СЕКЦИЯ: ФОРМА ФИЛЬТРОВ ====== */
.filter-form {
  background: #FFFFFF;
  color: #2D313A;
  box-shadow: 0 8px 25px rgba(43, 48, 55, 0.12);
  border: 1px solid rgba(43, 48, 55, 0.18);
  border-radius: 20px;
  padding: 25px 30px;
  width: 90%;
  max-width: 1100px;
  margin: 0 auto 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.filter-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.filter-form label {
  color: #2D313A;
  font-weight: 600;
}

.filter-select,
.filter-input {
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid #3c3c3c;
  font-size: 1rem;
  background: #FFFFFF;
  color: #000000;
  min-width: 150px;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(60, 60, 60, 0.05);
}

.filter-select:hover,
.filter-input:hover {
  box-shadow: 0 4px 12px rgba(60, 60, 60, 0.15);
  border-color: #3c3c3c;
}

.filter-form select,
.filter-form input {
  background: #FFFFFF;
  color: #000000;
  border: 1px solid #3c3c3c;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.filter-form select:hover,
.filter-form input:hover {
  box-shadow: 0 4px 12px rgba(60, 60, 60, 0.15);
}

.filter-select:focus,
.filter-input:focus,
.filter-form select:focus,
.filter-form input:focus {
  outline: 2px solid #3c3c3c;
  outline-offset: 2px;
  box-shadow: 0 4px 12px rgba(60, 60, 60, 0.2);
  border-color: #3c3c3c;
}

.btn-filter {
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  padding: 12px 30px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 18px rgba(45, 49, 58, 0.35);
}

.btn-filter:hover {
  background: var(--text);
  color: #FFFFFF;
  box-shadow: 0 0 22px rgba(43, 48, 55, 0.35);
  transform: translateY(-2px);
}

.btn-reset {
  color: var(--text);
  text-decoration: none;
  align-self: center;
  font-weight: 600;
  margin-left: 8px;
  transition: 0.3s;
}

.btn-reset:hover {
  color: var(--accent);
}

/* ====== СЕКЦИЯ: ФОРМА ЗАЯВКИ ====== */
.application-section {
  background: linear-gradient(180deg, #F8F9FA, #F8F9FA);
  color: var(--text);
  padding: 60px 0;
  text-align: center;
  box-shadow: 0 -10px 25px rgba(43, 48, 55, 0.1);
}

.application-container {
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
}

.application-section h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--accent);
}

.application-text {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 35px;
}

.application-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.application-form input,
.application-form textarea {
  flex: 1;
  padding: 14px 20px;
  border-radius: 25px;
  border: 1px solid rgba(43, 48, 55, 0.25);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-2);
}

.application-form textarea {
  resize: none;
  height: 120px;
}

.application-form .btn.send-message {
  background: var(--accent);
  color: var(--text-invert);
  border: none;
  padding: 16px 35px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 auto;
  width: 50%;
  min-width: 200px;
  box-shadow: 0 0 20px rgba(45, 49, 58, 0.35);
}

.application-form .btn.send-message:hover {
  background: var(--text);
  box-shadow: 0 0 26px rgba(43, 48, 55, 0.35);
  transform: translateY(-2px);
}

/* ====== СЕКЦИЯ: ФОРМА ОБРАТНОЙ СВЯЗИ ====== */
.contact-section {
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  padding: 50px 0;
  color: var(--text);
  font-family: 'Poppins', sans-serif;
}

.contact-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  gap: 60px;
  padding: 0 40px;
}

.contact-left,
.contact-right {
  flex: 1;
  min-width: 280px;
  margin-bottom: 20px;
}

.contact-info {
  flex: 1 1 320px;
}

.contact-info h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  color: #2D313A;
  margin-bottom: 20px;
}

.contact-info p {
  margin: 8px 0;
  font-size: 1rem;
}

.contact-info a {
  color: #2D313A;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 25px;
  border: 1px solid rgba(43, 48, 55, 0.25);
  font-size: 1rem;
  background: var(--bg-2);
  color: var(--text);
}

.contact-form textarea {
  resize: none;
  height: 120px;
}

.contact-map {
  flex: 1 1 600px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.contact-map:hover {
  transform: scale(1.01);
}

.btn.send-message {
  width: 80%;
  border-radius: 25px;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--text-invert);
  border: none;
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
  box-shadow: 0 0 18px rgba(45, 49, 58, 0.35);
  cursor: pointer;
}

.btn.send-message:hover {
  background: var(--text);
  color: var(--text-invert);
  box-shadow: 0 0 22px rgba(43, 48, 55, 0.35);
}

.contact-dealer {
  text-align: center;
  margin-top: 50px;
}

.contact-btn {
  background: var(--accent);
  color: var(--text-invert);
  padding: 14px 45px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
  box-shadow: 0 0 18px rgba(45, 49, 58, 0.35);
  transition: all 0.3s ease;
  display: inline-block;
  letter-spacing: 0.5px;
}

.contact-btn:hover {
  background: var(--text);
  color: var(--text-invert);
  box-shadow: 0 0 22px rgba(43, 48, 55, 0.35);
  transform: translateY(-2px);
}

.contact-btn-large {
  background: var(--accent);
  color: var(--text-invert);
  padding: 14px 45px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(45, 49, 58, 0.35);
  transition: all 0.3s ease;
  display: inline-block;
}

/* ====== СЕКЦИЯ: ДЕТАЛИ АВТОМОБИЛЯ ====== */
.car-detail {
  background: var(--bg);
  padding: 50px 0;
}

.car-gallery {
  flex: 1 1 450px;
  text-align: center;
}

.car-gallery #main-image {
  width: 100%;
  max-width: 500px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(43, 48, 55, 0.18);
  margin-bottom: 15px;
  transition: 0.3s;
}

.thumbnail-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.thumbnail {
  width: 90px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.9;
  border: 2px solid transparent;
  transition: 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
  opacity: 1;
  border-color: var(--accent);
  transform: scale(1.05);
}

.car-detail .main-photo img {
  display: block;
  margin: 0 auto 20px;
  width: 100%;
  max-width: 650px;
  height: 420px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.car-detail .gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  max-width: 750px;
  margin: 0 auto 20px;
  justify-items: center;
}

.car-detail .gallery img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.car-detail .gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

.car-info {
  flex: 1 1 400px;
  background: var(--bg-2);
  border-radius: 15px;
  padding: 25px 30px;
  box-shadow: 0 5px 25px rgba(43, 48, 55, 0.12);
  line-height: 1.6;
  color: var(--text);
  border: 1px solid rgba(43, 48, 55, 0.15);
}

.car-info p {
  margin-bottom: 12px;
  font-size: 1rem;
  color: var(--text);
}

.car-info strong {
  color: var(--accent);
  font-weight: 700;
}

.car-info-wrapper {
  margin: 30px auto;
  max-width: 1200px;
  padding: 0 20px;
}

.car-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.spec-card {
  background: var(--bg-2);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(43, 48, 55, 0.1);
  text-align: center;
}

.spec-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.spec-content {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 5px;
}

.spec-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.car-description {
  margin: 30px auto;
  max-width: 1200px;
  padding: 0 20px;
}

.description-text {
  background: var(--bg-2);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(43, 48, 55, 0.1);
  line-height: 1.8;
}

/* Старые стили слайдера удалены - используется Swiper.js */
/* Стили для Swiper слайдера находятся в car_detail.php */

#thumbnailsGallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
}

.thumbnail-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.thumbnail-img:hover,
.thumbnail-img.active {
  border-color: var(--accent);
  transform: scale(1.05);
}

/* ====== СЕКЦИЯ: ФУТЕР ====== */
.site-footer {
  background: var(--bg);
  color: var(--text);
  padding: 25px 0;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

footer {
  text-align: center;
  padding: 30px 0;
  color: #2D313A;
  background-color: #F4F4F2;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ====== СЕКЦИЯ: КНОПКИ ====== */
button,
.btn,
.btn.yellow,
.btn.ghost,
.btn-filter,
.send-message,
.contact-btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  border-radius: 10px;
  padding: 14px 38px;
  cursor: pointer;
  transition: all 0.3s ease;
  will-change: filter, transform;
  border: none;
}

.btn.yellow,
button[type="submit"],
.send-message {
  background: var(--accent);
  color: var(--text-invert);
  box-shadow: 0 4px 20px rgba(45, 49, 58, 0.25);
}

.btn.ghost {
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
}

button:hover,
.btn:hover,
.btn.yellow:hover,
.btn.ghost:hover,
.btn-filter:hover,
.send-message:hover,
.contact-btn:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 0 10px rgba(45, 49, 58, 0.5));
  animation: pulseShadow 1.8s ease-in-out infinite;
}

.btn.yellow:hover,
.send-message:hover,
.btn-filter:hover,
.contact-btn:hover {
  background: var(--text);
  color: var(--text-invert);
  box-shadow: 0 6px 25px rgba(45, 49, 58, 0.4);
}

.btn.ghost:hover {
  background: var(--accent);
  color: var(--text-invert);
}

button:active,
.btn:active,
.btn.yellow:active,
.btn.ghost:active,
.btn-filter:active,
.send-message:active,
.contact-btn:active {
  transform: translateY(0) scale(0.97);
}

/* ====== СЕКЦИЯ: АНИМАЦИИ И ЭФФЕКТЫ ====== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(45, 49, 58, 0.25));
  }
  50% {
    transform: scale(1.02);
    filter: drop-shadow(0 0 20px rgba(45, 49, 58, 0.45));
  }
}

@keyframes pulseSoft {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(45, 49, 58, 0);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 20px rgba(45, 49, 58, 0.3);
  }
}

@keyframes pulseShadow {
  0% {
    filter: drop-shadow(0 0 6px rgba(45, 49, 58, 0.25))
            drop-shadow(0 0 0 rgba(45, 49, 58, 0.0));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(45, 49, 58, 0.55))
            drop-shadow(0 0 28px rgba(45, 49, 58, 0.3));
  }
  100% {
    filter: drop-shadow(0 0 6px rgba(45, 49, 58, 0.25))
            drop-shadow(0 0 0 rgba(45, 49, 58, 0.0));
  }
}

/* ====== СЕКЦИЯ: АДАПТИВНЫЕ МЕДИАЗАПРОСЫ ====== */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .car-detail .gallery {
    grid-template-columns: repeat(4, 1fr);
    max-width: 600px;
  }
}

@media (max-width: 992px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.6rem;
  }

  .btn {
    font-size: 1rem;
    padding: 12px 30px;
  }
}

@media (max-width: 900px) {
  .contact-wrap {
    flex-direction: column;
    gap: 40px;
  }

  .contact-map iframe {
    height: 300px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0 10px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 60px 10px 40px;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.9rem !important;
    line-height: 1.3 !important;
    margin-bottom: 18px !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .hero .tagline {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    max-width: 90%;
    margin: 0 auto 25px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
  }

  .hero-buttons .btn,
  .hero-buttons .contact-btn {
    width: 85%;
    max-width: 280px;
    padding: 14px 0;
    font-size: 1.05rem;
    border-radius: 10px;
    text-align: center;
    display: block;
  }

  .hero-buttons .btn::after,
  .hero-buttons .contact-btn::after {
    display: none;
  }

  .card {
    margin: 0 auto 25px;
    width: 92%;
  }

  .card img {
    height: auto;
    max-height: 220px;
    object-fit: cover;
  }

  h2 {
    font-size: 1.6rem;
    text-align: center;
    margin-top: 40px;
  }

  .car-detail .gallery {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
    gap: 8px;
  }

  .car-detail .gallery img {
    width: 100%;
    max-width: 120px;
    height: 80px;
  }

  /* Стили слайдера находятся в car_detail.php */

  .car-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  .btn {
    font-size: 0.95rem;
    padding: 10px 26px;
  }
}

@media (max-width: 480px) {
  .car-detail .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .car-detail .gallery img {
    max-width: 100%;
  }

  .car-specs-grid {
    grid-template-columns: 1fr;
  }

  /* Стили навигации слайдера находятся в car_detail.php */
}

/* ===== СЕКЦИЯ: ПЛАВАЮЩИЕ КНОПКИ СВЯЗИ ===== */
.floating-contact-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: row;
  gap: 15px;
  align-items: center;
}

.floating-contact-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(45, 49, 58, 0.3);
  transition: all 0.3s ease;
  font-size: 24px;
  border: none;
  cursor: pointer;
  animation: pulseButtonGraphite 2s ease-in-out infinite;
  color: var(--text-invert);
}

/* Кнопка WhatsApp с фирменным зеленым цветом */
.floating-contact-btn.whatsapp-btn {
  background: #25D366 !important;
  animation: pulseButtonWhatsApp 2s ease-in-out infinite;
  color: white !important;
}

/* SVG иконки для кнопок */
.floating-contact-btn svg {
  width: 28px;
  height: 28px;
}

.floating-contact-btn:not(.whatsapp-btn) svg {
  fill: white;
}

.floating-contact-btn.whatsapp-btn svg {
  fill: white !important;
}

.floating-contact-btn:hover {
  transform: scale(1.1);
  animation: none;
}

.floating-contact-btn:not(.whatsapp-btn):hover {
  box-shadow: 0 6px 20px rgba(45, 49, 58, 0.4);
  background: var(--text);
}

.floating-contact-btn.whatsapp-btn:hover {
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.floating-contact-btn:active {
  transform: scale(1.05);
}

/* Анимация пульсации для графитовой кнопки */
@keyframes pulseButtonGraphite {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(45, 49, 58, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(45, 49, 58, 0.4);
  }
}

/* Анимация пульсации для зеленой кнопки WhatsApp */
@keyframes pulseButtonWhatsApp {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
  }
}

/* Адаптация для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
  .floating-contact-buttons {
    bottom: 20px;
    right: 20px;
    gap: 15px;
  }
  
  .floating-contact-btn {
    width: 50px;
    height: 50px;
  }
  
  /* Явно указываем зеленый цвет для WhatsApp на планшетах */
  .floating-contact-btn.whatsapp-btn {
    background: #25D366 !important;
    color: white !important;
  }
  
  .floating-contact-btn.whatsapp-btn svg {
    fill: white !important;
  }
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  .floating-contact-buttons {
    flex-direction: column;
    bottom: 20px;
    right: 15px;
    gap: 12px;
  }
  
  .floating-contact-btn {
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
  
  /* Явно указываем зеленый цвет для WhatsApp на мобильных */
  .floating-contact-btn.whatsapp-btn {
    background: #25D366 !important;
    color: white !important;
  }
  
  .floating-contact-btn.whatsapp-btn svg {
    fill: white !important;
  }
}

