/* Filter panel */
.gwsfb-filters__panel {
  display: flex;
  flex-direction: column;
  row-gap: 12px;
}

/* Collapsible blocks */
.gwsfb__block {
  width: 100%;
}

.gwsfb__title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
}

.gwsfb__title-text {
  flex: 1;
}

.gwsfb__title-icon {
  margin-left: 8px;
  font-size: 14px;
  line-height: 1;
}

.gwsfb__title-icon::before {
  content: "+";
}

.gwsfb__block.is-open .gwsfb__title-icon::before {
  content: "-";
}

.gwsfb__block.is-collapsed .gwsfb__title-icon::before {
  content: "+";
}

.gwsfb__body {
  margin-top: 8px;
}

.gwsfb__block.is-collapsed .gwsfb__body {
  display: none;
}

/* Price slider */
.gwsfb-price {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gwsfb-price__range {
  position: relative;
  width: 100%;
  padding: 8px 0;
}

.gwsfb-price__range::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 999px;
  background: var(--gwsfb-price-track-bg, #e0e0e0);
}

.gwsfb-price__range::after {
  content: "";
  position: absolute;
  left: var(--gwsfb-price-min, 0);
  right: calc(100% - var(--gwsfb-price-max, 100%));
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 999px;
  background: var(--gwsfb-price-fill-bg, #333333);
}

.gwsfb-price__input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  position: relative;
  pointer-events: auto;
}

.gwsfb-price__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--gwsfb-price-thumb-bg, #333333);
  border: none;
  cursor: pointer;
}

.gwsfb-price__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--gwsfb-price-thumb-bg, #333333);
  border: none;
  cursor: pointer;
}

.gwsfb-price__input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.gwsfb-price__input::-moz-range-track {
  height: 4px;
  background: transparent;
}

.gwsfb-price__values {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

/* Meta row */
.gwsr-meta{
  margin:0 0 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.gwsfb__count{
  font-size:14px;
  opacity:.85;
}

/* Root results wrapper so loading overlay covers sort + grid */
.gwsfb.gwsfb-results{
  position:relative;
}

/* Results container */
.gwsfb .gwsfb__results{
}

/* Grid */
.gwsfb .gwsfb-results__grid{
  display:grid !important;
  gap:16px !important;
  grid-template-columns:repeat(var(--gwsfb_cols, 4), minmax(0, 1fr)) !important;
  align-items:stretch;
  justify-items:stretch !important;
  align-content:start !important;
}

/* Card base */
.gwsr-card{
  border:1px solid #e6e6e6;
  border-radius:10px;
  padding:12px;
  background:#fff;
  display:flex;
  flex-direction:column;
  gap:10px;
  width:100%;
  min-width:0;
}

.gwsr-img img{
  width:100%;
  height:auto;
  display:block;
}
.gwsr-title{
  text-decoration:none;
  font-weight:600;
  line-height:1.25;
}
.gwsr-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.gwsr-price ins{
  text-decoration:none;
}
.gwsr-desc{
  opacity:.9;
  font-size:14px;
  line-height:1.5;
}
.gwsr-morelink{
  text-decoration:none;
  font-size:14px;
  display:inline-block;
}
.gwsr-btn .button,
.gwsr-btn a.button{
  width:100%;
}

/* Layout: small grid */
.gwsr-small_grid .gwsr-row{
  flex-wrap:wrap;
  justify-content:flex-start;
}
.gwsr-small_grid .gwsr-price{
  font-weight:600;
}

/* Options panel for small grid */
.gwsr-toggle{
  border:1px solid #e0e0e0;
  background:#f7f7f7;
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  width:100%;
  text-align:left;
}
.gwsr-options{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:6px;
}

/* Layout: large grid */
.gwsr-large_grid{
  padding:16px;
  gap:12px;
}
.gwsr-large_grid .gwsr-title{
  font-size:18px;
}
.gwsr-large_grid .gwsr-desc{
  font-size:15px;
}

/* Layout: list */
.gwsfb .gwsfb-results__wrap[data-layout="list"] .gwsfb-results__grid{
  grid-template-columns:1fr !important;
}
.gwsr-list{
  flex-direction:row;
  gap:16px;
  align-items:flex-start;
}
.gwsr-list .gwsr-img{
  flex:0 0 180px;
  max-width:180px;
}
.gwsr-list .gwsr-body{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.gwsr-list .gwsr-btn .button,
.gwsr-list .gwsr-btn a.button{
  width:auto;
}

/* Responsive */
@media (max-width: 1024px){
  .gwsfb .gwsfb-results__grid{
    --gwsfb_cols:3 !important;
  }
}
@media (max-width: 768px){
  .gwsfb .gwsfb-results__grid{
    --gwsfb_cols:2 !important;
  }
  .gwsr-list{
    flex-direction:column;
  }
  .gwsr-list .gwsr-img{
    flex:0 0 auto;
    max-width:100%;
  }
}
@media (max-width: 480px){
  .gwsfb .gwsfb-results__grid{
    --gwsfb_cols:1 !important;
  }
}

/* Hard fix against theme forcing full row */
.gwsfb .gwsfb-results__grid > .gwsr-card{
  grid-column:auto !important;
  grid-row:auto !important;
  width:auto !important;
  max-width:100% !important;
  justify-self:stretch !important;
}

/* Pagination */
.gwsfb .gwsfb__pager{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.gwsfb .gwsfb__pager .gwsfb__page.button{
  min-width:32px;
  line-height:1;
}

/* Sort bar */
.gwsfb__sort{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  margin:0 0 12px;
  width:100%;
}
.gwsfb__sortlabel{
  font-size:14px;
  line-height:1;
  opacity:.85;
}
.gwsfb__sortselect{
  width:200px;
  max-width:100%;
  height:36px;
  padding:6px 10px;
}

/* Loading overlay */
.gwsfb__loading{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  opacity:0;
  transition:opacity .15s ease;
  z-index:5;
  background:var(--gwsfb-loading-bg, rgba(255,255,255,.8));
  height:0;
  overflow:hidden;
}
.gwsfb-is-loading .gwsfb__loading{
  opacity:var(--gwsfb-loading-opacity, 1);
  pointer-events:auto;
  height:100%;
}

/* Dim results when loading */
.gwsfb-is-loading .gwsfb__results{
  opacity:.4;
  transition:opacity .15s ease;
}

.gwsfb__loading-inner{
  min-width:80px;
  min-height:80px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.gwsfb__spinner{
  width:34px;
  height:34px;
  border-radius:999px;
  border:3px solid rgba(0,0,0,.15);
  border-top-color:var(--gwsfb-loading-fg, rgba(0,0,0,.55));
  animation:gwsfbSpin .8s linear infinite;
}
@keyframes gwsfbSpin{
  from{ transform:rotate(0deg); }
  to{ transform:rotate(360deg); }
}
