/* Shop Filters CSS
 * Extracted from loop-start.php for better performance
 * @package AjintGroup
 * @since 1.0.0
 */

/* ==========================================================================
   Category Filter Loading State
   ========================================================================== */

#product-results.loading {
  position: relative;
  min-height: 400px;
}

#product-results.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ==========================================================================
   Avatar Slide (Category Icons)
   ========================================================================== */

.avatar-slide {
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s ease;
  position: relative;
}

.avatar-slide:hover {
  opacity: 0.9 !important;
  transform: scale(1.05);
}

.avatar-slide.active {
  opacity: 1 !important;
  transform: scale(1.1);
}

.avatar-slide.active .avatar-category {
  color: #333;
}

/* ==========================================================================
   Filter Modal (Mobile)
   ========================================================================== */

.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.filter-modal.hidden {
  display: none;
}

.filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-modal.open .filter-backdrop {
  opacity: 1;
}

.filter-panel {
  position: relative;
  width: 100%;
  max-height: 85vh;
  background: white;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filter-modal.open .filter-panel {
  transform: translateY(0);
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.filter-panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.filter-panel-header button {
  font-size: 2rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.filter-panel-header button:hover {
  color: #111827;
}

.filter-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Filter Groups & Accordion
   ========================================================================== */

.filter-group {
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  text-align: starts;
  transition: color 0.2s;
}

.filter-heading:hover {
  color: #c26b2b;
}

.filter-arrow {
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.filter-heading.open .filter-arrow {
  transform: rotate(180deg);
}

.filter-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.filter-content.open {
  max-height: 500px; /* Will be overridden by JS */
  padding-top: 0.5rem;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: color 0.2s;
}

.filter-item:hover {
  color: #c26b2b;
}

.filter-item input {
  cursor: pointer;
  width: 1rem;
  height: 1rem;
  accent-color: #c26b2b;
}

.filter-item span {
  font-size: 0.875rem;
}

/* ==========================================================================
   Price Range Slider
   ========================================================================== */

#priceRange {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

#priceRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c26b2b;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#priceRange::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c26b2b;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#rangeValue {
  font-size: 0.875rem;
  font-weight: 600;
  color: #c26b2b;
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

/* ==========================================================================
   Desktop Sidebar
   ========================================================================== */

@media (min-width: 768px) {
  .filter {
    position: sticky;
    top: 2rem;
    align-self: flex-start;
  }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
