/**
 * ASR Shop Filters — mobile drawer, "Filters" button, loading overlay.
 * 999.98px = Blocksy's tablet/desktop edge. Keep in sync with ASRF_BP.
 */

/* "Filters" button (colors come from Blocksy's .ct-button) */
.asrf-open {
  display: none !important;
  align-items: center;
  gap: 8px;
  margin-block-end: 12px;
}
.asrf-open svg {
  flex: 0 0 auto;
}
.asrf-open__n {
  padding: 0 7px;
  border-radius: 10px;
  background: var(--theme-button-text-initial-color, #fff);
  color: var(--theme-button-background-initial-color, #111);
  font-size: 12px;
  font-style: normal;
  line-height: 1.6;
}

/* Backdrop and loading screen */
.asrf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
}
.asrf-backdrop.is-open {
  opacity: 1;
}
.asrf-backdrop.is-loading {
  background: rgba(255, 255, 255, 0.7);
  cursor: progress;
}
.asrf-backdrop__spin {
  display: none;
  inline-size: 38px;
  block-size: 38px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-block-start-color: var(--asrf-accent);
  border-radius: 50%;
}
/* Fades in after 150ms so fast page loads don't flicker. */
.asrf-backdrop.is-loading .asrf-backdrop__spin {
  display: block;
  opacity: 0;
  animation:
    asrf-spin 0.8s linear infinite,
    asrf-fade 0.2s 0.15s forwards;
}
.asrf-sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@keyframes asrf-spin {
  to {
    rotate: 360deg;
  }
}
@keyframes asrf-fade {
  to {
    opacity: 1;
  }
}

@media (max-width: 999.98px) {
  .asrf-open {
    display: inline-flex !important;
  }
  .asrf-open[hidden] {
    display: none !important;
  }

  /* Moved to <body> by filters.js; inset-inline-start already means "right" in RTL. */
  .asrf {
    position: fixed;
    z-index: 99999;
    inset-block: 0;
    inset-inline-start: 0;
    inline-size: min(88vw, 360px);
    margin: 0;
    padding: 16px;
    background: var(--asrf-bg);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    translate: -14px 0;
    transition:
      opacity 0.2s ease,
      translate 0.25s ease,
      visibility 0.25s;
  }
  [dir="rtl"] .asrf {
    translate: 14px 0;
  }
  .asrf.is-open {
    visibility: visible;
    opacity: 1;
    translate: none;
  }
  .asrf .asrf__close {
    display: block;
  }
  .asrf button.asrf__go {
    display: none;
  } /* Apply covers it on mobile */
  .asrf__actions {
    position: sticky;
    inset-block-end: 0;
    padding-block-start: 10px;
    background: var(--asrf-bg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .asrf,
  .asrf-backdrop {
    transition: none;
  }
  .asrf {
    translate: none;
  }
  .asrf-backdrop.is-loading .asrf-backdrop__spin {
    animation: asrf-fade 0.2s 0.15s forwards;
  }
}
