:root {
  --scrollbar-width: 0px;
}

.filter-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

html.modal-open {
  overflow: hidden;
}

html.modal-open body {
  padding-right: var(--scrollbar-width);
}

body.modal-open {
  overflow: hidden;
}

.filter-modal-container {
  background-color: var(--h-color-neutral-light);
  border-radius: var(--h-border-radius-lg);
  box-shadow: var(--h-shadow-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--h-space-4);
  border-bottom: 1px solid var(--h-color-accent-dark);

  .filter-modal-header-h2 {
    margin: 0;
    line-height: 1;
    font-size: var(--h-text-xl);
    font-weight: var(--h-wt-bold);
  }
}

.filter-modal-close-button {
  border: 0 solid transparent;
  background-color: var(--h-color-accent);
  height: var(--h-space-6);
  width: var(--h-space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--h-border-radius-round);
  color: var(--h-color-accent-light);
  font-size: var(--h-text-lg);
  font-weight: var(--h-wt-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.3s ease;

  &:hover {
    background-color: var(--h-color-accent-dark);
  }
}

.filter-modal-content {
  padding: var(--h-space-4);
  overflow-y: auto;
  flex: 1;
}

.filter-modal-footer {
  display: flex;
  justify-content: space-between;
  padding: var(--h-space-4);
  border-top: 1px solid var(--h-color-accent-dark);
  font-size: var(--h-text-sm);
}

.filter-modal-footer-clear-button {
  background-color: transparent;
  border: 1px solid var(--h-color-accent);
  border-radius: var(--h-border-radius-md);
  padding: var(--h-space-2) var(--h-space-5);
  cursor: pointer;
}

.filter-modal-footer-apply-button {
  background-color: var(--h-color-accent);
  color: var(--h-color-accent-light);
  border: none;
  border-radius: var(--h-border-radius-md);
  padding: var(--h-space-2) var(--h-space-5);
  cursor: pointer;
}

.filter-modal-category-section {
  margin-bottom: var(--h-space-6);

  .filter-modal-category-title {
    font-size: var(--h-text-lg);
    font-weight: var(--h-wt-semibold);
    margin-bottom: var(--h-space-3);
  }
}

.filter-modal-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--h-space-2);
}

.filter-modal-tag-button {
  border: 1px solid var(--h-color-accent);
  border-radius: var(--h-border-radius-full);
  padding: var(--h-space-1) var(--h-space-3);
  background-color: transparent;
  color: var(--h-color-dark);
  cursor: pointer;
  font-size: var(--h-text-sm);
  transition: all 0.2s ease;

  &.selected {
    background-color: var(--h-color-accent);
    color: var(--h-color-accent-light);
  }

  &:hover {
    background-color: var(--h-color-accent);
    color: var(--h-color-accent-light);
  }

  @media (max-width: 768px) {
    padding: var(--h-space-2) var(--h-space-4);
  }
}
