:root {
  --primary: #0d6efd;
  --primary-hover: #0a58ca;
  --secondary: #6c757d;
  --dark: #212529;
  --light: #f8f9fa;
  --whatsapp: #25D366;
  --whatsapp-hover: #128C7E;
}

/* Но разрешить выделение для форм */
input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ===== Общие стили ===== */
canvas {
  display: block;
  position: fixed;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

a {
  z-index: 5 !important;
  position: relative;
}

body {
  font-family: 'Exo 2', 'Arial', sans-serif !important;
  color: #333;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ===== Хедер ===== */
.navbar {
  padding: 0.8rem 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background:
    linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url('/img/footer-banner.webp') no-repeat center center/cover;
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.navbar-brand img {
  height: 40px;
  margin-right: 10px;
  transition: transform 0.3s ease;
}

.navbar-brand:hover img {
  transform: rotate(-5deg);
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  margin: 0 0.2rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.25);
  font-weight: 600;
}

/* ===== Кнопки ===== */
.btn {
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.header-phone-btn {
  background-color: white;
  color: var(--primary);
  font-weight: 600;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.header-phone-btn:hover {
  background-color: var(--light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-whatsapp {
  background-color: var(--whatsapp);
  color: white;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.btn-whatsapp:hover {
  background-color: var(--whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.header-btn-icon {
  margin-right: 8px;
  font-size: 1.1em;
}

/* ===== Hero секция ===== */
.hero {
  background:
    linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url('/img/hero-ecu-truck-service-banner.webp') no-repeat center center/cover;
  color: white;
  padding: 6rem 0;
  text-align: center;
  min-height: 500px;
  display: flex;
  align-items: center;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ===== Общие секции ===== */
.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--dark);
  text-align: center;
  position: relative;
}

.section-title:after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: var(--primary);
  margin: 15px auto;
}

/* ===== Карточки ===== */

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Карточки товаров */
.product-card {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  margin-bottom: 20px;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-img {
  height: 200px;
  object-fit: contain;
  background: #f5f5f5;
  padding: 15px;
  width: 100%;
}

.product-title {
  font-size: 1.2rem;
  margin: 15px 0 5px;
}

.product-price {
  font-weight: bold;
  color: var(--primary);
  font-size: 1.3rem;
}

/* ===== Преимущества ===== */
.feature-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* ===== Подвал ===== */
footer {
  background:
    linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url('/img/footer-banner.webp') no-repeat center center/cover;
}

footer a {
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--primary) !important;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 10px 0;
}

.footer-logo img {
  max-height: 100%;
  max-width: 50%;
  width: auto;
  height: auto;
  object-fit: contain;
  z-index: 10;
}

/* Для адаптации на мобильных устройствах */
@media (max-width: 768px) {
  .footer-logo {
    height: auto;
    margin-bottom: 20px;
  }

  .footer-logo img {
    max-height: 80px;
  }
}

/* ===== Бейджи ===== */
.badge {
  font-weight: 500;
  padding: 0.5em 0.8em;
}

.brand-container {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.brand-container .badge {
  font-size: 0.8em;
  padding: 5px 8px;
  color: white;
}

/* ===== Адаптивность ===== */
@media (max-width: 991.98px) {
  .navbar-collapse {
    padding-top: 1rem;
  }

  .nav-link {
    margin: 0.2rem 0;
    padding: 0.8rem 1rem !important;
  }

  .header-buttons {
    margin-top: 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-phone-btn,
  .btn-whatsapp {
    justify-content: center;
    width: 50%;
    margin-left: 0 !important;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 0;
    min-height: 400px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .section {
    padding: 2rem 0;
  }

  .navbar-brand img {
    height: 35px;
  }

  .navbar-brand {
    font-size: 1.1rem;
  }

  .product-img {
    height: 180px;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .product-title {
    font-size: 1.1rem;
  }

  .product-price {
    font-size: 1.2rem;
  }
}

@media (max-width: 767.98px) {
  .product-actions .btn {
    margin-bottom: 0.5rem;
    width: 100%;
  }
}

.comments-section {
  max-width: 800px;
  margin: 0 auto;
}

.comment-card {
  border-left: 4px solid var(--primary);
  transition: all 0.3s ease;
}

.comment-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.comment-actions .btn {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
}

#commentsList .spinner-border {
  width: 2rem;
  height: 2rem;
}

.form-text.text-warning {
  font-weight: 500;
}

/* ===== Общие стили для карточек ===== */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  z-index: 1;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-body {
  display: flex;
  flex-direction: column;
  background-color: rgb(203, 227, 249);
}

.card-title {
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.card-text {
  color: #666;
  flex-grow: 1;
}

/* ===== Бейджи ===== */
.badge {
  font-weight: 500;
  padding: 0.5em 0.8em;
  margin-bottom: 0.5rem;
  align-self: flex-start;
}

/* ===== Анимации ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Кнопки с эффектом ripple ===== */
.btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }

  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

/* ===== Хлебные крошки ===== */
.breadcrumb {
  background-color: transparent;
  padding: 0.75rem 0;
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

/* ===== Кастомный скроллбар ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* Стили для системы комментариев */
.toggle-icon {
  transition: transform 0.3s ease;
}

.toggle-replies-btn.collapsed .toggle-icon {
  transform: rotate(0deg);
}

.toggle-replies-btn:not(.collapsed) .toggle-icon {
  transform: rotate(180deg);
}

.replies {
  transition: all 0.3s ease;
}

.reply-card {
  border-left: 3px solid #007bff;
  transition: background-color 0.2s ease;
}

.reply-card:hover {
  background-color: #f8f9fa !important;
}

.comment-card {
  transition: box-shadow 0.2s ease;
}

.comment-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}