/* Filters Modal Styles */

.sidebar-wrapper h6 {
  font-size: var(--font-size-13);
}

.filters-used {
  display: flex;
  flex-wrap: wrap;
  padding: 0 0 17px 0;
  gap: 13px;
}

.filters-used:empty {
  padding: 0;
}

.filters-used div {
  border-radius: 6px;
  display: flex;
  background: #e6e6e6;
  padding: 3px 7px;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  width: 95%;
  transform-origin: left center;
}

.filters-used div.filters-used-clear {
  box-shadow: 0 0 1px 0 #999 inset;
  background: transparent;
}

.filters-used div:hover {
  background: #f0f0f0;
}

.filters-modal .filters-used div {
  width: unset;
}

.filters-used div span {
  display: inline-block;
  font-size: 1.5rem;
  line-height: 0.4;
  height: 10px;
  margin-left: auto;
  text-transform: uppercase;
}

.filters-used div.is-entering {
  animation: filtersUsedEnter 180ms ease-out;
}

.filters-used div.is-exiting {
  animation: filtersUsedExit 160ms ease-in forwards;
}

body:has(.filters-modal) .announcement-bar,
body:has(.filters-modal) site-header,
body:has(.filters-modal) main,
body:has(.filters-modal) footer {
  filter: blur(4px);
}

body:has(.filters-modal) {
  overflow: hidden;
}

.filters {
  font-family: "Calibre";
  letter-spacing: 0.8px;
  margin-top: 17px;
}

.filters .filter-by-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  margin: 0 0 17px 0;
  cursor: pointer;
  --icon-size: 15px;
  padding-right: 17px;
  text-transform: uppercase;
}

.filters .filter-by-toggle.active {
  margin: 0 0 8px 0;
}

.filters .filter-by-toggle .icon-close {
  transform: rotate(-45deg);
  transition: transform 180ms ease;
}

.filters .filter-by-toggle.active .icon-close {
  transform: rotate(0deg);
}

.filters ul {
  display: none;
  list-style: none;
  margin: 0 0 17px 0;
  padding: 0 0 0 0;
  user-select: none;
}

.filters li {
  margin: 0 0 7px 0;
  letter-spacing: 0.8px;
  padding: 2px 4px;
  max-width: 95%;
}

.filters li label {
  position: relative;
  display: inline-block;
  cursor: pointer;
  padding-right: 25px;
  text-wrap: balance;
}

.filters li aq {
  color: #555;
  margin-left: 6px;
}

.filters li input {
  display: none;
}

.filters li:is(:has(input:checked), .is-loading) label:after {
  content: "";
  position: absolute;
  right: -0px; /* Adjust distance from right edge */
  top: 50%;
  transform: translateY(-48%);

  width: 15px; /* Size of the icon */
  height: 15px;

  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 576'%3E%3Cpath d='M215.5 352.1L488 102.3L521.9 136.3L233.9 448.3L215.6 468.1L198 447.6L54 279.6L87.6 245.5L215.5 352.1z' fill='%23333'/%3E%3C/svg%3E")
    no-repeat center / contain;
}

.filters li.is-loading label:after {
  animation: filtersLoadingFade 700ms ease-in-out infinite;
}

.filters-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999999;
  animation: fadeIn 0.3s ease-in-out;
}

.filters-modal-content {
  animation: slideInFromRight 0.3s ease-in-out forwards;
  background-color: var(--nav-bg-color);
}

.filters-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.filters-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: color 0.2s ease;
}

.filters-modal-close:hover {
  color: #000;
}

.filters-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.filters-modal .filters ul {
  display: block;
}

.filters-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 21px;

  padding-left: var(--wp--style--root--padding-left);
  padding-right: var(--wp--style--root--padding-left);
  padding-top: 0;

  background-color: var(--nav-bg-color);

  border-top: 1px solid #e0e0e0;
  margin-bottom: 0;
  padding-bottom: 17px;
}

.filters-modal-footer button {
  display: block;
  justify-content: center;
  align-items: center;

  background-color: #000;
  color: #fff;

  border: 0;
  border-radius: 6px;

  width: 100%;

  padding: 13px 40px;
  text-align: center;

  margin-top: 17px;

  font-size: var(--font-size-17);
  line-height: 29px;
}

/* Animations */
@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes filtersUsedEnter {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes filtersUsedExit {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes filtersLoadingFade {
  0% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.25;
  }
}

@media only screen and (min-width: 320px) and (max-width: 1024px) {
  .filters {
    margin-top: 0;
    margin-bottom: 0;
  }

  .filters-used div {
    width: unset;
  }

  .filters .filter-by-toggle {
    padding-right: 0;
  }
}
