/* ==================================================================
   ОСНОВНАЯ ШАПКА (HEADER)
   ================================================================== */

header {
  background-color: #ffffff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #dee2e6;
  position: static !important;
}

header .container > .row {
  min-height: 60px !important;
  padding: 0.5rem 0 !important;
}

header .container .col-md-3 img {
  height: 50px !important;
}

header .container .col-md-3 .h5 {
  font-size: 1.1rem !important;
  font-family: "Montserrat", "Roboto", sans-serif;
  font-weight: 700;
}

header .container .col-md-3 .small {
  font-size: 0.8rem !important;
  font-family: "Montserrat", "Roboto", sans-serif;
  font-weight: 500;
}

/* Логотип */
.logo-wrapper {
  position: relative;
  z-index: 1000;
}

.logo-image {
  height: 50px;
  width: auto;
}

.logo-text-container {
  margin-top: 10px;
}

/* ==================================================================
   НАВИГАЦИОННОЕ МЕНЮ
   ================================================================== */

.navbar {
  min-height: 50px !important;
  padding: 0.3rem 0 !important;
  font-family: "Montserrat", "Roboto", sans-serif;
}

.navbar-nav {
  column-gap: 0.4rem !important;
  flex-wrap: wrap;
}

.navbar-nav .nav-item {
  position: relative;
}

.navbar-nav .nav-link {
  padding: 0.5rem 1rem !important;
  font-size: 0.9rem !important;
  font-weight: 600;
  white-space: nowrap;
  color: #212529;
  font-family: "Montserrat", "Roboto", sans-serif;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
  color: #0d6efd;
  background-color: #f8f9fa;
  border-color: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.navbar-nav .nav-link.active {
  color: #ffffff;
  background-color: #0d6efd;
  border-color: #0d6efd;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

/* ==================================================================
   ВЫПАДАЮЩИЕ МЕНЮ
   ================================================================== */

.navbar-nav .dropdown-menu {
  min-width: 260px;
  padding: 0.5rem 0;
  margin-top: 0.4rem !important;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1060;
  font-family: "Montserrat", "Roboto", sans-serif;
  background: #fcfcfc;
}

.navbar-nav .dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.navbar-nav .dropdown-item {
  padding: 0.65rem 1.25rem !important;
  font-size: 0.85rem !important;
  border-radius: 4px;
  margin: 0 0.5rem;
  transition: all 0.15s ease;
  font-family: "Montserrat", "Roboto", sans-serif;
  font-weight: 500;
  color: #212529;
  border-left: 3px solid transparent;
}

.navbar-nav .dropdown-item:hover {
  background-color: #f8f9fa;
  color: #0d6efd;
  border-left-color: #0d6efd;
  padding-left: 1.5rem;
}

.navbar-nav .dropdown-item strong {
  color: #0d6efd;
  font-weight: 700;
}

.navbar-nav .dropdown-item strong:hover {
  background-color: transparent;
  color: #0d6efd;
}

.dropdown-divider {
  margin: 0.4rem 0.75rem !important;
  border-color: rgba(0, 0, 0, 0.08);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

/* Стрелки выпадающих меню */
.navbar-nav .dropdown > .btn.dropdown-toggle::after {
  display: none;
}

.navbar-nav .dropdown > .nav-link {
  position: relative;
  padding-right: 2.2rem !important;
}

.navbar-nav .dropdown > .nav-link::after {
  content: "▾";
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #6c757d;
  transition: all 0.2s ease;
  font-weight: normal;
}

.navbar-nav .dropdown > .nav-link:hover::after {
  color: #0d6efd;
  transform: translateY(-50%) rotate(180deg);
}

.navbar-nav .dropdown:hover > .nav-link::after {
  transform: translateY(-50%) rotate(180deg);
}

.navbar-nav .dropdown > .btn.dropdown-toggle {
  display: none !important;
}

.navbar-nav .dropdown {
  position: relative;
}

.navbar-nav .dropdown::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1002;
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

.navbar-nav .dropdown:hover::before {
  opacity: 1;
  visibility: visible;
}

.navbar-nav .dropdown-menu {
  margin-top: 8px !important;
  padding-top: 8px !important;
}

.navbar-nav .dropdown-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent;
}

/* ==================================================================
   ПЕРЕРАБОТАННЫЙ ПОИСК (ВЫДВИЖНАЯ ПАНЕЛЬ, ИСПРАВЛЕННАЯ ВЕРСИЯ)
   ================================================================== */

/* Контейнер для всего блока поиска */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  margin-right: 1rem;
  z-index: 1050;
}

/* Кнопка-лупа */
.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #6c757d;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1052;
}

.search-toggle:hover {
  color: #0d6efd;
  transform: scale(1.1);
}

/* Контейнер с формой поиска */
.search-panel {
  position: absolute;
  top: 0;
  right: 40px;
  width: 0;
  overflow: hidden;
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid #e0e0e0;
  transition: width 0.3s ease-in-out;
  z-index: 1051;
  height: 40px;
  box-sizing: border-box;
}

/* Активное состояние панели (когда открыта) */
.search-wrapper.active .search-panel {
  width: 320px;
  border-color: #0d6efd;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.2);
}

/* Форма поиска */
.search-form {
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Поле ввода - ИСПРАВЛЕНО */
.search-input {
  width: 100%;
  height: 38px;
  border: none;
  background: transparent;
  padding: 0 16px;
  font-size: 14px;
  color: #333333;
  outline: none;
  border-radius: 20px;
  box-sizing: border-box;
  display: block;
  visibility: visible;
  opacity: 1;
}

.search-input::placeholder {
  color: #999999;
  font-size: 14px;
  opacity: 1;
}

.search-input:focus {
  outline: none;
  box-shadow: none;
}

/* Убираем стандартный крестик в браузерах */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}

/* Для Firefox */
.search-input::-moz-search-clear-button {
  display: none;
}

/* Для IE/Edge */
.search-input::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  .search-wrapper.active .search-panel {
    width: 240px;
  }
  
  .search-input {
    padding: 0 12px;
    font-size: 13px;
  }
  
  .search-input::placeholder {
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .search-wrapper.active .search-panel {
    width: 180px;
  }
  
  .search-input {
    padding: 0 10px;
    font-size: 12px;
  }
  
  .search-input::placeholder {
    font-size: 12px;
  }
}

/* ==================================================================
   КОРЗИНА
   ================================================================== */

#headerCart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

#header-cart-count {
  background-color: #0d6efd;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7rem;
  position: absolute;
  top: -5px;
  right: -5px;
}

.cart-dropdown {
  min-width: 300px;
  max-width: 350px;
}

.empty-cart {
  text-align: center;
  padding: 20px 0;
}

.empty-cart-icon {
  font-size: 3rem;
  color: #dee2e6;
  margin-bottom: 10px;
}

.empty-cart-text {
  font-weight: 600;
  margin-bottom: 5px;
}

.empty-cart-subtext {
  font-size: 0.8rem;
  color: #6c757d;
}

.cart-footer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #dee2e6;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
}

/* ==================================================================
   СТАРЫЙ ПОИСК (ПОЛНОСТЬЮ СКРЫТ)
   ================================================================== */

.search-container,
.search-toggle-btn,
.search-form-container,
.search-close {
  display: none !important;
}

/* ==================================================================
   АНИМАЦИИ
   ================================================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideFromTop {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
/* Максимально конкретный селектор */
header .navbar-nav .dropdown-menu .dropdown-item.active {
  background-color: rgba(13, 110, 253, 0.06) !important;
  color: #0d6efd !important;
}

/* Или так */
li .dropdown-item.active {
  background: rgba(13, 110, 253, 0.08) !important;
  color: #0d6efd !important;
}

/* Убираем стандартный синий фон Bootstrap */
.dropdown-item.active, 
.dropdown-item:active {
  background-color: #e9ecef !important;
  color: #0d6efd !important;
}

/* Еще более светлый вариант */
.dropdown-item.active {
  background-color: #f0f7ff !important;
  color: #0d6efd !important;
}

/* Полностью без фона, только текст */
.dropdown-item.active {
  background-color: transparent !important;
  color: #0d6efd !important;
  font-weight: 600;
}

/* Добавляем едва заметную полоску слева вместо фона */
.dropdown-item.active {
  background-color: transparent !important;
  color: #0d6efd !important;
  font-weight: 600;
  position: relative;
}

.dropdown-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #0d6efd;
}