/* =============================================================================
   MOBILE FILTER MENU - LEIBAL STYLE
============================================================================= */

/* Filter Button - показывается только на мобильных */
.mobile-filter-btn {
  display: none;
  font-family: 'Maison Neue', sans-serif;
  font-size: 0.625rem; /* 10px */
  font-weight: 100;
  color: #000;
  background: transparent;
  border: 1px solid #ddd;
  text-transform: uppercase;
  letter-spacing: 0.09375rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  width: 100%;
  position: relative;
}

.mobile-filter-btn:hover {
  background: #484634;
  color: white;
  border-color: #484634;
}

.mobile-filter-btn::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.25s ease-in-out;
}

.mobile-filter-btn.active::after {
  transform: translateY(-50%) rotate(180deg);
}

/* Mobile Filter Overlay */
.mobile-filter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
}

.mobile-filter-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Filter Menu */
.mobile-filter-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100%;
  background: white;
  z-index: 999;
  transition: left 0.3s ease-in-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-filter-menu.active {
  left: 0;
}

/* Mobile Filter Header */
.mobile-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1000;
}

.mobile-filter-title {
  font-family: 'Maison Neue', sans-serif;
  font-size: 0.625rem; /* 10px */
  font-weight: 100;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.09375rem;
  line-height: 1.7;
  margin: 0;
}

.mobile-filter-close {
  font-family: 'Maison Neue', sans-serif;
  font-size: 1.25rem;
  font-weight: 100;
  background: none;
  border: none;
  cursor: pointer;
  color: #000;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease-in-out;
}

.mobile-filter-close:hover {
  opacity: 0.6;
}

/* Mobile Filter Content */
.mobile-filter-content {
  padding: 1.25rem;
}

/* Mobile Filter Sections */
.mobile-filter-section {
  margin-bottom: 2rem;
}

.mobile-filter-section:last-child {
  margin-bottom: 1rem;
}

.mobile-filter-section-title {
  font-family: 'Maison Neue', sans-serif;
  font-size: 0.625rem; /* 10px */
  font-weight: 100;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.09375rem;
  margin-bottom: 1rem;
  line-height: 1.7;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.mobile-filter-section-title::after {
  content: '−';
  font-size: 1rem;
  transition: transform 0.25s ease-in-out;
}

.mobile-filter-section.collapsed .mobile-filter-section-title::after {
  content: '+';
  transform: none;
}

.mobile-filter-section-content {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.mobile-filter-section.collapsed .mobile-filter-section-content {
  max-height: 0;
}

/* Mobile Filter Lists */
.mobile-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-filter-list li {
  margin-bottom: 0.5rem;
}

.mobile-filter-list a,
.mobile-filter-list label {
  font-family: 'Maison Neue', sans-serif;
  font-size: 0.625rem; /* 10px */
  font-weight: 100;
  color: #888;
  text-decoration: none;
  letter-spacing: 0.09375rem;
  line-height: 1.7;
  transition: color 0.25s ease-in-out;
  display: block;
  padding: 0.25rem 0;
  cursor: pointer;
}

.mobile-filter-list a:hover,
.mobile-filter-list a.active,
.mobile-filter-list label:hover {
  color: #000;
}

/* Mobile Filter Checkboxes */
.mobile-filter-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.mobile-filter-checkbox input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: #484634;
}

.mobile-filter-checkbox label {
  margin: 0;
  padding: 0;
}

/* Mobile Sort Dropdown */
.mobile-sort-dropdown {
  margin-bottom: 1.5rem;
}

.mobile-sort-select {
  font-family: 'Maison Neue', sans-serif;
  font-size: 0.625rem; /* 10px */
  font-weight: 100;
  color: #000;
  letter-spacing: 0.09375rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  background: white;
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23999' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 3rem;
  line-height: 1.7;
}

.mobile-sort-select:focus,
.mobile-sort-select:hover {
  border-color: #484634;
}

/* Mobile Price Filter */
.mobile-price-filter {
  margin-top: 1rem;
}

.mobile-price-inputs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.mobile-price-input {
  font-family: 'Maison Neue', sans-serif;
  font-size: 0.625rem; /* 10px */
  font-weight: 100;
  color: #000;
  letter-spacing: 0.09375rem;
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-bottom: 1px solid #ddd;
  background: transparent;
  outline: none;
  text-align: center;
  line-height: 1.7;
}

.mobile-price-input::placeholder {
  color: #888;
  font-weight: 100;
}

.mobile-price-input:focus,
.mobile-price-input:hover {
  border-bottom-color: #484634;
}

/* Mobile Filter Actions */
.mobile-filter-actions {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 1.25rem;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 0.75rem;
}

.mobile-filter-apply,
.mobile-filter-clear {
  font-family: 'Maison Neue', sans-serif;
  font-size: 0.625rem; /* 10px */
  font-weight: 100;
  text-transform: uppercase;
  letter-spacing: 0.09375rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  line-height: 1.7;
  flex: 1;
}

.mobile-filter-apply {
  background: #484634;
  color: white;
  border-color: #484634;
}

.mobile-filter-apply:hover {
  opacity: 0.8;
}

.mobile-filter-clear {
  background: transparent;
  color: #000;
}

.mobile-filter-clear:hover {
  background: #f5f5f5;
}

/* =============================================================================
   RESPONSIVE BEHAVIOR
============================================================================= */

/* Показываем кнопку и скрываем обычный sidebar на мобильных */
@media (max-width: 1024px) {
  .mobile-filter-btn {
    display: block;
  }
  
  .sidebar {
    display: none;
  }
  
  .main-content {
    flex-direction: column;
    gap: 0;
  }
  
  .product-section {
    width: 100%;
  }
}

/* Уменьшаем ширину меню на очень маленьких экранах */
@media (max-width: 480px) {
  .mobile-filter-menu {
    width: 260px;
  }
}

/* =============================================================================
   HIDE SCROLLBAR BUT KEEP FUNCTIONALITY
============================================================================= */

.mobile-filter-menu::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

.mobile-filter-menu {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* =============================================================================
   PREVENT BODY SCROLL WHEN MENU IS OPEN
============================================================================= */

body.mobile-filter-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* =============================================================================
   ANIMATION IMPROVEMENTS
============================================================================= */

@media (prefers-reduced-motion: reduce) {
  .mobile-filter-menu,
  .mobile-filter-overlay,
  .mobile-filter-section-content {
    transition: none;
  }
}

/* =============================================================================
   CATEGORY COUNT IN MOBILE
============================================================================= */

.mobile-category-count {
  font-size: 0.625rem; /* 10px */
  font-weight: 100;
  color: #888;
  margin-left: auto;
}

/* =============================================================================
   FOCUS STYLES FOR ACCESSIBILITY
============================================================================= */

.mobile-filter-btn:focus,
.mobile-filter-close:focus,
.mobile-sort-select:focus,
.mobile-price-input:focus,
.mobile-filter-apply:focus,
.mobile-filter-clear:focus {
  outline: 2px solid #484634;
  outline-offset: 2px;
}

.mobile-filter-list a:focus {
  outline: 1px solid #484634;
  outline-offset: 1px;
}