/* Кнопки */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Стили для промо-бара */
.promotion-bar {
    background: var(--gradient-primary) !important;
    font-size: 0.95rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.promotion-bar .fw-bold {
    color: #ffd700; /* Золотой цвет для выделения */
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Навигация */
.nav-link {
    position: relative;
    color: #333 !important;
    font-weight: 500;
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover:after {
    width: 100%;
}

/* Стили для многоуровневого выпадающего меню */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    border-radius: 0 6px 6px 6px;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

.dropdown-submenu .dropdown-toggle::after {
    display: none;
}

/* Карточки товаров */
.product-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-img {
    height: 200px;
    object-fit: cover;
}

/* Анимация смены изображения */
#main-product-image {
    transition: opacity 0.3s ease;
}

#main-product-image.fade-out {
    opacity: 0;
}

/* Стили для галереи */
.cursor-zoom {
    cursor: zoom-in;
}

.thumbnail {
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.thumbnail.active {
    border: 2px solid #3333FF;
}

.thumbnail img {
    transition: transform 0.3s ease;
}

.thumbnail:hover img {
    transform: scale(1.05);
}

/* Стили для увеличенного изображения */
.cursor-zoom {
    cursor: zoom-in;
}

.modal-content.bg-transparent {
    background-color: transparent;
    box-shadow: none;
}

.btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Кнопки навигации */
.btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-light {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
}

.btn-light:hover {
    background-color: white;
}

/* Стили для страницы поиска */
.search-results-header {
    background: linear-gradient(135deg, #84CEEB, #5AB9EA);
    padding: 30px 0;
    margin-bottom: 30px;
    color: white;
}

.filter-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.filter-card .card-header {
    background: var(--gradient-primary) !important;
    border: none;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 12px 15px;
}

.filter-card .card-body {
    padding: 1.5rem;
    overflow: visible;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.filter-group-title[aria-expanded="false"] .fa-chevron-down {
  transform: rotate(-90deg);
}

.filter-group-title[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.filter-group-title i {
  transition: transform 0.3s ease;
}

/* Элементы форм */
.filter-card select,
.filter-card input:not([type="range"]),
.filter-card .input-group-text {
  border-radius: 8px !important;
  border: 1px solid #dde1e6;
  transition: all 0.3s ease;
}

.filter-card select:focus,
.filter-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(51, 51, 255, 0.2);
}

.filter-card .input-group-text {
  background: var(--gradient-light);
  border-right: none;
}

/* Стили для двойного ползунка */
.noUi-target {
  height: 6px;
  border: none;
  box-shadow: none;
  background: #e9ecef;
  margin-bottom: 20px;
}

.noUi-connect {
  background: var(--gradient-primary);
}

.noUi-handle {
  width: 18px;
  height: 18px;
  top: -7px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  background: var(--primary);
  cursor: pointer;
}

.noUi-handle:before,
.noUi-handle:after {
  display: none;
}

.noUi-tooltip {
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: white;
  border: none;
}

/* Стили для аккордеона групп характеристик */
#features-accordion {
    margin-top: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid #e9ecef;
}

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

.accordion-button {
    font-weight: 600;
    padding: 12px 15px;
    background-color: #f8f9fa;
    color: #333;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-light);
    color: var(--primary);
    box-shadow: none;
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%233333FF'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-body {
    padding: 15px;
    background-color: #fff;
}

/* Стили для иконок групп */
.accordion-button i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: var(--primary);
}

.accordion-button .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.accordion-button:not(.collapsed) .badge {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.accordion-item.disabled .accordion-button {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.accordion-item.disabled .accordion-button .badge {
    background-color: #e9ecef;
    color: #6c757d;
    border-color: #dee2e6;
}

.accordion-item.disabled .accordion-button::after {
    display: none;
}


/* Бейджи для количества характеристик */
.badge.bg-primary {
    background: var(--gradient-primary) !important;
}

/* Легкий фон для открытой группы */
.accordion-button:not(.collapsed) {
    background-color: rgba(51, 51, 255, 0.05);
}

/* Стили для чекбоксов характеристик */
.feature-filter {
    margin-bottom: 1.5rem;
}

.feature-filter label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.feature-checkboxes {
    position: relative;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    max-height: 200px;
    overflow-y: auto;
    margin-left: 0;
    width: 100%;
    box-sizing: border-box;
}

.feature-checkboxes .form-check {
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    display: block;
    align-items: center;
    margin-left: 0;
    position: relative;
    min-height: 36px;
}

.feature-checkboxes .form-check:last-child {
    border-bottom: none;
}

.feature-checkboxes .form-check-input {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid var(--primary);
    cursor: pointer;
    z-index: 1;
    flex-shrink: 0;
}

.feature-checkboxes .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.feature-checkboxes .form-check-label {
    font-size: 0.95rem;
    flex-grow: 1;
    display: block;
    padding-left: 40px;
    padding-top: 2px;
    min-height: 28px;
    cursor: pointer;
    line-height: 28px;
    transition: color 0.2s;
}

.feature-checkboxes .form-check-label:hover {
    color: var(--primary);
}

.feature-checkboxes .form-check-input:checked + .form-check-label {
    font-weight: 500;
}


/* Кнопки */
.filter-actions {
    margin-top: 1rem;
}

/* Стили элементов формы */
.filter-card select,
.filter-card input {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  font-size: 0.9rem;
}

.filter-card select:focus,
.filter-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(51, 51, 255, 0.1);
}

/* Кнопки в стиле каталога */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(51, 51, 255, 0.3);
}

.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}



/* Адаптивность */
@media (max-width: 767.98px) {
      .filter-body {
        display: none;
      }

      .filter-body.show {
        display: block;
      }

      .toggle-filters .fa-chevron-down {
        transition: transform 0.3s ease;
      }

      .filter-card .card-body {
         padding: 1rem;
      }

      .feature-checkboxes {
        max-height: 150px;
      }

      .feature-checkboxes .form-check-input {
        left: 10px;
        width: 18px;
        height: 18px;
    }

    .feature-checkboxes .form-check-label {
        padding-left: 35px;
        font-size: 0.9rem;
    }

}
/* Поисковые подсказки */
.search-suggestions {
    border: 1px solid #dee2e6;
}

.suggestion-item {
    transition: all 0.2s ease;
    padding: 8px 12px;
    color: #212529;
    text-decoration: none;
    display: block;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #f8f9fa;
    color: #3333FF;
}

.suggestion-item .fa-search {
    width: 16px;
    text-align: center;
    margin-right: 8px;
    color: #6c757d;
}

.search-suggestions::before {
    content: 'Загрузка...';
    display: block;
    padding: 10px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.search-container {
    position: relative;
}

/* Пагинация */
.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white; /* Белый текст для лучшей читаемости */
    font-weight: 500;
}

.pagination .page-link {
    color: var(--primary);
    border: 1px solid #dee2e6;
    margin: 0 3px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: var(--primary);
}

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    border-radius: 8px;
}

/* Футер */
.footer {
    background: var(--gradient-primary);
    color: white;
    padding: 40px 0 20px;
}

.footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

#registration-prompt {
    z-index: 1060; /* Выше чем модальные окна Bootstrap (1050) */
    animation: slideDown 0.5s ease-out;
}

.position-relative .bg-white {
    z-index: 1;
    padding: 0 10px;
}

.position-relative hr {
    margin: 0;
    border-top: 1px solid #dee2e6;
}

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

/* Стили для миниатюр в сайдбаре */
.sidebar-thumbnail {
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.sidebar-thumbnail:hover {
    transform: scale(1.05);
}

/* Заглушка для изображения */
.thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    color: #adb5bd;
}

/* Стиль для текста в две строки с многоточием */
.two-line-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-height: 2.6em; /* 2 строки * 1.3 line-height */
    font-size: 0.95rem;
    margin-bottom: 0.2rem !important;
}

/* Адаптивность для популярных статей */
@media (max-width: 1199px) {
    .two-line-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 991px) {
    .two-line-text {
        -webkit-line-clamp: 3;
        max-height: 3.9em;
    }
}

@media (max-width: 767px) {
    .two-line-text {
        font-size: 0.85rem;
        line-height: 1.25;
        max-height: 2.5em; /* 2 строки */
    }
}

/* Стили для отдела заботы о клиентах */
.customer-care-section {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.customer-care-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.customer-care-icon {
    height: 100px;
    margin-bottom: 1.5rem;
}

.customer-care-icon svg {
    height: 100%;
    width: auto;
    fill: var(--primary);
}

.customer-care-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.customer-care-link {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
    display: block;
}

.customer-care-link:hover {
    background: #e9ecef;
    color: var(--primary);
    transform: translateX(5px);
}

.modal-link {
    cursor: pointer;
}

/* Адаптивность */
@media (max-width: 991px) {
    .customer-care-section {
        margin-bottom: 1.5rem;
    }
}

/* Stepper */
.stepper {
    position: relative;
    padding-left: 30px;
}

.step {
    position: relative;
    padding-bottom: 30px;
}

.step:last-child {
    padding-bottom: 0;
}

.step-number {
    position: absolute;
    left: -30px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step:after {
    content: '';
    position: absolute;
    left: -18px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.step:last-child:after {
    display: none;
}

.step-content {
    padding-left: 15px;
}

/* Alert variations */
.bg-light-success {
    background-color: rgba(40, 167, 69, 0.1) !important;
    border-left: 3px solid #28a745;
}

.bg-light-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-left: 3px solid #dc3545;
}

/* Стили для панели категорий */
.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(51, 51, 255, 0.3);
    transform: translateY(-2px);
}

.btn-outline-primary i {
    font-size: 1rem;
    vertical-align: middle;
}

/* Стили для карточек категорий */
.category-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: 200px; /* Фиксированная высота для всех карточек */
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Градиент для текста */
.bg-gradient-bottom {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}

/* Анимация при наведении */
.category-card:hover img {
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

.category-card img {
    transition: transform 0.5s ease;
}

/* Для пустых карточек без изображения */
.category-card .fa-box-open {
    opacity: 0.5;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(51, 51, 255, 0.3);
    transform: translateY(-2px);
}