/**
 * Shop filter only. Does not restyle product cards.
 */
body.sa-shop-filter .category-page-row > .col.sa-filter-col {
  flex: 0 0 290px;
  width: 290px;
  max-width: 290px;
}

body.sa-shop-filter .category-page-row > .col.large-9 {
  flex: 1 1 auto;
  width: calc(100% - 290px);
  max-width: calc(100% - 290px);
}

.sa-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 16px 20px;
  border: 1px solid rgba(0, 47, 42, 0.08);
  border-radius: 16px;
  background: #f7f3ea;
  color: #002f2a;
}

.sa-filter__head {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 18px;
}

.sa-filter__close {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #002f2a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.sa-filter__group {
  border-bottom: 1px solid rgba(0, 47, 42, 0.08);
}

.sa-filter__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 12px 2px;
  border: 0;
  background: transparent;
  color: #002f2a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.sa-filter__chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #075b46;
  border-bottom: 1.5px solid #075b46;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
}

.sa-filter__group.is-open .sa-filter__chevron {
  transform: rotate(225deg);
}

.sa-filter__panel {
  display: none;
  padding: 0 0 14px;
}

.sa-filter__group.is-open .sa-filter__panel {
  display: block;
}

.sa-filter__search {
  width: 100%;
  height: 40px;
  margin: 0 0 10px;
  padding: 0 12px;
  border: 1px solid rgba(0, 47, 42, 0.15);
  border-radius: 8px;
  background: #fff;
  color: #002f2a;
}

.sa-filter__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sa-filter__check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}

.sa-filter__check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sa-filter__box {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(0, 47, 42, 0.35);
  border-radius: 4px;
  background: #fff;
}

.sa-filter__check input:checked + .sa-filter__box {
  border-color: #075b46;
  background: #075b46 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23F5E9C8' stroke-width='1.8' d='M1 5l3 3 7-7'/%3E%3C/svg%3E") center / 12px 10px no-repeat;
}

.sa-filter__check input:focus-visible + .sa-filter__box {
  outline: 2px solid #d7c07a;
  outline-offset: 2px;
}

.sa-filter__name {
  flex: 1 1 auto;
  font-size: 14.5px;
  line-height: 1.3;
}

.sa-filter__count {
  color: rgba(0, 47, 42, 0.55);
  font-size: 13px;
}

.sa-filter__more {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #075b46;
  font-weight: 700;
  cursor: pointer;
}

.sa-filter__ranges {
  position: relative;
  height: 28px;
  margin: 8px 0 12px;
}

.sa-filter__ranges input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  pointer-events: none;
  appearance: none;
  background: transparent;
}

.sa-filter__ranges input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #0A3732;
  border-radius: 50%;
  background: #0A3732;
  cursor: pointer;
}

.sa-filter__ranges input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #0A3732;
  border-radius: 50%;
  background: #0A3732;
  cursor: pointer;
}

.sa-filter__ranges input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: #0A3732;
}

.sa-filter__ranges input[type="range"]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 99px;
  background: #0A3732;
}

.sa-filter__price-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sa-filter__price-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.sa-filter__price-fields input {
  height: 40px;
  padding: 0 8px;
  border: 1px solid rgba(0, 47, 42, 0.15);
  border-radius: 8px;
  background: #fff;
  color: #002f2a;
}

.sa-filter__price-readout {
  margin: 8px 0 0;
  color: #075b46;
  font-size: 13px;
  font-weight: 700;
}

.sa-filter__footer {
  display: none;
}

.sa-filter-toolbar__bar {
  display: none;
}

.sa-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.sa-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(215, 192, 122, 0.7);
  border-radius: 999px;
  background: rgba(245, 233, 200, 0.12);
  color: #f5e9c8;
  cursor: pointer;
}

.sa-filter-chip--all {
  background: transparent;
  border-style: dashed;
}

.sa-filter-toolbar__count {
  margin: 0 0 0 auto;
  color: #f5e9c8;
  font-size: 14px;
}

.sa-filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1105;
  border: 0;
  background: rgba(0, 20, 18, 0.45);
}

.sa-filter-backdrop[hidden] {
  display: none;
}

#sa-shop-results.is-loading {
  position: relative;
  min-height: 280px;
}

#sa-shop-results.is-loading .products {
  opacity: 0.35;
}

#sa-shop-results.is-loading::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 180px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(245, 233, 200, 0.05), rgba(245, 233, 200, 0.28), rgba(245, 233, 200, 0.05));
  background-size: 200% 100%;
  animation: sa-filter-shimmer 0.9s linear infinite;
  pointer-events: none;
}

@keyframes sa-filter-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 849px) {
  body.sa-shop-filter .category-page-row > .col.large-9 {
    width: 100%;
    max-width: 100%;
  }

  body.sa-shop-filter .sa-filter-col.hide-for-medium {
    display: block !important;
    position: fixed;
    z-index: 1110;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(92vw, 420px) !important;
    max-width: 420px !important;
    margin: 0;
    overflow: auto;
    background: #f7f3ea;
    transform: translateX(-105%);
    transition: transform 0.35s ease;
  }

  body.sa-shop-filter.sa-filter-open .sa-filter-col.hide-for-medium {
    transform: translateX(0);
  }

  .sa-filter {
    min-height: 100%;
    border: 0;
    border-radius: 0;
    padding-bottom: 92px;
  }

  .sa-filter__head,
  .sa-filter__footer,
  .sa-filter-toolbar__bar {
    display: flex;
  }

  .sa-filter__footer {
    position: sticky;
    bottom: 0;
    gap: 8px;
    margin: 12px -16px -20px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #f7f3ea;
    border-top: 1px solid rgba(0, 47, 42, 0.08);
  }

  .sa-filter__clear,
  .sa-filter__apply,
  .sa-filter-toolbar__open,
  .sa-filter-toolbar__sort select {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 700;
  }

  .sa-filter__clear,
  .sa-filter-toolbar__open {
    border: 1px solid rgba(0, 47, 42, 0.2);
    background: #fff;
    color: #002f2a;
  }

  .sa-filter__apply,
  .sa-filter-toolbar__open {
    background: #075b46;
    color: #f5e9c8;
    border: 0;
  }

  .sa-filter__apply {
    flex: 1 1 auto;
  }

  .sa-filter-toolbar__bar {
    gap: 8px;
    margin-bottom: 12px;
  }

  .sa-filter-toolbar__open,
  .sa-filter-toolbar__sort {
    flex: 1 1 0;
  }

  .sa-filter-toolbar__sort select {
    width: 100%;
    padding: 0 12px;
    border: 1px solid rgba(245, 233, 200, 0.35);
    background: transparent;
    color: #f5e9c8;
  }

  body.sa-shop-filter .sa-filter {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (min-width: 850px) and (max-width: 1099px) {
  body.sa-shop-filter .products.row > .col {
    max-width: 50%;
    flex-basis: 50%;
  }
}

@media (min-width: 850px) {
  body.sa-shop-filter .sa-filter-col {
    align-self: flex-start;
  }

  body.sa-shop-filter .sa-filter {
    position: static;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 6px 12px 8px;
    overflow: visible;
  }

  body.sa-shop-filter .sa-filter__body {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
  }

  body.sa-shop-filter .sa-filter__toggle {
    min-height: 36px;
    padding: 6px 2px;
    font-size: 12px;
  }

  body.sa-shop-filter .sa-filter__panel {
    padding-bottom: 6px;
  }

  body.sa-shop-filter .sa-filter__check {
    min-height: 30px;
    gap: 8px;
  }

  body.sa-shop-filter .sa-filter__search {
    height: 34px;
    margin-bottom: 4px;
  }

  body.sa-shop-filter .sa-filter__ranges {
    height: 22px;
    margin: 2px 0 8px;
  }

  body.sa-shop-filter .sa-filter__price-fields {
    gap: 6px;
  }

  body.sa-shop-filter .sa-filter__price-fields input {
    height: 32px;
  }

  body.sa-shop-filter .sa-filter__price-readout {
    margin-top: 4px;
  }

  body.admin-bar.sa-shop-filter .sa-filter {
    max-height: none;
  }
}

/* Product cards: dark text on the white box. */
body.sa-shop-filter .product-small .box-text,
body.sa-shop-filter .product-small .box-text .category,
body.sa-shop-filter .product-small .box-text .name,
body.sa-shop-filter .product-small .box-text .name a,
body.sa-shop-filter .product-small .box-text .name a:hover,
body.sa-shop-filter .product-small .box-text .price,
body.sa-shop-filter .product-small .box-text .price .amount,
body.sa-shop-filter .product-small .box-text .woocommerce-Price-currencySymbol {
  color: #111111 !important;
}
