/* mobile-styles.css */
:root {
  --gold: #c5a572;
  --shadow: rgba(0,0,0,0.1);
  --bg: rgba(255,255,255,0.95);
  --lucida: "Lucida Sans", "Lucida Grande", "Lucida Console", sans-serif;
}

/* ===== СКРЫТИЕ НА ДЕСКТОПЕ ===== */
@media (min-width: 769px) {
  .mobile-header,
  .mobile-menu-container,
  .mobile-footer,
  .menu-overlay,
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ (до 768px) ===== */
@media (max-width: 768px) {
  /* 1. ОБЩИЕ СТИЛИ ДЛЯ ТЕЛА */
  body {
    padding-top: 60px;
    padding-bottom: 70px;
    overflow-x: hidden;
  }

  /* Убираем десктопный отступ под topbar — на мобилке он не нужен */
  #page {
    margin-top: 0 !important;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
  }

  /* Симметричные отступы каталога */
  #content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
  }

  /* 2. СКРЫТИЕ ДЕСКТОПНЫХ ЭЛЕМЕНТОВ */
  #sidebar_top,
  #toggleSidebar,
  .search-bar,
  .search-container,
  .user-controls,
  .logo,
  .logo-mini,
  .logo-full,
  #openFilters,
  .desktop-only {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 3. МОБИЛЬНЫЙ ХЕДЕР */
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 8px 14px;
    background: var(--bg);
    box-shadow: 0 2px 8px var(--shadow);
    z-index: 2000;
    font-family: var(--lucida);
    backdrop-filter: blur(8px);
  }

  /* 4. КНОПКА БУРГЕРА */
  .mobile-menu-toggle {
    order: 2;
    width: 40px;
    height: 40px;
    font-size: 28px;
    border: none;
    background: none;
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  /* 5. ПОИСК В ХЕДЕРЕ */
  .mobile-search {
    order: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
  }

  .mobile-search input {
    position: absolute;
    left: 40px;
    width: 0;
    opacity: 0;
    transition: width 0.35s ease, opacity 0.55s ease;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 36px 8px 12px;
    font-size: 16px;
    font-family: var(--lucida);
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  }

  .mobile-search.active input {
    width: calc(100% - 50px);
    max-width: 300px;
    opacity: 1;
  }

  .mobile-search-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--gold);
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
  }

  /* 6. ОВЕРЛЕЙ ДЛЯ ЗАКРЫТИЯ МЕНЮ */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    height: calc(100vh - 56px);
    background: rgba(0, 0, 0, 0.35);
    z-index: 1800;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .menu-overlay.active {
    display: block;
    opacity: 1;
  }

  /* 7. ВЫПАДАЮЩЕЕ МЕНЮ */
  .mobile-menu-container {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 1900;
    font-family: var(--lucida);
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-menu-container.active {
    display: block;
    animation: slideDown 0.3s ease forwards;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* 8. СТИЛИ ДЛЯ СОДЕРЖИМОГО МОБИЛЬНОГО МЕНЮ */
  .mobile-menu {
    padding: 0;
  }

  /* Простые ссылки меню */
  .mobile-menu-link {
    display: block;
    padding: 16px 20px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s ease;
  }

  .mobile-menu-link:hover,
  .mobile-menu-link:active {
    background: var(--gold);
    color: white;
  }

  .mobile-menu-link.active {
    background: rgba(197, 165, 114, 0.1);
    color: var(--gold);
    font-weight: 600;
    border-left: 4px solid var(--gold);
  }

  /* Группы меню (аккордеон) */
  .mobile-menu-group {
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .mobile-menu-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--lucida);
    font-size: 16px;
    color: #333;
    transition: background 0.2s ease;
  }

  .mobile-menu-group-header:hover {
    background: rgba(197, 165, 114, 0.05);
  }

  .mobile-menu-group-header .title {
    flex: 1;
    font-weight: 600;
  }

  .mobile-menu-group-header .arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    color: var(--gold);
  }

  .mobile-menu-group-header .arrow.rotated {
    transform: rotate(90deg);
  }

  /* Вложенные пункты группы */
  .mobile-menu-group-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.02);
  }

  .mobile-menu-group-content.expanded {
    max-height: 500px;
  }

  .mobile-menu-group-item {
    display: block;
    padding: 14px 20px 14px 40px;
    text-decoration: none;
    color: #555;
    font-size: 15px;
    border-top: 1px solid rgba(0,0,0,0.03);
    transition: all 0.2s ease;
    position: relative;
  }

  .mobile-menu-group-item::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background-color: var(--gold);
    border-radius: 50%;
    opacity: 0.5;
  }

  .mobile-menu-group-item:hover,
  .mobile-menu-group-item:active {
    background: rgba(197, 165, 114, 0.08);
    color: #333;
    padding-left: 44px;
  }

  .mobile-menu-group-item.active {
    color: var(--gold);
    font-weight: 500;
    background: rgba(197, 165, 114, 0.1);
  }

  .mobile-menu-group-item.active::before {
    opacity: 1;
    width: 6px;
    height: 6px;
  }

  /* Иконки в меню */
  .mobile-menu-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    vertical-align: middle;
  }

  /* Бейдж для корзины/счетчика */
  .mobile-menu-badge {
    background: #e53e3e;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    min-width: 20px;
    text-align: center;
  }

  /* 9. МОБИЛЬНЫЙ ФУТЕР */
  .mobile-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg);
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 1500;
    font-family: var(--lucida);
    backdrop-filter: blur(8px);
  }

  .mobile-footer-link {
    flex: 1;
    text-align: center;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    font-family: var(--lucida);
    transition: color 0.3s ease;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .mobile-footer-icon {
    font-size: 18px;
    margin-bottom: 4px;
    color: #666;
  }

  .mobile-footer-link.active,
  .mobile-footer-link:hover {
    color: var(--gold);
  }

  .mobile-footer-link.active .mobile-footer-icon,
  .mobile-footer-link:hover .mobile-footer-icon {
    color: var(--gold);
  }

  /* 10. УТИЛИТЫ ДЛЯ СКРЫТИЯ/ПОКАЗА */
  .hide-on-mobile {
    display: none !important;
  }

  .show-on-mobile {
    display: block !important;
  }

  /* 11. АДАПТИВНЫЕ ИСПРАВЛЕНИЯ */
  .mobile-menu-container::-webkit-scrollbar {
    width: 4px;
  }

  .mobile-menu-container::-webkit-scrollbar-track {
    background: transparent;
  }

  .mobile-menu-container::-webkit-scrollbar-thumb {
    background: rgba(197, 165, 114, 0.3);
    border-radius: 2px;
  }
}

/* ===== ДЕСКТОПНЫЕ СТИЛИ ДЛЯ МЕНЮ (только для десктопа) ===== */
@media (min-width: 769px) {
  /* Стили для обычного (десктопного) меню */
  .menu-group-content {
    padding-left: 30px;
    font-size: 14px;
  }
  
  .menu-group-item {
    padding: 10px 16px 10px 48px;
    font-size: 0.85rem;
  }
  
  /* Остальные стили для десктопного меню... */
}