/* Сброс стилей и базовые настройки */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Поддержка безопасных областей на iPhone (notch) и фонов */
html {
  height: 100%;
  background-color: #333; /* Наличие цвета-резерва для системных зон */
  background-image: linear-gradient(135deg, #2c2c2c, #1a1a1a);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body {
  font-family: 'Roboto', sans-serif;
  color: #ffffff; 
  min-height: 100%;
  background-color: transparent;
  background-image: inherit;
  background-repeat: no-repeat;
  background-attachment: inherit;
  /* Обработка safe-area inset для iPhone (поддержка старых и новых браузеров) */
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top);
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Оптимизируем базовые стили */
:root {
  --primary-color: #ff5722;
  --secondary-color: #43a147;
  --background-dark: #333;
  --text-light: #e0e0e0;
  --border-radius: 8px;
  --transition-default: 0.3s ease;
}

/* Надписи для категорий */
.category-description, .subcategory-description {
  text-align: center;
  font-size: 20px;
  color: #fff;
  margin: 15px 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  transition: opacity 0.7s ease-in-out;
}
.category-description:empty {
  display: none;
}

/* Шапка сайта */
.header {
  background: linear-gradient(135deg, #3a3a3a, #1f1f1f);
  color: #fff;
  padding-bottom: 10px;
  position: relative;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 15px 30px;
  gap: 20px;
}
.logo img {
  height: 50px;
}
.contact-info {
  display: flex;
  gap: 20px;
  font-size: 17px;
}
.contact-info p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.social-links {
  display: flex;
  gap: 15px;
  align-items: center;
}
.social-links a {
  color: #fff;
  font-size: 20px;
  transition: color 0.3s;
}
.social-links a:hover {
  color: #ffab40;
}
.consultation-btn {
  background-color: #ff5722;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.consultation-btn:hover {
  background-color: #e64a19;
}

/* О НАС */
.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.custom-modal-content {
  background: #222;
  color: white;
  padding: 40px;
  border-radius: 10px;
  width: 90%;
  max-width: 800px;
  text-align: center;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease-in-out;
  max-height: 90vh;
  overflow-y: auto;
}

.custom-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

.custom-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 20px;
}

.custom-carousel-inner {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.custom-carousel-item {
  min-width: 100%;
  display: none;
}

.custom-carousel-item.active {
  display: block;
}

.custom-carousel img {
  width: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: 15px;
}

.custom-carousel-prev, .custom-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-size: 18px;
}

.custom-carousel-prev {
  left: 10px;
}

.custom-carousel-next {
  right: 10px;
}

@media (max-width: 768px) {
  .custom-carousel img {
      max-width: 250px;
      height: auto;
  }
}

/* Главное меню */
.main-menu {
  background-color: #444;
}
.menu-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 0;
}
.menu-container ul {
  display: flex;
  flex-direction: row !important;
  justify-content: center;
  align-items: center; 
  gap: 50px; 
  list-style: none; 
  padding: 0; 
  margin: 0;
}
.menu-container li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}
.menu-container li a:hover {
  color: #ffab40;
}

.menu-toggle {
  display: none;
}

/* Основной контент */
.main-content {
  margin-top: 0;
}
.background-image {
  background: url('images/background.jpg') no-repeat center center/cover;
  min-height: 100vh;
  position: relative;
}
.overlay {
  background-color: rgba(0, 0, 0, 0.55);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.container {
  max-width: 1200px;
  width: 100%;
}

/* Меню категорий */
.category-menu {
  text-align: center;
  margin-bottom: 20px;
}
.cat-btn {
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #444;
  padding: 10px 15px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.cat-btn.active,
.cat-btn:hover {
  background-color: #ff5722;
  color: #fff;
}

/* Секции товаров по категориям */
.category-section {
  display: none; 
  flex-wrap: wrap;
  justify-content: center; 
  gap: 30px;
  opacity: 0;
  position: relative;
  transition: opacity 0.25s ease;
  visibility: hidden;
}

.category-section.active {
  display: flex; 
  opacity: 1;
  visibility: visible;
}

/* Контейнер для подкатегорий */
.subcategories-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.subcategory-menu {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.subcategory-content {
  width: 100%;
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  opacity: 0;
  visibility: hidden;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.subcategory-content.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* Промо-акция */
.promo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.promo-content {
  background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
  padding: 20px;
  border: 1px solid #ff5722;
  border-radius: 10px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  position: relative;
  overflow: hidden;
}

.promo-content img {
  width: 100%;
  height: auto;
  margin-top: 10px;
  border-radius: 10px;
}

.close-promo {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

/* Меню подкатегорий */

/* Меню подкатегорий (объединено с .category-menu) */
.subcategory-menu, .category-menu {
  text-align: center;
  margin-bottom: 20px;
}
.subcat-btn, .cat-btn {
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #444;
  padding: 8px 12px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.subcat-btn.active, .subcat-btn:hover,
.cat-btn.active, .cat-btn:hover {
  background-color: #ff5722;
  color: #fff;
}

/* Секции товаров по подкатегориям */
.subcategory-content {
  display: none; 
  flex-wrap: wrap;
  justify-content: center; 
  gap: 30px;
  opacity: 0;
  position: relative; 
  transition: opacity 0.25s ease;
  visibility: hidden;
  clear: both; 
  margin-top: 20px; 
}

.subcategory-content.active {
  display: flex; 
  opacity: 1;
  visibility: visible;
  clear: both; 
  margin-top: 20px; 
}

#categories-content {
  position: relative;
  min-height: 500px;
}

/* Карточки товара */
.product-card {
  background-color: var(--background-dark);
  border: 2px solid #444;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform var(--transition-default);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex: 1 1 calc(25% - 58px); 
  max-width: 350px; 
  margin: 15px; 
  min-width: 250px; 
  height: auto; 
  min-height: 400px; 
  margin: 10px;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-5px);
}
.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-default);
  will-change: transform;
}
.product-card img:hover {
  transform: scale(1.05);
}
.product-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 15px;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 15px;
  flex: 1;
}
.product-info h3 {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: #e0e0e0;
}
.price {
  font-size: 1.1em;
  color: #ffa500;
  margin-bottom: 5px;
}
.add-to-cart {
  background-color: #4caf50;
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: auto;
  margin-bottom: 5px;
}
.add-to-cart:hover {
  background-color: #43a047;
}
.product-name {
  flex-grow: 1;
  margin-bottom: 15px;
  margin-bottom: 10px;
  min-height: 60px;
}

.product-info hr {
  width: 100%;
  margin: 10px 0;
  border: none;
  border-top: 1px solid #444;
  margin: 5px 0;
}

.product-info h5 {
  margin: 10px 0;
  margin: 5px 0;
}

.product-info .availability {
  margin: 10px 0;
  margin: 5px 0;
}

.product-info .price {
  margin: 10px 0;
  margin: 5px 0;
}

/* Стили для модального окна фото */
.modal-img {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease-in-out;
}

.modal-content-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  opacity: 0; 
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  transform: scale(0.8); 
}

/* Кнопка закрытия */
.close-img {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  transition: 0.3s;
}

.close-img:hover {
  color: red;
}

/* Корзина */
.cart {
  position: fixed;
  bottom: 20px;
  right: 75px;
  background-color: rgba(30, 30, 30, 0.95);
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 100;
  max-width: 600px;
  display: none; 
  min-width: 320px; 
}

.cart-counter {
  background: #43a147;
  color: white;
  font-size: 14px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -5px;
  right: -5px;
  /*visibility: hidden;*/
}

.cart h3 {
  margin-bottom: 10px;
  text-align: center;
}

#cart-items {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 0;
  text-align: center;
  font-size: 12px;
}

#cart-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #333;
  padding: 8px 12px;
  margin-bottom: 5px;
  border-radius: 4px;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.item-name {
  font-size: 14px;
  margin-bottom: 5px;
}

.cart-item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-input {
  width: 50px;
  text-align: center;
  background: #444;
  border: 1px solid #555;
  border-radius: 4px;
  color: white;
  padding: 4px;
  font-size: 14px;
}

.remove-btn {
  background: #ff5722;
  border: none;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
  font-size: 12px;
  transition: background-color 0.3s;
}

.remove-btn:hover {
  background: #f4511e;
}

.cart .cart-total {
  font-size: 18px;
  margin-bottom: 10px;
  text-align: center;
}

/* Кнопка оформления заказа */
.checkout-btn {
  background: #43a147;
  border: none;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  text-align: center;
  display: block;
  width: 100%;
  margin-top: 10px;
}

.checkout-btn:hover {
  background: #4cc252;
}

/* Кнопка открытия корзины в мобильной версии */
.cart-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ff5722;
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-size: 20px;
  cursor: pointer;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cart-toggle:hover {
  background: #e64a19;
}

@media (max-width: 768px) {
  .cart {
    bottom: 80px;
    right: 10px;
    width: 90%;
    max-width: none;
    border-radius: 10px;
    left: 10px; 
    width: auto; 
  }

  #cart-items li {
    flex-direction: column;
    padding: 12px;
  }

  .cart-item-controls {
    flex-direction: row; 
    justify-content: space-between;
    width: 100%;
  }

  .quantity-controls {
    order: 1; 
  }

  .remove-btn {
    order: 2; 
    margin-left: auto; 
  }

  .quantity-controls {
    justify-content: center;
  }

  .remove-btn {
    margin-left: 0;
    padding: 6px 12px;
  }

  .product-card {
    width: calc(100% - 20px) !important; 
    max-width: 350px !important; 
    margin: 10px auto !important; 
    flex: 0 1 auto !important; 
  }

  /* .subcategory-content,
  .category-section,
  .filtered-products-grid {
    padding: 0 10px; Добавляем отступы для контейнеров
  } */
}

/* Стили для модального окна с прокруткой */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 300;
}

.modal-content {
  background: #222;
  color: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Стили для модального окна и формы консультации */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #1e1e1e;
  color: #e0e0e0;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
  width: 90%;
  max-width: 400px;
  animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

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

.modal-content input {
  padding: 12px 15px;
  background-color: #333;
  border: 2px solid #444;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  color: #e0e0e0;
}

.modal-content input:focus {
  border-color: #ff5722;
  outline: none;
}

.modal-content button[type="submit"] {
  background-color: #ff5722;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.modal-content button[type="submit"]:hover {
  background-color: #f4511e;
}

.close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 24px;
  color: #e0e0e0;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #333;
}

/* Карусель */
.carousel {
  position: relative;
  overflow: hidden;
  height: auto;
  margin-bottom: 30px;
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
  width: 100%;
  position: relative;
}

.carousel-item {
  min-width: 100%;
  height: 100%;
  position: relative;
  flex: 0 0 100%;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7); 
}

.carousel-caption {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  width: 80%;
  max-width: 800px;
  background: rgba(0, 0, 0, 0.5); 
  padding: 20px;
  border-radius: 10px;
}

.carousel-caption h2 {
  font-size: 2em;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  color: white;
}

.carousel-caption p {
  font-size: 1.2em;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  color: white;
}

/* Стили для первых слов */
.carousel-caption h2 span:first-child {
  color: red;
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-dot.active {
  background: white;
}

/* Адаптивность */
@media (max-width: 992px) {
  .container {
    padding: 0 20px;
  }
  .cat-btn {
    margin-bottom: 10px;
  }
  .product-card {
    flex: 1 1 200px;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  .contact-info {
    flex-direction: column;
    gap: 10px;
  }
  .consultation-btn {
    width: 100%;
    margin-top: 10px;
  }
  .main-menu {
    padding: 10px 0;
  }
  .menu-container ul {
    flex-direction: column;
    gap: 15px;
    align-items: center; 
  }
  .carousel {
    height: 300px; 
  }
  .carousel-inner {
    height: 100%; 
    display: flex;
    flex-wrap: nowrap; 
  }
  .carousel-item {
    height: 100%; 
    flex: 0 0 100%; 
  }
  .carousel-caption {
    width: 90%;
    padding: 15px;
  }
  .carousel-caption h2 {
    font-size: 1.8em;
  }
  .carousel-caption p {
    font-size: 1em;
  }
  .category-menu {
    flex-direction: column;
    gap: 10px;
  }
  .subcategory-menu {
    margin-bottom: 20px;
    padding: 0 15px; 
  }
  /* .subcategory-content {
    padding: 0 15px;  Добавляем отступы
  } */
  .product-card {
    width: 100%;
    margin: 5px 0;
    flex: 1 1 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .product-card img {
    width: 100%; 
    max-width: none; 
    height: auto; 
    object-fit: cover; 
}
  .subcat-btn {
    margin: 5px; 
    width: calc(100% - 10px); 
    display: block; 
  }
}

/* Стили для модального окна результатов */
.results-content {
    max-width: 1200px !important;
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
}

.filtered-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .car-select-content {
        width: 95% !important;
        padding: 15px;
    }

    .car-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
        padding: 10px;
    }

    .car-brand-btn {
        padding: 10px;
        font-size: 14px;
    }

    .results-content {
        width: 100% !important;
        padding: 10px;
        margin: 0;
    }

    .filtered-products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    /* Стили для заголовков в мобильной версии */
    .filtered-products-grid h2,
    .filtered-products-grid h3 {
        font-size: 18px;
        padding: 10px;
    }

    /* Корректировка размеров карточек товаров */
    .filtered-products-grid .product-card {
        margin: 5px 0;
        width: 100%;
    }

    /* Оптимизация скролла */
    .results-content {
        max-height: 85vh;
        -webkit-overflow-scrolling: touch;
    }
}

/* Фикс отображения на совсем маленьких экранах */
@media (max-width: 320px) {
    .car-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .car-brand-btn {
        padding: 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
  .header-top {
    padding: 10px 20px;
  }
  .carousel {
    height: 200px; 
  }
  .carousel-caption h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
  }
  .carousel-caption p {
    font-size: 0.9em;
  }
  .product-card img {
    height: 180px;
  }
  .product-info h3 {
    font-size: 1em;
  }
  .price {
    font-size: 0.9em;
  }
  .add-to-cart {
    padding: 8px 15px;
    font-size: 0.9em;
  }
  .cart {
    bottom: 80px;
    right: 10px;
    padding: 15px;
  }
  .cart h3 {
    font-size: 1em;
  }
  .cart .cart-total {
    font-size: 1em;
  }
  .modal-content {
    padding: 20px;
  }
  .modal-content h2 {
    font-size: 1.2em;
  }
  .modal-content input {
    padding: 10px;
    font-size: 14px;
  }
  .modal-content button[type="submit"] {
    padding: 10px;
    font-size: 14px;
  }
}

.category-section.active .subcategory-content {
  margin-top: 20px;
}

/* Стили для формы оформления заказа */
.order-details {
  margin: 20px 0;
  padding: 15px;
  background: #262626;
  color: #e0e0e0;
  border-radius: 8px;
}

.cart-item {
  padding: 5px 0;
  border-bottom: 1px solid #ddd;
}

.order-total {
  margin-top: 15px;
  text-align: right;
}

.order-total strong {
  display: block;
  color: #ff5722;
  font-size: 1.2em;
  margin-bottom: 5px;
}

.order-total small {
  color: #666;
  font-style: italic;
}

#order-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

#order-form input {
  padding: 12px 15px;
  background-color: #333;
  border: 2px solid #444;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  color: #e0e0e0;
}

#order-form input:focus {
  border-color: #ff5722;
  outline: none;
}

#order-form button[type="submit"] {
  background-color: #ff5722;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#order-form button[type="submit"]:hover {
  background-color: #f4511e;
}

/* Стили для footer */
.footer {
  background-color: #333;
  color: #fff;
  padding: 30px 0;
  margin-top: 50px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-info, .footer-contacts {
  flex: 1;
  min-width: 250px;
}

.footer-info p, .footer-contacts p {
  margin-bottom: 10px;
  font-size: 14px;
  color: #ccc;
}

.phone a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.phone a:hover {
    color: #ffab40;
}

.footer-contacts a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-contacts a:hover {
    color: #fff;
}

.email a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.email a:hover {
    color: #ffab40;
}

.catalog-btn {
  background-color: #ff5722;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.catalog-btn:hover {
  background-color: #e64a19;
}

.contact-btn {
  background-color: #ff5722;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.contact-btn:hover {
  background-color: #e64a19;
}

/* Модальное окно для контактов */
#contact-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#contact-modal .modal-content {
  background-color: #1e1e1e;
  color: #e0e0e0;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
  width: 90%;
  max-width: 400px;
  animation: modalAppear 0.3s ease;
}

#contact-modal .close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 24px;
  color: #e0e0e0;
  cursor: pointer;
  transition: color 0.3s;
}

#contact-modal .close:hover {
  color: #333;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-info, .footer-contacts {
    width: 100%;
  }
}

#cart-count {
  background: rgb(67, 161, 71);
  color: white;
  font-size: 14px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -5px;
  right: -5px;
  visibility: hidden; 
}

/* Стиль для уведомления */
#cart-notification {
  position: fixed;
  right: 63px;
  bottom: 63px;
  transform: none;
  background-color: rgba(67, 161, 72, 0.884);
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  display: none;
  opacity: 0;
  z-index: 1000;
  animation: fadeInOut 2s ease-in-out forwards;
  pointer-events: none;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  12.5% {
    opacity: 1;
    transform: translateY(0);
  }
  87.5% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Стили для контролов количества */
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quantity-btn {
  background: #43a147;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: background-color 0.3s;
  min-width: 24px;
  height: 24px;
  font-size: 16px;
  padding: 0;
}

.quantity-btn:hover {
  background: #444;
}

.quantity {
  min-width: 20px;
  text-align: center;
}

.quantity-input {
  width: 50px;
  text-align: center;
  background: #444;
  border: 1px solid #555;
  border-radius: 4px;
  color: white;
  padding: 4px;
  font-size: 14px;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.quantity-input[type=number] {
  appearance: none;
  -moz-appearance: textfield;
}

/* Стили для модального окна выбора марки */
.car-select-content {
    max-width: 800px !important;
    width: 90% !important;
    max-height: none !important;
}

.car-brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 20px;
}
.car-brand-btn {
  background: #333;
  color: white;
  border: 1px solid #444;
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-size: 16px;
}

.car-brand-btn:hover {
  background: #ff5722;
  transform: translateY(-2px);
}
/* Стили для модального окна результатов */
.results-content {
    max-width: 1200px !important;
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
}

.filtered-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .car-select-content {
        width: 95% !important;
        padding: 15px;
    }

    .car-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
        padding: 10px;
    }

    .car-brand-btn {
        padding: 10px;
        font-size: 14px;
    }

    .results-content {
        width: 100% !important;
        padding: 10px;
        margin: 0;
    }

    .filtered-products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    /* Стили для заголовков в мобильной версии */
    .filtered-products-grid h2,
    .filtered-products-grid h3 {
        font-size: 18px;
        padding: 10px;
    }

    /* Корректировка размеров карточек товаров */
    .filtered-products-grid .product-card {
        margin: 5px 0;
        width: 100%;
    }

    /* Оптимизация скролла */
    .results-content {
        max-height: 85vh;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 320px) {
    .car-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .car-brand-btn {
        padding: 8px;
        font-size: 12px;
    }
}

.car-select-btn {
    background-color: #ff5722;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.car-select-btn:hover {
    background-color: #e64a19;
}

/* Стили для контейнера изображения */
.product-image-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.product-image-container img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-default);
  will-change: transform;
}

.image-hover-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.product-image-container:hover .image-hover-text {
  transform: translateY(0);
}

.product-image-container:hover img {
  transform: scale(1.05);
}

/* Стили для breadcrumbs */
.breadcrumbs {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 0;
    margin-bottom: 20px;
}

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    color: #fff;
}

.breadcrumbs li:not(:last-child)::after {
    content: "→";
    margin: 0 10px;
    color: #ff5722;
}

.breadcrumbs a {
    color: #ff5722;
    text-decoration: none;
}

/* Кнопка прокрутки вверх */
#scroll-top {
  pointer-events: auto;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #ff5722;
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    font-size: 16px;
    z-index: 1000;
    opacity: 0.8;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    padding: 5px;
}

#scroll-top:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .breadcrumbs {
        padding: 5px 15px;
    }
    
    #scroll-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 12px; 
        padding: 2px; 
    }
}

/* Стили для кнопки подбора по марке в каталоге */
.catalog-car-select {
    text-align: center;
    margin-top: 20px;
}

.car-select-btn-catalog {
    background-color: #ff5722;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    margin: 0 auto;
}

.car-select-btn-catalog:hover {
    background-color: #e64a19;
}

@media (max-width: 768px) {
    .car-select-btn-catalog {
        padding: 10px 20px;
        font-size: 14px;
        width: 90%;
        max-width: 300px;
    }
}




