/**
 * @file
 * SLM Mobile Menu Styles
 * Responsive mobile menu functionality
 */

/* ============================================================================
   MOBILE BAR - Полоска с хлебными крошками и кнопкой
   ============================================================================ */

.slm-mobile-bar {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.1);
  padding: 14px 16px;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: sticky;
  top: 10px;
  margin: 10px 0;
  z-index: 1000;
}

/* ============================================================================
   BREADCRUMBS - Хлебные крошки с прокруткой
   ============================================================================ */

.slm-breadcrumbs {
  flex: 1;
  font-size: 14px;
  color: #666;
  margin-right: 10px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  position: relative;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.slm-breadcrumbs::-webkit-scrollbar {
  display: none;
}

/* Gradient fade on the left side */
.slm-breadcrumbs::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.95), transparent);
  pointer-events: none;
  z-index: 1;
}

.slm-breadcrumbs__home-icon {
  width: 16px;
  height: 16px;
  color: #666;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  margin-left: 30px; /* Offset for gradient */
}

.slm-breadcrumbs__home-link {
  display: inline-flex;
  align-items: center;
  color: #666;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.2s;
}

.slm-breadcrumbs__home-link:hover {
  color: #1976d2;
}

.slm-breadcrumbs__separator {
  color: #ccc;
  margin: 0 6px;
  flex-shrink: 0;
}

.slm-breadcrumbs__item {
  white-space: nowrap;
  color: #666;
  flex-shrink: 0;
}

.slm-breadcrumbs__link {
  color: #666;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s;
}

.slm-breadcrumbs__link:hover {
  color: #1976d2;
  text-decoration: underline;
}

.slm-breadcrumbs__current {
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 20px;
  color: #0066cc !important;
  font-weight: 600;
}

/* ============================================================================
   MOBILE TOGGLE BUTTON - Кнопка открытия меню
   ============================================================================ */

.slm-mobile-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.slm-mobile-toggle:hover {
  background: rgba(0,0,0,0.05);
}

.slm-mobile-toggle:active {
  transform: scale(0.95);
}

.slm-mobile-toggle__icon {
  width: 24px;
  height: 24px;
  position: relative;
}

.slm-mobile-toggle__icon svg {
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

/* ============================================================================
   MOBILE MENU CONTAINER - Контейнер полного меню
   ============================================================================ */

.slm-mobile-menu-container {
  display: none;
  margin-top: 10px;
}

.slm-mobile-menu-container.open {
  display: block;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* ============================================================================
   DESKTOP - Скрываем мобильные элементы (≥769px)
   ============================================================================ */

@media (min-width: 769px) {
  .slm-mobile-bar {
    display: none !important;
  }
  
  .slm-mobile-menu-container {
    display: block !important;
    /* Убираем все стили контейнера на десктопе */
    background: none !important;
    border-radius: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
  }
}

/* ============================================================================
   MOBILE - Активируем мобильное меню (≤768px)
   ============================================================================ */

@media (max-width: 768px) {
  /* Show mobile menu bar - ВАЖНО! */
  .slm-mobile-bar {
    display: flex !important;
  }
  
  /* Mobile menu container - закрыто по умолчанию */
  .slm-mobile-menu-container {
    display: none;
    margin-top: 10px;
  }
  
  /* Mobile menu container - открыто */
  .slm-mobile-menu-container.open {
    display: block;
  }
  
  /* Меню внутри открытого контейнера использует стили из slm.css */
  .slm-mobile-menu-container.open .slm-menu {
    display: block !important;
    margin-top: 0;
  }
}

/* ============================================================================
   ACCESSIBILITY - Reduced Motion Support
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .slm-mobile-toggle__icon svg {
    transition: none;
  }
  
  .slm-mobile-menu-container {
    transition: none;
  }
}

