/* ==========================================================================
   AQARA KRD — addon: Spotlight-палитра поиска (#layer-search)
   ========================================================================== */

#layer-search {
    --aq-tap-x: 50%;
    --aq-tap-y: 85%;

    position: fixed;
    inset: 0;
    opacity: 0;
    background-color: var(--aq-search-scrim);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    transition:
        opacity .26s cubic-bezier(.22, 1, .36, 1),
        background-color .14s ease;
}

#layer-search.flex {
    opacity: 1;
}

#layer-search::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(
            circle 120px at var(--aq-tap-x) var(--aq-tap-y),
            rgba(255, 255, 255, 0.26) 0%,
            rgba(255, 255, 255, 0.14) 28%,
            rgba(255, 255, 255, 0.06) 48%,
            rgba(255, 255, 255, 0.00) 72%
        );
    transform: scale(0.985);
    transition:
        opacity .10s ease-out,
        transform .12s ease-out;
}

#layer-search.aq-search-backdrop-pressed {
    background-color: var(--aq-search-scrim-pressed);
}

#layer-search.aq-search-backdrop-pressed::after {
    opacity: 1;
    transform: scale(1);
}

#layer-search .aq-spotlight__panel {
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity .18s ease-out,
        transform .20s ease-out,
        box-shadow .22s ease;
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

#layer-search.flex .aq-spotlight__panel {
    opacity: 1;
    transform: translateY(0);
}

.aq-spotlight__panel {
    box-shadow:
        0 18px 44px rgba(8, 12, 20, 0.10),
        0 6px 18px rgba(8, 12, 20, 0.06);
}

.aq-spotlight__body {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.aq-search-chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 9999px;
    font-size: 13px;
    line-height: 1;
    color: var(--aq-text-2, #4a5260);
    background: var(--aq-surface-2, #f2f3f5);
    border: 1px solid var(--aq-border, #e3e5e9);
    transition:
        background-color .15s ease,
        color .15s ease,
        transform .12s ease;
    cursor: pointer;
}

.aq-search-chip:hover {
    background: var(--aq-surface-hover, #e9ebef);
    color: var(--aq-text-1, #1a1e26);
}

.aq-search-chip:active {
    transform: scale(.96);
}

.aq-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-right: 2px;
    padding: 0 4px;
    border-radius: 5px;
    font-size: 11px;
    font-family: inherit;
    color: var(--aq-text-2, #4a5260);
    background: var(--aq-surface-2, #f2f3f5);
    border: 1px solid var(--aq-border, #e3e5e9);
}

@media (prefers-reduced-motion: reduce) {
    #layer-search,
    #layer-search::after,
    #layer-search .aq-spotlight__panel,
    .aq-search-chip,
    .aq-search-item,
    .aq-search-item__chev,
    .aq-search-item__media img {
        transition: none !important;
    }
}

/* Убираем нативный крестик браузера у search-input */
#layer-search-input[type="search"]::-webkit-search-decoration,
#layer-search-input[type="search"]::-webkit-search-cancel-button,
#layer-search-input[type="search"]::-webkit-search-results-button,
#layer-search-input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

@media (max-width: 1279px) {
  #mse2_filters {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    max-height: 82vh;
    overflow: auto;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transform: translateY(110%);
    transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }

  #mse2_filters.is-open {
    transform: translateY(0);
  }

  .aq-filters-lock,
  .aq-filters-lock body {
    overflow: hidden;
  }
}

#aq-active-filters:empty {
  display: none;
}


#mse2_filters .sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

#mse2_results > *{
  content-visibility:auto;
  contain-intrinsic-size: 420px;
}

.mse2_number::placeholder{
  color: var(--color-text-faint);
}

#mse2_filters fieldset{
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

#mse2_filters fieldset:hover{
  border-color: var(--color-divider);
}

#mse2_filters input:checked + span{
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

