:root {
  --aisha-primary-color: #2685db;
  --aisha-secondary-color: #f6bc01;
  --aisha-text-color: #333;
  --aisha-text-light: #666;
  --aisha-border-color: #e1e1e1;
  --aisha-bg-light: #f9f9f9;
  --aisha-white: #FDFBF6;
  --aisha-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --aisha-shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --aisha-border-radius: 6px;
  --aisha-transition: all 0.3s ease;
  --aisha-font-size-sm: 0.875rem;
  --aisha-font-size-base: 1rem;
  --aisha-font-size-lg: 1.125rem;
  --aisha-spacing-xs: 0.25rem;
  --aisha-spacing-sm: 0.5rem;
  --aisha-spacing-md: 1rem;
  --aisha-spacing-lg: 1.5rem;
  --aisha-spacing-xl: 2rem;
}

.aisha-product-filters {
  font-family: "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--aisha-font-size-base);
  line-height: 1.5;
  color: var(--aisha-text-color);
}
.aisha-product-filters *,
.aisha-product-filters *::before,
.aisha-product-filters *::after {
  box-sizing: border-box;
}
.aisha-product-filters.loading {
  opacity: 0.6;
  pointer-events: none;
}

.aisha-filters-toggle {
  color: #F16463;
  display: none;
  align-items: center;
  gap: var(--aisha-spacing-sm);
  padding: var(--aisha-spacing-sm) var(--aisha-spacing-md);
  background: var(--aisha-white);
  border: 1px solid var(--aisha-border-color);
  border-radius: var(--aisha-border-radius);
  cursor: pointer;
  transition: var(--aisha-transition);
  font-size: var(--aisha-font-size-base);
  font-weight: 500;
}
.aisha-filters-toggle:hover {
  background: #F16463;
  border-color: var(--aisha-primary-color);
}
.aisha-filters-toggle .aisha-filters-icon {
  width: 16px;
  height: 16px;
  position: relative;
}
.aisha-filters-toggle .aisha-filters-icon::before, .aisha-filters-toggle .aisha-filters-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: var(--aisha-transition);
}
.aisha-filters-toggle .aisha-filters-icon::before {
  top: 4px;
}
.aisha-filters-toggle .aisha-filters-icon::after {
  top: 10px;
}

.aisha-filters-container {
  background: var(--aisha-white);
  border-radius: var(--aisha-border-radius);
  box-shadow: var(--aisha-shadow-light);
  overflow: hidden;
}

.aisha-filters-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: var(--aisha-spacing-md);
  background: var(--aisha-bg-light);
  border-bottom: 1px solid var(--aisha-border-color);
}
.aisha-filters-header h3 {
  margin: 0;
  font-size: var(--aisha-font-size-lg);
  font-weight: 600;
}
.aisha-filters-header .aisha-filters-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--aisha-spacing-xs);
  line-height: 1;
  color: var(--aisha-text-light);
}
.aisha-filters-header .aisha-filters-close:hover {
  color: var(--aisha-text-color);
}

.aisha-active-filters {
  padding: var(--aisha-spacing-md);
  background: var(--aisha-bg-light);
  border-bottom: 1px solid var(--aisha-border-color);
}
.aisha-active-filters .aisha-active-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--aisha-spacing-sm);
}
.aisha-active-filters .aisha-active-filters-header span {
  font-weight: 500;
  color: var(--aisha-text-color);
}
.aisha-active-filters .aisha-active-filters-header .aisha-clear-all-filters {
  background: none;
  border: none;
  color: var(--aisha-primary-color);
  cursor: pointer;
  font-size: var(--aisha-font-size-sm);
  text-decoration: underline;
}
.aisha-active-filters .aisha-active-filters-header .aisha-clear-all-filters:hover {
  color: #1e6ba8;
}
.aisha-active-filters .aisha-active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aisha-spacing-xs);
}
.aisha-active-filters .aisha-active-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--aisha-spacing-xs);
  padding: var(--aisha-spacing-xs) var(--aisha-spacing-sm);
  background: #F16463;
  color: var(--aisha-white);
  font-size: var(--aisha-font-size-sm);
  border-radius: calc(var(--aisha-border-radius) / 2);
  white-space: nowrap;
}
.aisha-active-filters .aisha-active-filter .aisha-remove-filter {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  margin-left: var(--aisha-spacing-xs);
  line-height: 1;
  font-size: 1.1em;
  opacity: 0.8;
}
.aisha-active-filters .aisha-active-filter .aisha-remove-filter:hover {
  opacity: 1;
}

.aisha-filters-form {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.aisha-filter-section[data-filter-type=collections] {
  order: 1;
}

.aisha-filter-section[data-filter-type=types] {
  order: 2;
}

.aisha-filter-section[data-filter-type=metals] {
  order: 3;
}

.aisha-filter-section[data-filter-type=colors] {
  order: 4;
}

.aisha-filter-section[data-filter-type=price] {
  order: 5;
}

.aisha-filters-footer {
  order: 999;
}

.aisha-filter-section {
  border-bottom: 1px solid var(--aisha-border-color);
}
.aisha-filter-section:last-child {
  border-bottom: none;
}
.aisha-filter-section.active .aisha-filter-toggle::after {
  transform: rotate(180deg);
}

.aisha-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--aisha-spacing-md);
  cursor: pointer;
  transition: var(--aisha-transition);
  user-select: none;
}
.aisha-filter-header:hover {
  background: var(--aisha-bg-light);
}
.aisha-filter-header .aisha-filter-title {
  margin: 0;
  font-size: var(--aisha-font-size-base);
  font-weight: 600;
  color: var(--aisha-text-color);
}
.aisha-filter-header .aisha-filter-toggle {
  width: 16px;
  height: 16px;
  position: relative;
}
.aisha-filter-header .aisha-filter-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--aisha-text-light);
  transition: var(--aisha-transition);
}

.aisha-filter-content {
  display: none;
  padding: 0 var(--aisha-spacing-md) var(--aisha-spacing-md);
}

.aisha-filter-option {
  display: flex;
  align-items: center;
  gap: var(--aisha-spacing-sm);
  padding: var(--aisha-spacing-xs) 0;
  cursor: pointer;
  transition: var(--aisha-transition);
}
.aisha-filter-option:hover {
  color: var(--aisha-primary-color);
}
.aisha-filter-option:hover .aisha-color-swatch,
.aisha-filter-option:hover .aisha-metal-swatch {
  transform: scale(1.1);
}
.aisha-filter-option input[type=checkbox] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--aisha-border-color);
  border-radius: 3px;
  background: var(--aisha-white);
  cursor: pointer;
  transition: var(--aisha-transition);
  position: relative;
}
.aisha-filter-option input[type=checkbox]:checked {
  background: var(--aisha-primary-color);
  border-color: var(--aisha-primary-color);
}
.aisha-filter-option input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: 2px solid var(--aisha-white);
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}
.aisha-filter-option input[type=checkbox]:hover {
  border-color: var(--aisha-primary-color);
}
.aisha-filter-option .aisha-filter-label {
  flex: 1;
  font-size: var(--aisha-font-size-base);
  line-height: 1.4;
}
.aisha-filter-option .aisha-filter-count {
  font-size: var(--aisha-font-size-sm);
  color: var(--aisha-text-light);
  margin-left: auto;
}

.aisha-color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--aisha-white);
  box-shadow: 0 0 0 1px var(--aisha-border-color);
  transition: var(--aisha-transition);
  flex-shrink: 0;
}
.aisha-color-swatch:hover {
  transform: scale(1.1);
}

.aisha-metal-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--aisha-white);
  box-shadow: 0 0 0 1px var(--aisha-border-color);
  transition: var(--aisha-transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--aisha-white);
}
.aisha-metal-swatch:hover {
  transform: scale(1.1);
}
.aisha-metal-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.aisha-stones-grouped .aisha-stone-color-group {
  margin-bottom: var(--aisha-spacing-md);
}
.aisha-stones-grouped .aisha-stone-color-group:last-child {
  margin-bottom: 0;
}
.aisha-stones-grouped .aisha-stone-color-header {
  display: flex;
  align-items: center;
  gap: var(--aisha-spacing-sm);
  margin-bottom: var(--aisha-spacing-sm);
  padding: var(--aisha-spacing-xs);
  background: var(--aisha-bg-light);
  border-radius: var(--aisha-border-radius);
}
.aisha-stones-grouped .aisha-stone-color-header .aisha-stone-color-name {
  font-weight: 500;
  color: var(--aisha-text-color);
}
.aisha-stones-grouped .aisha-stone-color-options {
  padding-left: var(--aisha-spacing-lg);
}
.aisha-stones-grouped .aisha-stone-color-options .aisha-stone-option {
  margin-bottom: var(--aisha-spacing-xs);
}

.aisha-collections-nested .aisha-parent-categories {
  padding: 0;
}
.aisha-collections-nested .aisha-parent-category {
  border: 1px solid var(--aisha-border-color);
  border-radius: var(--aisha-border-radius);
  margin-bottom: var(--aisha-spacing-sm);
  overflow: hidden;
}
.aisha-collections-nested .aisha-parent-category:last-child {
  margin-bottom: 0;
}
.aisha-collections-nested .aisha-parent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--aisha-spacing-sm) var(--aisha-spacing-md);
  background: var(--aisha-bg-light);
  cursor: pointer;
  transition: var(--aisha-transition);
  user-select: none;
}
.aisha-collections-nested .aisha-parent-header:hover {
  background: #f0f0f0;
}
.aisha-collections-nested .aisha-parent-header.active {
  background: var(--aisha-white);
  border-bottom: 1px solid var(--aisha-border-color);
}
.aisha-collections-nested .aisha-parent-header.active .aisha-parent-toggle::after {
  transform: rotate(180deg);
}
.aisha-collections-nested .aisha-parent-header .aisha-parent-title {
  margin: 0;
  font-size: var(--aisha-font-size-base);
  font-weight: 500;
  color: var(--aisha-text-color);
}
.aisha-collections-nested .aisha-parent-header .aisha-parent-toggle {
  width: 14px;
  height: 14px;
  position: relative;
  flex-shrink: 0;
}
.aisha-collections-nested .aisha-parent-header .aisha-parent-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--aisha-text-light);
  transition: var(--aisha-transition);
}
.aisha-collections-nested .aisha-child-categories {
  display: none;
  padding: var(--aisha-spacing-sm) var(--aisha-spacing-md);
  background: var(--aisha-white);
}
.aisha-collections-nested .aisha-collection-option {
  padding: var(--aisha-spacing-xs) 0;
  margin-bottom: 0;
}
.aisha-collections-nested .aisha-collection-option:last-child {
  padding-bottom: 0;
}

.aisha-price-range-slider {
  padding: var(--aisha-spacing-md) 0;
}
.aisha-price-range-slider .aisha-price-current-range {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--aisha-spacing-sm);
  margin-bottom: var(--aisha-spacing-lg);
  font-size: var(--aisha-font-size-lg);
  font-weight: 600;
  color: var(--aisha-text-color);
}
.aisha-price-range-slider .aisha-price-current-range .aisha-price-separator {
  color: var(--aisha-text-light);
}
.aisha-price-range-slider .aisha-slider-container {
  position: relative;
  margin: var(--aisha-spacing-lg) 0;
}
.aisha-price-range-slider .aisha-slider-track {
  position: relative;
  height: 8px;
  background: var(--aisha-border-color);
  border-radius: 4px;
  margin: 0 10px;
}
.aisha-price-range-slider .aisha-slider-range {
  position: absolute;
  height: 100%;
  background: #F16463;
  border-radius: 4px;
  top: 0;
}
.aisha-price-range-slider .aisha-slider-input {
  position: absolute;
  width: 100%;
  height: 8px;
  background: transparent;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  top: 0;
  margin: 0;
  left: 0;
}
.aisha-price-range-slider .aisha-slider-input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--aisha-white);
  border: 2px solid #F16463;
  box-shadow: var(--aisha-shadow-light);
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 1;
  transition: var(--aisha-transition);
}
.aisha-price-range-slider .aisha-slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--aisha-shadow);
}
.aisha-price-range-slider .aisha-slider-input::-webkit-slider-thumb:active {
  transform: scale(1.05);
}
.aisha-price-range-slider .aisha-slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--aisha-white);
  border: 2px solid #F16463;
  box-shadow: var(--aisha-shadow-light);
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 1;
  transition: var(--aisha-transition);
}
.aisha-price-range-slider .aisha-slider-input::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--aisha-shadow);
}
.aisha-price-range-slider .aisha-slider-input::-moz-range-thumb:active {
  transform: scale(1.05);
}
.aisha-price-range-slider .aisha-slider-input.aisha-slider-min {
  z-index: 2;
}
.aisha-price-range-slider .aisha-slider-input.aisha-slider-max {
  z-index: 1;
}
.aisha-price-range-slider .aisha-price-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--aisha-spacing-sm);
  font-size: var(--aisha-font-size-sm);
  color: var(--aisha-text-light);
}
.aisha-price-range-slider input[type=hidden] {
  display: none;
}

.aisha-filters-footer {
  padding: var(--aisha-spacing-md);
  border-top: 1px solid var(--aisha-border-color);
  background: var(--aisha-bg-light);
  position: sticky;
  bottom: 0;
  z-index: 10;
}
@media (max-width: 768px) {
  .aisha-filters-footer {
    padding-bottom: calc(var(--aisha-spacing-md) + env(safe-area-inset-bottom) + 2rem);
  }
}

.aisha-apply-filters {
  width: 100%;
  padding: var(--aisha-spacing-sm) var(--aisha-spacing-lg);
  background: #F16463;
  color: var(--aisha-white);
  border: none;
  border-radius: var(--aisha-border-radius);
  font-size: var(--aisha-font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: var(--aisha-transition);
  font-family: inherit;
}
.aisha-apply-filters:hover {
  background: #d94f4e;
  transform: translateY(-1px);
  box-shadow: var(--aisha-shadow);
}
.aisha-apply-filters:active {
  transform: translateY(0);
}
.aisha-apply-filters:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.aisha-apply-filters.loading {
  opacity: 0.6;
  cursor: wait;
  position: relative;
}
.aisha-apply-filters.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  right: var(--aisha-spacing-md);
  margin-top: -8px;
  border: 2px solid var(--aisha-white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: aisha-spin 0.8s linear infinite;
}

.aisha-filter-option.updating {
  opacity: 0.5;
  pointer-events: none;
}

.aisha-loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--aisha-white);
  padding: var(--aisha-spacing-lg);
  border-radius: var(--aisha-border-radius);
  box-shadow: var(--aisha-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--aisha-spacing-sm);
  z-index: 10000;
}
.aisha-loading-indicator .aisha-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--aisha-border-color);
  border-top-color: var(--aisha-primary-color);
  border-radius: 50%;
  animation: aisha-spin 1s linear infinite;
}
.aisha-loading-indicator span {
  font-size: var(--aisha-font-size-sm);
  color: var(--aisha-text-light);
}

@keyframes aisha-spin {
  to {
    transform: rotate(360deg);
  }
}
.aisha-product-filters[data-mobile-behavior=drawer] .aisha-filters-toggle {
  display: flex;
}
.aisha-product-filters[data-mobile-behavior=drawer] .aisha-filters-container {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 450px;
  height: 100vh;
  height: calc(100vh - env(safe-area-inset-bottom));
  background: var(--aisha-white);
  box-shadow: var(--aisha-shadow);
  transition: left 0.3s ease;
  z-index: 9999;
  overflow-y: auto;
  padding-bottom: calc(6rem + env(safe-area-inset-bottom));
}
@media (min-width: 769px) {
  .aisha-product-filters[data-mobile-behavior=drawer] .aisha-filters-container {
    width: 400px;
    max-width: 400px;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }
}
.aisha-product-filters[data-mobile-behavior=drawer].drawer-open .aisha-filters-container {
  left: 0;
}
.aisha-product-filters[data-mobile-behavior=drawer] .aisha-filters-header {
  display: flex;
}

.aisha-filters-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: var(--aisha-transition);
}
.aisha-filters-overlay.active {
  opacity: 1;
  visibility: visible;
}

.aisha-filters-no-scroll {
  overflow: hidden;
}

@media (max-width: 768px) {
  .aisha-product-filters:not([data-mobile-behavior=drawer]) {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom));
  }
  .aisha-product-filters:not([data-mobile-behavior=drawer]) .aisha-filter-section {
    border-radius: 0;
    margin-bottom: var(--aisha-spacing-sm);
    box-shadow: var(--aisha-shadow-light);
  }
  .aisha-product-filters:not([data-mobile-behavior=drawer]) .aisha-filter-section:last-child {
    margin-bottom: var(--aisha-spacing-xl);
  }
  .aisha-product-filters:not([data-mobile-behavior=drawer]) .aisha-filter-header {
    padding: var(--aisha-spacing-sm) var(--aisha-spacing-md);
  }
  .aisha-product-filters:not([data-mobile-behavior=drawer]) .aisha-filter-content {
    padding: 0 var(--aisha-spacing-md) var(--aisha-spacing-sm);
  }
  .aisha-product-filters:not([data-mobile-behavior=drawer]) .aisha-filter-option {
    padding: var(--aisha-spacing-sm) 0;
    margin-bottom: 0;
  }
  .aisha-product-filters:not([data-mobile-behavior=drawer]) .aisha-active-filters {
    padding: var(--aisha-spacing-sm) var(--aisha-spacing-md);
  }
}
body.rtl .aisha-product-filters {
  font-family: "Cairo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[dir=rtl] .aisha-product-filters .aisha-filter-header .aisha-filter-toggle::after {
  transform: translate(-50%, -50%) rotate(0deg) scaleX(-1);
}
[dir=rtl] .aisha-product-filters .aisha-filter-section.active .aisha-filter-toggle::after {
  transform: translate(-50%, -50%) rotate(180deg) scaleX(-1);
}
[dir=rtl] .aisha-product-filters .aisha-filters-container {
  left: -100%;
  right: auto;
}
[dir=rtl] .aisha-product-filters.drawer-open .aisha-filters-container {
  left: 0;
  right: auto;
}
[dir=rtl] .aisha-product-filters .aisha-filter-option input[type=checkbox]:checked::after {
  left: 4px;
  right: auto;
}
[dir=rtl] .aisha-product-filters .aisha-active-filter .aisha-remove-filter {
  margin-left: 0;
  margin-right: var(--aisha-spacing-xs);
}
[dir=rtl] .aisha-product-filters .aisha-stone-color-options {
  padding-left: 0;
  padding-right: var(--aisha-spacing-lg);
}
[dir=rtl] .aisha-product-filters .aisha-price-range-slider .aisha-slider-track {
  transform: scaleX(-1);
}
[dir=rtl] .aisha-product-filters .aisha-price-range-slider .aisha-slider-input {
  transform: scaleX(-1);
}
[dir=rtl] .aisha-product-filters .aisha-price-range-slider .aisha-price-range-labels {
  flex-direction: row-reverse;
}
[dir=rtl] .aisha-product-filters .aisha-apply-filters.loading::after {
  right: auto;
  left: var(--aisha-spacing-md);
}
[dir=rtl] .aisha-product-filters[data-mobile-behavior=drawer] .aisha-filters-container {
  left: auto;
  right: -100%;
  transition: right 0.3s ease;
}
[dir=rtl] .aisha-product-filters[data-mobile-behavior=drawer].drawer-open .aisha-filters-container {
  left: auto;
  right: 0;
}

@media (prefers-reduced-motion: reduce) {
  .aisha-product-filters * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (prefers-contrast: high) {
  .aisha-product-filters {
    --aisha-border-color: #000;
    --aisha-text-light: #000;
  }
  .aisha-product-filters .aisha-filter-option input[type=checkbox] {
    border-width: 2px;
  }
  .aisha-product-filters .aisha-color-swatch {
    box-shadow: 0 0 0 2px #000;
  }
}
