/* =====================================================
   RS FILTERBAR — MOBILE FIRST (smooth + full-width CTA)
   ===================================================== */

/* tik box-sizing (be width:100%) */
.rs-filterbar,
.rs-filterbar * {
  box-sizing: border-box;
}

.rs-filterbar {
  width: 100%;
  position: relative;
  overflow: visible;
  z-index: 5;
}
.rs-filterbar .rsf-form,
.rs-filterbar .rsf-bar {
  width: 100%;
}

/* ---- MOBILE FIRST ---- */
.rs-filterbar .rsf-bar {
  --g: 14px;
  --btn: 56px;
  --tile-min: 160px;
  display: grid;
  grid-template-columns: 1fr; /* <400px – po 1 */
  gap: var(--g);
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(16, 24, 40, 0.08);
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.1);
  overflow: visible;
  position: relative;
  z-index: 6;
  scroll-behavior: smooth; /* nice scroll */
}

.rs-filterbar .rsf-bar > * {
  min-width: 0;
  max-width: 100%;
  width: auto;
}

/* plytelė */
.rs-filterbar details {
  display: block;
  overflow: visible;
  z-index: 7;
}
.rs-filterbar summary {
  list-style: none;
}
.rs-filterbar summary::-webkit-details-marker {
  display: none;
}
.rs-filterbar summary::marker {
  content: "";
}

.rs-filterbar .rsf-trigger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(16, 24, 40, 0.08);
}
.rs-filterbar details[open] .rsf-trigger {
  border-color: #cfd6e0;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.1);
}

/* headingai */
.rs-filterbar .rsf-h {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rs-filterbar .rsf-ico {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 24px;
}
.rs-filterbar .rsf-h > span {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}
.rs-filterbar .rsf-sub {
  font-size: 16px;
  color: #667085;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* dropdown – smooth (uždarytas nematomas, bet ne display:none) */
.rs-filterbar .rsf-pop {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  width: auto;
  min-width: 0;
  max-width: 100%;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.18);
  z-index: 999;

  /* animacija */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.985);
  transition: opacity 0.18s ease, transform 0.18s ease,
    visibility 0s linear 0.18s;

  max-height: clamp(240px, 56vh, 420px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.rs-filterbar details[open] > .rsf-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

.rs-filterbar .rsf-pop-title {
  font-weight: 700;
  color: #0f172a;
}
.rs-filterbar .rsf-pop-grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* form controls */
.rs-filterbar .rsf-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 6px 6px;
  font-weight: 600;
}
.rs-filterbar select,
.rs-filterbar .rsf-live,
.rs-filterbar .rsf-input {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  outline: 0;
  font-size: 14px;
  background: #fff;
  color: #111827;
}
.rs-filterbar select:focus,
.rs-filterbar .rsf-live:focus,
.rs-filterbar .rsf-input:focus {
  border-color: #d0d5dd;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

/* valiutos prefiksas */
.rsf-inputwrap {
  position: relative;
}
.rsf-inputwrap::before {
  content: attr(data-prefix);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #98a2b3;
  font-weight: 700;
}
.rsf-input {
  padding: 10px 12px 10px 32px;
}

/* live list */
.rsf-list {
  list-style: none;
  padding-left: 0;
  margin-top: 8px;
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid rgba(16, 24, 40, 0.06);
  padding-top: 6px;
}
.rsf-option {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.35;
}
.rsf-option:hover,
.rsf-option.is-active {
  background: #f2f4f7;
}

/* pills */
.rsf-pillgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.rsf-pillrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rsf-pill {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: 0.15s;
  min-width: 44px;
  text-align: center;
}
.rsf-pill:hover {
  border-color: #d0d5dd;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}
.rsf-pill.is-active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.rsf-pill-any {
  opacity: 0.85;
}

/* CTA — MOBILE/TABLET: pilno pločio */
.rsf-submit {
  grid-column: 1 / -1;
  order: 99;

  width: 100%;
  height: 54px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  color: #fff;

  background: #f25a07;
  box-shadow: 0 16px 32px rgba(242, 90, 7, 0.22);
}
.rsf-submit > img.rsf-ico {
  width: 22px;
  height: 22px;
  display: block;
}
.rsf-submit::before {
  content: "";
  width: 18px;
  height: 18px;
  display: inline-block;
  background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTMuMTcgMTIuMzVsNC4zOCA0LjM4YTEgMSAwIDEgMS0xLjQxIDEuNDFMMTEuNzUgMTMuNzZhMiAyIDAgMCAxLS40OC4zNUM5LjYzIDE1IDEgMTEuMzcgMSA3LjVBMS41IDEuNSAwIDAgMSAyLjUgNi4xYTYgNiAwIDEgMCA4Ljg0IDguODRjLjE0LjE2LjI3LjMyLjQyLjQ5eiIgZmlsbD0id2hpdGUiLz48Y2lyY2xlIGN4PSI3LjUiIGN5PSI3LjUiIHI9IjUuNSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+")
    center/contain no-repeat;
}
.rsf-submit.has-img::before {
  content: none;
}

/* ---- BREAKPOINTS ---- */

/* ≥400px: auto-fit (2/3/4, kiek telpa) */
@media (min-width: 400px) {
  .rs-filterbar .rsf-bar {
    grid-template-columns: repeat(auto-fit, minmax(var(--tile-min), 1fr));
  }
}

/* ≥560px: dvigubi stulpeliai dropdown/pills */
@media (min-width: 560px) {
  .rs-filterbar .rsf-pop-grid2 {
    grid-template-columns: 1fr 1fr;
  }
  .rsf-pillgrid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ≥860px: grąžinam apvalų mygtuką ir platesnį dropdown'ą (desktop) */
@media (min-width: 860px) {
  .rs-filterbar .rsf-bar {
    --g: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    padding: 16px 20px;
  }
  .rs-filterbar .rsf-submit {
    width: var(--btn);
    height: var(--btn);
    border-radius: 50%;
    box-shadow: 0 12px 30px rgba(242, 90, 7, 0.35);
    justify-self: end;
    order: initial;
    grid-column: auto;
  }
  .rs-filterbar .rsf-submit::before {
    width: 18px;
    height: 18px;
  }
  .rs-filterbar .rsf-pop {
    min-width: 360px;
    max-width: none;
  }
}

/* nuke inline absolute, jei pluginas uždeda */
.rs-filterbar .rsf-submit[style*="position"],
.rs-filterbar .rsf-bar [style*="position:absolute"],
.rs-filterbar .rsf-bar [style*="position: fixed"] {
  position: static !important;
  inset: auto !important;
  transform: none !important;
}

/* === RS FILTERBAR: robust sheet popup ≤1024px + izoliuotas sluoksnis === */
.rs-filterbar .rsf-bar {
  position: relative;
  z-index: 11;
}