/* spore-frontend-filters/assets/filters.css */

:root{
  --sp-gap: 26px;
  --sp-min: 360px;
  --sp-h: 50px;
  --sp-r: 10px;

  --sp-border: #000000;
  --sp-bg: #ffffff;

  --sp-label: #6a6a6a;
  --sp-text: #222;

  --sp-blue: #6b7280;
  --sp-blue-hover: #9ca3af;
  --sp-blue-rgb: 107,114,128;

  --sp-chip-bg: rgba(var(--sp-blue-rgb), .12);
  --sp-chip-border: rgba(var(--sp-blue-rgb), .45);
  --sp-chip-text: var(--sp-blue);
  --sp-chip-divider: rgba(var(--sp-blue-rgb), .35);
}

/* main form */
.spore-filters-form{
  display:flex;
  flex-wrap:wrap;
  gap:var(--sp-gap);
  align-items:flex-end;
  margin:0 0 28px;
  padding:0;
}

/* each item */
.spore-filters-form .spore-item.spore-filter{
  flex: 0 1 var(--sp-min);
  min-width: var(--sp-min);
  width: var(--sp-min);
  max-width:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:0;
  box-sizing:border-box;
}
.spore-filters-form .spore-item.spore-filter.spore-filter-grow{
  flex: 2 1 calc(var(--sp-min) * 2 + var(--sp-gap));
  width:auto;
  max-width: calc(var(--sp-min) * 2 + var(--sp-gap));
}

/* labels */
.spore-filters-form label{
  margin:0;
  padding:0;
  font-size:var(--wp--preset--font-size--sm-med);
  letter-spacing:.04em;
  text-transform:none;
  font-weight:400;
  line-height:1.2;
}

/* text inputs */
.spore-filters-form .spore-text-input{
  width:100%;
  height:var(--sp-h);
  box-sizing:border-box;
  border:1px solid var(--sp-border);
  background:var(--sp-bg);
  border-radius:var(--sp-r);
  padding:0 16px;
  font-size:var(--wp--preset--font-size--custom-1);
  font-weight:400;
  line-height:1;
  color:inherit;
  outline:none;
  box-shadow:none;
}
.spore-filters-form .spore-text-input:focus{
  border-color:var(--sp-blue);
  box-shadow:0 0 0 3px rgba(var(--sp-blue-rgb), .14);
}

/* choices wrapper behaves like input */
.spore-filters-form .choices{
  width:100%;
  max-width:100%;
  margin:0;
}
.spore-filters-form .choices__inner{
  width:100%;
  min-height:var(--sp-h);
  box-sizing:border-box;
  border:1px solid var(--sp-border);
  background:var(--sp-bg);
  border-radius:var(--sp-r);
  padding:6px 10px;
  font-size:var(--wp--preset--font-size--custom-1);
  font-weight:400;
  color:inherit;
  display:flex;
  gap:6px;
  align-items:center;
  justify-content:flex-start;
  direction:ltr;
  text-align:left;
  box-shadow:none;
  flex-wrap:nowrap;
  align-content:center;
  overflow-x:auto;
  overflow-y:hidden;
}
.spore-filters-form .choices__inner:focus-within{
  border-color:var(--sp-blue);
  box-shadow:0 0 0 3px rgba(var(--sp-blue-rgb), .14);
}

/* keep height stable */
.spore-filters-form .choices__input--cloned{
  padding:0 !important;
  margin:0 !important;
  height:22px !important;
  min-height:22px !important;
  line-height:22px !important;
  font-size:var(--wp--preset--font-size--custom-1) !important;
  font-weight:400 !important;
  position:static !important;
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  flex:0 1 auto;
  min-width:6ch !important;
  width:auto !important;
  max-width:100%;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  color:inherit !important;
  direction:ltr !important;
  text-align:left !important;
  order:2;
  outline:none !important;
}

/* chips */
.spore-filters-form .choices__list--multiple{
  display:flex;
  flex-wrap:nowrap;
  gap:8px;
  align-items:center;
  justify-content:flex-start;
  width:auto;
  min-width:0;
  flex:0 0 auto;
  order:1;
}
.spore-filters-form .choices__list--multiple::after{
  content:none !important;
  display:none !important;
}
.spore-filters-form .choices__list--multiple .choices__item{
  margin:0 !important;
  border-radius:999px;
  background:var(--sp-chip-bg);
  border:2px solid var(--sp-chip-border);
  color:var(--sp-chip-text);
  font-size:var(--wp--preset--font-size--custom-1);
  font-weight:400;
  padding:6px 10px;
  line-height:1;
  flex:0 0 auto;
}

/* remove icon visibility (no white-on-white) */
.spore-filters-form .choices__button{
  opacity:1 !important;
  background:transparent !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 3l10 10m0-10l-10 10' fill='none' stroke='%23222' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-position:center !important;
  background-size:14px 14px !important;
  filter:none !important;
  border-left:2px solid var(--sp-chip-divider) !important;
  margin-left:10px !important;
  padding-left:10px !important;
}

/* dropdown */
.spore-filters-form .choices__list--dropdown{
  border-radius:var(--sp-r);
  border:1px solid var(--sp-border);
  overflow:hidden;
}

/* extras: always hidden when [hidden] is present */
.spore-extra[hidden]{ display:none !important; }

/* legacy */
.spore-is-hidden{ display:none !important; }

/* actions row always full width bottom */
.spore-filters-form .spore-filter-actions{
  flex: 1 1 100%;
  min-width: 100%;
  width: 100%;
  display:flex;
  flex-wrap:wrap;
  gap:18px;
  align-items:center;
  justify-content:flex-start;
}

/* button base (same height as inputs, smaller width) */
.spore-filters-form .spore-btn{
  width:176px;
  min-width:176px;
  max-width:176px;
  height:48px;
  box-sizing:border-box;
  border:0;
  border-radius:0;
  padding:0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  text-decoration:none;
  line-height:1;
  background:transparent url("../../../themes/spore-theme/assets/images/button-s.png") center/176px 48px no-repeat;
  box-shadow:none;
}

/* primary */
.spore-filters-form .spore-btn-primary{
  border:0;
  background:transparent url("../../../themes/spore-theme/assets/images/button-s.png") center/176px 48px no-repeat;
  box-shadow:none;
}
.spore-filters-form .spore-btn-primary:hover{
  background:transparent url("../../../themes/spore-theme/assets/images/button-s.png") center/176px 48px no-repeat;
}

/* ghost */
.spore-filters-form .spore-btn-ghost{
  border:0;
  background:transparent url("../../../themes/spore-theme/assets/images/button-s.png") center/176px 48px no-repeat;
  box-shadow:none;
}
.spore-filters-form .spore-btn-ghost:hover{
  background:transparent url("../../../themes/spore-theme/assets/images/button-s.png") center/176px 48px no-repeat;
}

/* responsive */
@media (max-width: 1100px){
  :root{ --sp-min: 320px; }
}
@media (max-width: 800px){
  .spore-filters-form .spore-item.spore-filter{
    width:100%;
    min-width:100%;
    flex-basis:100%;
  }
  .spore-filters-form .choices__inner{
    overflow-x:visible;
  }
  .spore-filters-form .choices__list--multiple{
    display:flex;
    flex-wrap:wrap;
    width:100%;
    min-width:0;
  }
  .spore-filters-form .spore-btn{ max-width:176px; }
}
