/* СОЧНОАВТО - Dark theme styles */
:root {
  --bg-primary: #0f1419;
  --bg-secondary: #1a2332;
  --bg-card: rgb(30, 42, 58);
  --bg-hover: #253344;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-gold: #f59e0b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Header */
.sochno-header {
  background: linear-gradient(180deg, rgba(26, 35, 50, 0.98) 0%, rgba(15, 20, 25, 0.95) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  position: relative;
  z-index: 1060;
}

.sochno-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  transition: color 0.2s;
}

.sochno-logo:hover {
  color: var(--accent);
}

.sochno-logo-icon {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--accent), var(--accent-gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.nav-link-custom {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-link-custom:hover {
  color: var(--text-primary) !important;
  background-color: var(--bg-hover);
}

/* Search */
.search-wrapper {
  position: relative;
  max-width: 320px;
}

.search-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-results {
  position: fixed !important;
  top: 100%;
  transform: translateX(-50%);
  left: 50%;
  right: 0;
  background: rgba(30, 42, 58, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1050;
  box-shadow: var(--shadow);
  width: 90vw;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-title {
  font-size: 1rem;
  font-weight: 600;
}

.search-result-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-contact {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  border: none;
  color: white;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 10px;
  transition: all 0.2s;
}

.btn-contact:hover {
  background: linear-gradient(135deg, var(--accent-hover), #1d4ed8);
  color: white;
  transform: translateY(-1px);
}

/* Mobile menu */
.navbar-toggler {
  border-color: var(--border-color);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px var(--accent);
}

/* Footer */
.sochno-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.footer-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 50%;
  color: var(--text-primary);
  transition: all 0.2s;
}

.footer-link:hover {
  background: var(--accent);
  color: white;
}

/* Carousel - touch/swipe friendly */
.carousel {
  touch-action: pan-y;
}

.carousel-inner {
  touch-action: pan-y;
}

/* Carousel dealership (hero) - cover для баннера */
.carousel-dealership {
  max-width: 1400px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
}

.carousel-dealership .carousel-item {
  height: 70vh;
  min-height: 400px;
}

.carousel-dealership .carousel-item > .img-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(20px);
  transform: scale(1.1);
  z-index: 0;
}

.carousel-dealership .carousel-item img:not(.img-background) {
  object-fit: contain;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.carousel-control-prev,
.carousel-control-next {
  width: 60px;
  opacity: 0.7;
  border-radius: 8px;
  margin: 0 1rem;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

/* Cards */
.card-dark {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}

.card-dark:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-carousel {
  height: 280px;
  min-height: 260px;
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
}

.card-carousel .carousel-item {
  transition: none !important;
}

.card-carousel .carousel-inner {
  height: 100%;
}

.card-carousel .carousel-inner .carousel-item {
  height: 100%;
}

.card-carousel .carousel-inner .carousel-item .d-block {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-carousel .carousel-inner .carousel-item .d-block .img-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(20px);
  transform: scale(1.1);
  z-index: 0;
  clip-path: inset(0 100% 0 0);
}

.card-carousel .carousel-inner .carousel-item.active .d-block .img-background {
  clip-path: inset(0 0 0 0);
}

.card-carousel .carousel-inner .carousel-item .d-block img:last-child {
  object-fit: contain !important;
  object-position: center;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  position: relative;
  z-index: 2;
}

/* Область клика на всю высоту: обёртка на весь блок, две кнопки по 50% ширины */
.card-carousel-controls-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
}

.card-carousel-controls-wrap .carousel-control-prev.card-carousel-control,
.card-carousel-controls-wrap .carousel-control-next.card-carousel-control {
  position: static;
  flex: 1;
  width: auto;
  max-width: none;
  height: auto;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  opacity: 0;
}

.card-carousel-controls-wrap .carousel-control-prev.card-carousel-control:hover,
.card-carousel-controls-wrap .carousel-control-next.card-carousel-control:hover,
.card-carousel-controls-wrap .carousel-control-prev.card-carousel-control:focus,
.card-carousel-controls-wrap .carousel-control-next.card-carousel-control:focus,
.card-carousel-controls-wrap .carousel-control-prev.card-carousel-control:active {
  background: transparent;
  opacity: 0;
  border: none;
}

.card-carousel .carousel-indicators {
  margin-bottom: 0.25rem;
}

.card-carousel .carousel-indicators button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Special offers carousel */
.offers-carousel .carousel-inner {
  padding: 0.5rem 0;
}

.offers-carousel .carousel-control-prev,
.offers-carousel .carousel-control-next {
  width: 50px;
  top: 50%;
  transform: translateY(-50%);
}

/* Category cards */
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}

.category-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.category-card-active {
  border-color: var(--accent);
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Feedback cards */
.feedback-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.company-response {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent);
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 0 8px 8px 0;
}

.stars-rating {
  color: var(--accent-gold);
}

/* Offer page */
.offer-carousel-large {
  border-radius: 20px !important;
  overflow: visible !important;
  background-color: transparent !important;
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto;
  position: relative;
}

.offer-carousel-large .carousel-inner {
  border-radius: 20px !important;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  min-height: 200px;
}

.offer-carousel-large .carousel-item {
  border-radius: 20px !important;
  overflow: hidden !important;
  text-align: center;
  background: none !important;
  position: relative;
}

.offer-carousel-large .carousel-item img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 500px !important;
  object-fit: contain !important;
  border-radius: 20px !important;
  display: inline-block !important;
  transition: transform 0.3s ease !important;
  vertical-align: middle;
}

.offer-carousel-large .carousel-inner .img-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(20px);
  transform: scale(1.1);
  z-index: 0;
  border-radius: 20px;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Убираем дефолтные Bootstrap контролы */
.offer-carousel-large .carousel-control-prev,
.offer-carousel-large .carousel-control-next {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  width: 50px !important;
  height: 50px !important;
  background: rgba(0,0,0,0.0) !important;
  border: none !important;
  border-radius: 50% !important;
  opacity: 1 !important;
  transition: all 0.3s ease !important;
  margin: 0 !important;
  left: 50px !important;
  right: auto !important;
}

.offer-carousel-large .carousel-control-next {
  left: auto !important;
  right: 50px !important;
}



.nav-tabs-dark .nav-link {
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1.5rem;
}

.nav-tabs-dark .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

/* Contacts */
.contact-info {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
}

.yandex-map {
  border-radius: 12px;
  overflow: hidden;
  height: 400px;
}

/* Pagination */
.pagination-dark .page-link {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.pagination-dark .page-link:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.pagination-dark .page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
}

/* Modal */
.modal-dark .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.modal-dark .form-control {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.modal-dark .form-control:focus {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--text-primary);
}

.modal-dark .btn-close {
  filter: invert(1);
}

.modal {
  z-index: 9999 !important
}

/* Section titles */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* Min height for content */
.content-wrapper {
  min-height: calc(100vh - 200px);
}

/* Mobile header */
@media (max-width: 991px) {
  .search-wrapper {
    max-width: 100%;
  }
  .navbar-collapse {
    padding-top: 1rem;
  }
  .navbar-contact-wrap {
    justify-content: center;
    width: 100%;
  }
}

/* Bootstrap dark overrides - visible text */
.text-secondary {
  color: var(--text-secondary) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Card text visibility */
.card-dark .card-title,
.card-dark .card-body,
.card-dark .card-text {
  color: var(--text-primary) !important;
}

.card-dark .card-text.text-secondary {
  color: var(--text-secondary) !important;
}

.sochno-footer,
.sochno-footer .text-secondary,
.sochno-footer .text-muted {
  color: var(--text-secondary);
}

.sochno-footer .text-muted {
  color: var(--text-muted);
}

.sochno-footer p {
  color: var(--text-secondary);
}

/* Bootstrap dark overrides */
.bg-secondary.bg-opacity-25 {
  background-color: rgba(26, 35, 50, 0.5) !important;
}

.text-primary {
  color: var(--accent) !important;
}

.offers-carousel-prev,
.offers-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(26, 35, 50, 0.9);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    opacity: 0.8;
    transition: all 0.3s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offers-carousel-prev:hover,
.offers-carousel-next:hover {
    opacity: 1;
    background: rgba(59, 130, 246, 0.9);
    border-color: var(--accent);
}

.offers-carousel-prev {
    left: 20px;
}

.offers-carousel-next {
    right: 20px;
}

/* На мобильных устройствах делаем кнопки меньше и ближе к контенту */
@media (max-width: 991px) {
    .offers-carousel-prev,
    .offers-carousel-next {
        width: 40px;
        height: 40px;
    }
    
    .offers-carousel-prev {
        left: 10px;
    }
    
    .offers-carousel-next {
        right: 10px;
    }
}

/* Увеличиваем область клика */
.offers-carousel-prev::before,
.offers-carousel-next::before {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -20px;
    left: -20px;
    right: -20px;
}

/* ВАЖНО: Исправляет конфликт свайпов на мобильных */
.card-carousel {
    touch-action: pan-y pinch-zoom; /* Разрешает верт. скролл, но блокирует гориз. свайп страницы внутри карточки */
}

/* ВАЖНО: Гарантирует, что слайдер предложений не схлопнется в 0px */
.offers-carousel .carousel-item {
    min-height: 450px; /* Высота карточки + отступы */
    transition: transform 0.6s ease-in-out; /* Плавность */
}

/* Дополнительная страховка для самих карточек */
.card-special-offer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Стили для навигации специальных предложений */
.special-offers-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 5;
}

.special-offers-navigation .carousel-control-prev,
.special-offers-navigation .carousel-control-next {
    background-color: rgba(255, 255, 255, 0.08) !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.card-title-car:hover {
  color: var(--accent) !important;
}

.cursor-pointer {
  cursor: pointer !important
}

.search-cars-navigation {
  position: static;
  transform: none;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.search-cars-navigation .carousel-control-prev,
.search-cars-navigation .carousel-control-next {
  position: static;
  margin: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-cars-navigation .carousel-control-prev-icon,
.search-cars-navigation .carousel-control-next-icon {
  width: 1.2rem;
  height: 1.2rem;
  filter: invert(0.4);
}

/* На мобильных устройствах */
@media (max-width: 767.98px) {
    .special-offers-navigation {
        position: static;
        transform: none;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    .special-offers-navigation .carousel-control-prev,
    .special-offers-navigation .carousel-control-next {
        position: static;
        margin: 0 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .special-offers-navigation .carousel-control-prev-icon,
    .special-offers-navigation .carousel-control-next-icon {
        width: 1.2rem;
        height: 1.2rem;
        filter: invert(0.4);
    }

    .offer-carousel-large .carousel-item img {
      max-height: 400px !important;
    }

    .offer-carousel-large .carousel-control-prev {
      left: 1px !important;
      right: auto !important;
    }

    .offer-carousel-large .carousel-control-next {
      left: auto !important;
      right: 1px !important;
    }
}

/* Адаптация для планшетов */
@media (max-width: 991.98px) {
    .special-offers-navigation .carousel-control-prev {
        left: -1.5rem;
    }
    
    .special-offers-navigation .carousel-control-next {
        right: -1.5rem;
    }
}

@media (max-width: 576px) {
  .offer-carousel-large .carousel-item img {
    max-height: 300px !important;
  }
}
