/* =======================================
   Палитра бренда idGarages
   ======================================= */
:root {
  --brand-primary:   #00A3DF;  /* основной голубой */
  --brand-secondary: #F15A24;  /* ярко-оранжевый акцент */
  --brand-bg:        #F7F7F7;  /* очень светло-серый фон */
  --brand-surface:   #FFFFFF;  /* чистый белый для карточек/блоков */
  --brand-border:    #EBEBEB;  /* мягкая серая рамка */
  --brand-text:      #333333;  /* тёмно-серый основной текст */
  --brand-muted:     #777777;  /* приглушённый текст для второстепенного */
}

/* =======================================
   Базовые стили
   ======================================= */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: var(--brand-text);
  font-family: 'Poppins', sans-serif;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  /* лёгкий оверлей для глубины */
  background: radial-gradient(circle at 50% 30%, rgba(0,163,223,0.10), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* =======================================
   Header / навигация
   ======================================= */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 15px 40px;
  position: fixed;
  top: 0; width: 100%;
  background-color: var(--brand-surface);
  border-bottom: 1px solid var(--brand-border);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
  z-index: 1000;
}

.logo-title {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  color: var(--brand-primary);
  text-shadow: 0 0 10px rgba(0,163,223,0.3);
}

.nav-logo {
  height: 40px;
  margin-right: 10px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-end;
  padding: 0; margin: 0;
}

.nav-menu li a {
  color: var(--brand-primary);
  text-decoration: none;
  padding: 8px 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.nav-menu li a:hover {
  background-color: var(--brand-primary);
  color: var(--brand-surface);
  border-color: var(--brand-primary);
  box-shadow: 0 0 8px rgba(0,163,223,0.4);
}

/* =======================================
   Hero
   ======================================= */
.hero-section-custom {
  background: transparent;
  padding: 100px 20px 80px;
  color: var(--brand-text);
  border-top: none;
  border-bottom: none;
}

.hero-container-custom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: space-between;
}

.hero-text-block {
  flex: 1 1 500px;
  font-size: 16px;
  line-height: 1.7;
  background: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  box-shadow: 0 0 20px rgba(0,163,223,0.15);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(2px);
}

.hero-text-block h2 {
  font-size: 32px;
  margin-bottom: 20px;
  color: var(--brand-primary);
  text-shadow: 0 2px 10px var(--brand-bg);
}

.hero-text-block .accent {
  color: var(--brand-secondary);
  font-weight: 700;
  animation: pulseGlow 2.5s infinite ease-in-out;
}

.hero-text-block strong {
  color: var(--brand-text);
}

.hero-text-block p {
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}
.hero-text-block p:nth-child(2) { animation-delay: 0.2s; }
.hero-text-block p:nth-child(3) { animation-delay: 0.4s; }
.hero-text-block p:nth-child(4) { animation-delay: 0.6s; }
.hero-text-block p:nth-child(5) { animation-delay: 0.8s; }
.hero-text-block p:nth-child(6) { animation-delay: 1s; }

.hero-image-block {
  flex: 1 1 500px;
  text-align: center;
}

.hero-image-block img {
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  box-shadow: 0 0 16px rgba(0,163,223,0.2);
  object-fit: contain;
}

/* =======================================
   Services
   ======================================= */
.services-section {
  background: transparent;
  padding: 80px 40px;
  text-align: center;
}

.services-section h2 {
  font-size: 36px;
  color: var(--brand-primary);
  margin-bottom: 50px;
  text-shadow: 0 0 10px rgba(0,163,223,0.3);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  justify-items: center;
}

.service-card {
  background-color: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  box-shadow: 0 0 24px rgba(0,163,223,0.10), 0 0 0 4px rgba(0,163,223,0.04);
  border-radius: 20px;
  padding: 30px 20px;
  width: 200px; height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 0 44px rgba(0,163,223,0.2), 0 0 0 6px rgba(0,163,223,0.13);
}

.service-card img {
  width: 100px; height: 100px;
  margin-bottom: 10px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px var(--brand-border));
}

.service-card p {
  text-align: center;
  font-size: 14px;
  color: var(--brand-text);
  font-weight: 600;
}

/* =======================================
   About
   ======================================= */
.about-section-grid {
  padding: 80px 40px;
  background: transparent;
  text-align: center;
}

.about-section-grid h2 {
  font-size: 36px;
  color: var(--brand-primary);
  margin-bottom: 40px;
  text-shadow: 0 0 6px var(--brand-border);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  justify-items: center;
}

.about-card {
  background-color: var(--brand-surface);
  border-radius: 20px;
  padding: 30px 20px;
  width: 200px; height: 250px;
  box-shadow: 0 0 20px rgba(0,163,223,0.2);
  border: 1.5px solid var(--brand-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.about-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 0 38px rgba(0,163,223,0.2), 0 0 0 6px rgba(0,163,223,0.13);
}

.about-card img {
  width: 100px; height: 100px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 6px var(--brand-border));
}

.about-card h3 {
  color: var(--brand-primary);
  margin-bottom: 10px;
  font-size: 18px;
  text-shadow: 0 0 6px var(--brand-border);
}

.about-card p {
  color: var(--brand-text);
  font-size: 14px;
  line-height: 1.4;
}

/* =======================================
   Contacts
   ======================================= */
.contact-section {
  padding: 60px 40px;
  background: transparent;
  color: var(--brand-text);
  text-align: center;
}

.contact-boxes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin: 40px 0;
}

.contact-item {
  background-color: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  min-width: 260px;
  box-shadow: 0 0 20px rgba(0,163,223,0.10);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 0 36px rgba(0,163,223,0.2);
}

.contact-item h3 {
  color: var(--brand-primary);
  font-size: 18px;
  margin-bottom: 10px;
}

.contact-item a {
  color: var(--brand-text);
  font-weight: 600;
  text-decoration: none;
}

.contact-item a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.map {
  width: 100%; height: 400px;
  border: none;
  border-radius: 10px;
  margin-top: 20px;
}

/* =======================================
   Footer
   ======================================= */
footer {
  background: var(--brand-surface);
  padding: 20px 0;
  text-align: center;
  color: var(--brand-muted);
  font-size: 14px;
  border-top: 1px solid var(--brand-border);
  box-shadow: inset 0 8px 12px -6px rgba(0,163,223,0.10);
}

/* =======================================
   Анимации
   ======================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(241,90,36,0.5),
      0 0 20px rgba(241,90,36,0.3);
  }
  50% {
    text-shadow:
      0 0 20px rgba(241,90,36,1),
      0 0 30px rgba(241,90,36,0.8);
  }
}

/* =======================================
   Модальное окно
   ======================================= */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,163,223,0.16);
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding: 40px 20px 20px;
  box-sizing: border-box;
}

.modal.visible {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 1;
}

.modal-content {
  background-color: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  border-radius: 20px;
  width: 100%; max-width: 500px;
  padding: 25px 20px;
  position: relative;
  box-shadow: 0 0 20px rgba(0,163,223,0.10);
  transform: translateY(-20px);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: neonPulse 3s infinite alternate;
  max-height: 80vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal.visible .modal-content {
  transform: translateY(0);
}

@keyframes neonPulse {
  0% {
    box-shadow: 0 0 10px rgba(0,163,223,0.10), 0 0 20px var(--brand-border);
  }
  100% {
    box-shadow: 0 0 20px rgba(0,163,223,0.20), 0 0 40px var(--brand-border);
  }
}

.modal-content h3 {
  color: var(--brand-primary);
  margin-bottom: 20px;
  font-size: 24px;
  text-align: center;
}

.modal-content ul {
  list-style: none;
  padding: 0; margin: 0;
  max-height: 300px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.modal-content ul li {
  color: var(--brand-text);
  padding: 10px 0;
  border-bottom: 1px solid var(--brand-border);
}

.modal-content .close {
  position: absolute; right: 20px; top: 10px;
  color: var(--brand-primary);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-content .close:hover {
  color: var(--brand-secondary);
}

/* Таблица внутри модального окна */
.price-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}

.price-table th,
.price-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--brand-border);
}

.price-table th {
  background-color: var(--brand-bg);
  font-weight: 600;
  color: var(--brand-text);
}

.price-table tr:hover {
  background-color: rgba(0,163,223,0.05);
}

.table-container {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px;
  scroll-behavior: smooth;
}

/* =======================================
   Заголовки секций
   ======================================= */
.section-title {
  color: var(--brand-primary);
  text-align: center;
  margin-bottom: 50px;
  font-size: 36px;
  text-shadow: 0 0 10px rgba(0,163,223,0.3);
}

/* =======================================
   Карусель авто
   ======================================= */
.cars-carousel {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  padding: 0 160px 40px 160px;
}

.cars-wrapper {
  display: flex;
  gap: 60px;
  transition: transform 0.5s ease;
}

.car-card {
  flex: 0 0 580px;
  box-sizing: border-box;
  padding: 20px;
  background-color: var(--brand-surface);
  border: 1.5px solid var(--brand-border);
  box-shadow: 0 0 20px rgba(0,163,223,0.10);
  border-radius: 20px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  height: 350px;
}

.car-images {
  position: relative;
  flex: 1 1 50%;
  max-width: 350px; width: 300px; height: 260px;
}

.car-images img.car-slide {
  width: 100%; height: 100%;
  border-radius: 12px;
  box-shadow: 0 0 16px var(--brand-border);
  object-fit: cover;
  display: none;
  cursor: pointer;
}

.car-images img.car-slide.active {
  display: block;
}

.dots-container {
  text-align: center; margin-top: 10px;
}

.dots-container .dot {
  height: 10px; width: 10px;
  margin: 0 5px;
  display: inline-block;
  border-radius: 50%;
  background-color: rgba(0,163,223,0.27);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dots-container .dot.active {
  background-color: var(--brand-primary);
}

.car-info {
  flex: 1 1 50%;
  color: var(--brand-text);
  text-align: left;
}

.car-info h3 {
  font-size: 26px;
  color: var(--brand-primary);
  margin-bottom: 15px;
  text-shadow: 0 0 6px var(--brand-border);
}

.car-info ul {
  list-style: none; padding: 0; margin: 0;
}

.car-info li {
  padding: 8px 0;
  border-bottom: 1px solid var(--brand-border);
  font-size: 15px;
}

.car-info li strong {
  color: var(--brand-text);
}

/* =======================================
   Lightbox (всплывающий просмотр фото)
   ======================================= */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* тёмный фон */
  align-items: center;
  justify-content: center;
  overflow: auto; /* обеспечивает прокрутку самого картинного блока, если изображение большое */
}

.lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 163, 223, 0.2);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: var(--brand-primary);
  cursor: pointer;
  font-weight: bold;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: var(--brand-secondary);
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: var(--brand-primary);
  background: rgba(0, 163, 223, 0.28);
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  user-select: none;
  transition: background-color 0.3s ease;
  z-index: 2001;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: var(--brand-secondary);
}

/* =======================================
   Carousel buttons (справа/слева от карусели машин)
   ======================================= */
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  color: var(--brand-primary);
  background: rgba(0, 163, 223, 0.28);
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  user-select: none;
  transition: background-color 0.3s ease;
  z-index: 101;
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: var(--brand-secondary);
}


/* ======= АДАПТИВНОСТЬ ДЛЯ КАРУСЕЛИ АВТО ========== */

/* 4K/2K мониторы */
@media (min-width: 1921px) {
  .cars-carousel {
    max-width: 1800px;
    padding-left: 300px;
    padding-right: 300px;
  }
  .cars-wrapper {
    gap: 100px;
  }
  .car-card {
    flex: 0 0 800px;
    max-width: 800px;
  }
}

/* Full HD мониторы */
@media (min-width: 1600px) and (max-width: 1920px) {
  .cars-carousel {
    max-width: 1400px;
    padding-left: 180px;
    padding-right: 180px;
  }
  .cars-wrapper {
    gap: 80px;
  }
  .car-card {
    flex: 0 0 660px;
    max-width: 660px;
  }
}

/* Стандартные ноутбуки */
@media (min-width: 1440px) and (max-width: 1599px) {
  .cars-carousel {
    max-width: 1250px;
    padding-left: 120px;
    padding-right: 120px;
  }
  .cars-wrapper {
    gap: 60px;
  }
  .car-card {
    flex: 0 0 600px;
    max-width: 600px;
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  .cars-carousel {
    max-width: 1100px;
    padding-left: 80px;
    padding-right: 80px;
  }
  .cars-wrapper {
    gap: 40px;
  }
  .car-card {
    flex: 0 0 520px;
    max-width: 520px;
  }
}

/* Планшеты (горизонтально) */
@media (min-width: 1024px) and (max-width: 1279px) {
  .cars-carousel {
    max-width: 950px;
    padding-left: 32px;
    padding-right: 32px;
  }
  .cars-wrapper {
    gap: 30px;
  }
  .car-card {
    flex: 0 0 420px;
    max-width: 420px;
  }
}

/* Планшеты и маленькие ноуты */
@media ( min-width: 900px ) and ( max-width: 1023px ) {
  .cars-carousel {
    max-width: 800px;
    padding-left: 24px;
    padding-right: 24px;
  }
  .cars-wrapper {
    gap: 24px;
  }
  .car-card {
    flex: 0 0 380px;
    max-width: 380px;
  }
}

@media ( min-width: 850px ) and ( max-width: 899px ) {
  .cars-carousel {
    max-width: 760px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .car-card {
    flex: 0 0 340px;
    max-width: 340px;
  }
}

@media ( min-width: 800px ) and ( max-width: 849px ) {
  .cars-carousel {
    max-width: 700px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .car-card {
    flex: 0 0 300px;
    max-width: 300px;
  }
}

/* Стандартные брейкпоинты */
@media (max-width: 1200px) {
  .cars-carousel {
    padding-left: 40px;
    padding-right: 40px;
  }
}
@media (max-width: 992px) {
  .cars-carousel {
    padding-left: 10px;
    padding-right: 10px;
  }
  .cars-wrapper {
    gap: 30px;
  }
  .car-card {
    flex: 0 0 90vw;
    max-width: 90vw;
  }
}
@media (max-width: 850px) {
  .cars-carousel {
    padding-left: 0;
    padding-right: 0;
    max-width: 100vw;
  }
  .cars-wrapper {
    gap: 16px;
  }
  .car-card {
    flex: 0 0 95vw !important;
    max-width: 95vw !important;
    margin: 0 auto;
  }
}

/* Мобильные устройства */
@media (max-width: 700px) {
  .cars-carousel {
    padding-left: 0;
    padding-right: 0;
    max-width: 100vw;
  }
  .cars-wrapper {
    gap: 10px;
  }
  .car-card {
    flex: 0 0 100vw !important;
    max-width: 100vw !important;
    min-width: 0;
    margin: 0 auto;
  }
}
@media (max-width: 600px) {
  .cars-wrapper {
    gap: 8px;
  }
  .car-card {
    flex: 0 0 99vw !important;
    max-width: 99vw !important;
    padding: 10px;
    height: auto;
  }
}

/* iPhone 14 Pro, Galaxy S23+ и т.д. */
@media (max-width: 500px) {
  .car-card {
    flex: 0 0 98vw !important;
    max-width: 98vw !important;
    padding: 6px;
  }
}

/* Совсем маленькие телефоны */
@media (max-width: 430px) {
  .car-card {
    flex: 0 0 97vw !important;
    max-width: 97vw !important;
    padding: 2px;
  }
}
@media (max-width: 390px) {
  .car-card {
    flex: 0 0 96vw !important;
    max-width: 96vw !important;
  }
}
@media (max-width: 375px) {
  .car-card {
    flex: 0 0 95vw !important;
    max-width: 95vw !important;
  }
}
@media (max-width: 360px) {
  .car-card {
    flex: 0 0 94vw !important;
    max-width: 94vw !important;
  }
}
@media (max-width: 320px) {
  .car-card {
    flex: 0 0 93vw !important;
    max-width: 93vw !important;
    font-size: 13px;
  }
}
