/* Enhanced Category Sidebar - Modern UI/UX */

/* Layout Structure */
.category-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  margin-top: 30px;
}

/* Filter Sidebar - Complete Redesign */
.filter-sidebar {
  background: #ffffff;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
  position: sticky;
  top: 100px;
  height: fit-content;
  overflow: visible;
  transition: all 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.filter-sidebar:hover {
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.12);
  border-color: #e0e7ff;
}

/* Scrollbar styles removed - no scrolling needed */

/* Filter Header */
.filter-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  border-radius: 20px 20px 0 0;
  margin-bottom: 0;
}

.filter-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Active Filter Count Badge */
.filter-count-badge {
  background: #ffffff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.filter-header h3 i {
  font-size: 20px;
  color: #ffffff;
}

.btn-reset-filters {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.btn-reset-filters:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-reset-filters i {
  font-size: 12px;
}

/* Filter Sections Container */
.filter-sections-container {
  padding: 20px;
  overflow: visible;
  max-width: 100%;
  box-sizing: border-box;
}

/* Filter Sections */
.filter-section {
  margin-bottom: 0;
  padding: 20px 0;
  border-bottom: 2px solid #f1f5f9;
  position: relative;
}

.filter-section::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, #2563eb, transparent);
}

.filter-section:first-child {
  padding-top: 0;
}

/* Filter Section Header */
.filter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.filter-section-header .filter-title {
  margin-bottom: 0;
}

/* Clear Section Button */
.btn-clear-section {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-section:hover {
  background: #f1f5f9;
  color: #ef4444;
}

/* Categories List Container */
.categories-list {
  overflow: visible;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}

/* Show More Button */
.btn-show-more {
  width: 100%;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-show-more:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.btn-show-more i {
  transition: transform 0.3s ease;
}

.btn-show-more.expanded i {
  transform: rotate(180deg);
}

.filter-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.filter-section:last-child::after {
  display: none;
}

.filter-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.filter-title i {
  font-size: 16px;
  color: #2563eb;
  width: 20px;
  text-align: center;
}

/* Filter Options */
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-option {
  position: relative;
  width: 100%;
}

.filter-option input[type="radio"],
.filter-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f8fafc;
  border: 2px solid transparent;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.filter-option label:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  transform: translateX(-3px);
}

.filter-option input:checked + label {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #2563eb;
  color: #1e40af;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  animation: filterApplied 0.4s ease;
}

@keyframes filterApplied {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.filter-option label i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #64748b;
  flex-shrink: 0;
}

.filter-option input:checked + label i {
  color: #2563eb;
}

.option-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.option-count {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 8px;
  min-width: 30px;
  text-align: center;
  flex-shrink: 0;
}

.filter-option input:checked + label .option-count {
  background: #ffffff;
  color: #2563eb;
}

/* Price Range Inputs */
.price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.price-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  transition: all 0.3s ease;
  outline: none;
  background: #f8fafc;
  box-sizing: border-box;
}

.price-input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.price-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.price-separator {
  font-weight: 700;
  color: #64748b;
  font-size: 18px;
  flex-shrink: 0;
}

.btn-apply-price {
  width: 100%;
  padding: 10px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.btn-apply-price.needs-apply {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
  }
}

.btn-apply-price.success {
  background: #10b981;
  animation: successFlash 0.6s ease;
}

@keyframes successFlash {
  0%, 100% { background: #2563eb; }
  50% { background: #10b981; }
}

.btn-apply-price:hover {
  background: #1d4ed8;
}

.btn-apply-price:active {
  transform: translateY(0);
}

.btn-apply-price i {
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .category-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    z-index: 1050;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .filter-sidebar.active {
    right: 0;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
  }
}

@media (max-width: 768px) {
  .filter-sidebar {
    width: 100%;
    max-width: 100vw;
  }

  .filter-header {
    padding: 20px;
  }

  .filter-sections-container {
    padding: 16px;
  }
}
