/**
 * @file
 * CSS styles for facet performance optimizations.
 */

/* Collapsible facet styles */
.facet-collapsible-title {
  cursor: pointer;
  position: relative;
  padding-right: 20px;
}

.facet-collapsible-title::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #666;
  transition: transform 0.2s ease;
}

.facet-collapsed .facet-collapsible-title::after {
  transform: translateY(-50%) rotate(-90deg);
}

/* Show more button styles */
.facet-show-more-button {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 5px;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  text-align: center;
  cursor: pointer;
  font-size: 0.85em;
  transition: background-color 0.2s;
}

.facet-show-more-button:hover {
  background-color: #e9e9e9;
}

/* Apply filters button styles */
.facet-apply-button {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background-color: #0074bd;
  color: white;
  border: none;
  text-align: center;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.facet-apply-button:hover {
  background-color: #005a8c;
}

/* Loading indicator styles */
.facet-loading {
  width: 30px;
  height: 30px;
  margin: 10px auto;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #0074bd;
  animation: facet-spin 1s ease-in-out infinite;
}

@keyframes facet-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Placeholder styles */
.facet-placeholder {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Optimize for mobile devices */
@media screen and (max-width: 600px) {
  .facets-widget {
    margin-bottom: 15px;
  }

  .facet-collapsible-title {
    padding: 8px 0;
  }

  .facet-show-more-button,
  .facet-apply-button {
    padding: 10px;
    font-size: 1em;
  }
}

/* Performance optimizations to reduce repaints */
.facets-widget {
  will-change: contents;
  transform: translateZ(0);
}

.facets-widget-content {
  will-change: height, opacity;
}