/* Tanahiyot Shop Filters 1.0.2
   Desktop: a list in the sidebar that stays in view while scrolling.
   Tablet and phone (up to 1024px): a sheet from the bottom, opened by
   the "Filter" button above the products.
   Colors and shapes follow the product cards (Additional CSS). */

.tnk-sf,
.tnk-sf-open{
  --tnk-ink:#152A29;
  --tnk-accent:#A3644B;
  --tnk-line:#ECE5DD;
  --tnk-cream:#F3EFE9;
  --tnk-muted:#8A8781;
  font-family:"Montserrat", sans-serif;
  box-sizing:border-box;
}
.tnk-sf[lang="he"],
html[lang^="he"] .tnk-sf-open{
  font-family:"Heebo", sans-serif;
}
.tnk-sf *,
.tnk-sf *::before,
.tnk-sf *::after{ box-sizing:border-box; }

/* ---------------- the panel ---------------- */

.tnk-sf{
  color:var(--tnk-ink);
  padding:4px 0;
}

.tnk-sf__head{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 18px;
}
.tnk-sf__title{
  flex:1;
  margin:0 !important;
  font-family:inherit !important;
  font-size:24px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  color:var(--tnk-ink) !important;
  letter-spacing:0 !important;
  text-transform:none !important;
}
.tnk-sf__clear{
  font-size:14px;
  font-weight:500;
  color:var(--tnk-accent) !important;
  text-decoration:underline !important;
  text-underline-offset:3px;
}
.tnk-sf__close{ display:none !important; }

.tnk-sf__group{ margin:0 0 22px; }
.tnk-sf__legend{
  margin:0 0 10px !important;
  font-family:inherit !important;
  font-size:13px !important;
  font-weight:600 !important;
  letter-spacing:.08em !important;
  text-transform:uppercase !important;
  color:var(--tnk-muted) !important;
  line-height:1.4 !important;
}
.tnk-sf[lang="he"] .tnk-sf__legend{ letter-spacing:0 !important; font-size:14px !important; }

.tnk-sf__list{
  list-style:none !important;
  margin:0 !important;
  padding:0 !important;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.tnk-sf__list li{ margin:0 !important; padding:0 !important; }
.tnk-sf__list li::before,
.tnk-sf__list li::marker{ content:none !important; }

/* one option */
.tnk-sf__opt{
  display:flex !important;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:10px 14px !important;
  border:1px solid transparent;
  border-radius:12px;
  background:transparent;
  color:var(--tnk-ink) !important;
  font-size:15px;
  font-weight:500;
  line-height:1.3;
  text-decoration:none !important;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  transition:background-color .2s ease, border-color .2s ease, color .2s ease;
}
.tnk-sf__name{ flex:1; }
.tnk-sf__count{
  min-width:28px;
  padding:2px 8px;
  border-radius:999px;
  background:var(--tnk-cream);
  color:var(--tnk-muted);
  font-size:12px;
  font-weight:600;
  text-align:center;
  font-variant-numeric:tabular-nums;
  transition:background-color .2s ease, color .2s ease;
}
@media (hover:hover) and (pointer:fine){
  a.tnk-sf__opt:hover{
    background:var(--tnk-cream);
    border-color:var(--tnk-line);
  }
  a.tnk-sf__opt:hover .tnk-sf__count{ background:#fff; }
}
a.tnk-sf__opt:focus-visible{
  outline:2px solid var(--tnk-accent);
  outline-offset:2px;
}
.tnk-sf__opt.is-on{
  background:var(--tnk-ink) !important;
  border-color:var(--tnk-ink) !important;
  color:#fff !important;
}
.tnk-sf__opt.is-on .tnk-sf__count{
  background:rgba(255,255,255,.16);
  color:#fff;
}
/* a check mark on the chosen option */
.tnk-sf__opt.is-on .tnk-sf__name::after{
  content:"";
  display:inline-block;
  width:14px;
  height:14px;
  margin-inline-start:8px;
  vertical-align:-2px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12.5 10 17 19 7'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12.5 10 17 19 7'/%3E%3C/svg%3E") center/contain no-repeat;
}
.tnk-sf__opt.is-empty{
  opacity:.4;
  cursor:default;
}

/* sizes: a grid of two */
.tnk-sf__group--size .tnk-sf__list{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.tnk-sf__group--size .tnk-sf__opt{
  justify-content:space-between;
  border-color:var(--tnk-line);
  font-variant-numeric:tabular-nums;
}
.tnk-sf__group--size .tnk-sf__name{ flex:0 1 auto; direction:ltr; }

.tnk-sf__foot{ display:none; }

/* while products load */
html.tnk-sf-loading .elementor-widget-wc-archive-products ul.products{
  opacity:.45;
  pointer-events:none;
  transition:opacity .2s ease;
}
html.tnk-sf-loading .tnk-sf{ cursor:progress; }

/* the option just tapped: a small spinner in place of its count,
   so it is clear the tap was received */
html.tnk-sf-loading .tnk-sf__opt.is-loading .tnk-sf__count{
  position:relative;
  color:transparent !important;
}
html.tnk-sf-loading .tnk-sf__opt.is-loading .tnk-sf__count::after{
  content:"";
  position:absolute;
  inset:0;
  margin:auto;
  width:12px;
  height:12px;
  border-radius:50%;
  border:2px solid currentColor;
  border-color:var(--tnk-muted) transparent var(--tnk-muted) transparent;
  animation:tnk-sf-spin .7s linear infinite;
}
html.tnk-sf-loading .tnk-sf__opt.is-on.is-loading .tnk-sf__count::after{
  border-color:#fff transparent #fff transparent;
}
/* the "show products" button waits quietly while loading */
html.tnk-sf-loading .tnk-sf__show{
  opacity:.7;
}
@keyframes tnk-sf-spin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){
  html.tnk-sf-loading .tnk-sf__opt.is-loading .tnk-sf__count::after{ animation-duration:2s; }
}

/* desktop: the panel stays in view while scrolling the products */
@media (min-width:1025px){
  .elementor-widget-shortcode:has(> .elementor-widget-container > .elementor-shortcode > .tnk-sf),
  .elementor-widget-shortcode:has(.tnk-sf){
    position:sticky;
    top:110px;
    align-self:flex-start;
  }
}

/* ---------------- the "Filter" button (tablet and phone) ---------------- */

.tnk-sf-open{ display:none !important; }

@media (max-width:1024px){
  html.tnk-sf-ready .tnk-sf-open{
    display:inline-flex !important;
  }
  .tnk-sf-open{
    align-items:center;
    gap:8px;
    margin:0 0 16px !important;
    padding:10px 18px !important;
    min-height:44px;
    border:1.5px solid var(--tnk-ink) !important;
    border-radius:999px !important;
    background:#fff !important;
    color:var(--tnk-ink) !important;
    font-size:14px !important;
    font-weight:600 !important;
    letter-spacing:0 !important;
    text-transform:none !important;
    line-height:1 !important;
    box-shadow:none !important;
    cursor:pointer;
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }
  .tnk-sf-open svg{ flex:0 0 auto; }
  .tnk-sf-open__badge{
    display:inline-grid;
    place-items:center;
    min-width:20px;
    height:20px;
    padding:0 6px;
    border-radius:999px;
    background:var(--tnk-accent);
    color:#fff;
    font-size:12px;
    font-weight:700;
  }

  /* the panel becomes a sheet from the bottom */
  .tnk-sf{
    position:fixed;
    inset:auto 0 0 0;
    z-index:99990;
    max-height:85vh;
    max-height:85dvh;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:20px 20px 0;
    background:#fff;
    border-radius:22px 22px 0 0;
    box-shadow:0 -18px 40px -20px rgba(21,42,41,.45);
    transform:translateY(105%);
    visibility:hidden;
    transition:transform .35s cubic-bezier(.22,.61,.36,1), visibility 0s linear .35s;
  }
  html.tnk-sf-is-open .tnk-sf{
    transform:none;
    visibility:visible;
    transition:transform .35s cubic-bezier(.22,.61,.36,1), visibility 0s;
  }
  .tnk-sf::before{          /* the little handle at the top */
    content:"";
    display:block;
    width:40px;
    height:4px;
    margin:-8px auto 14px;
    border-radius:999px;
    background:var(--tnk-line);
  }
  .tnk-sf__close{
    display:grid !important;
    place-items:center;
    width:40px;
    height:40px;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:50% !important;
    background:var(--tnk-cream) !important;
    color:var(--tnk-ink) !important;
    cursor:pointer;
  }

  /* type options as chips that wrap */
  .tnk-sf__group--type .tnk-sf__list{
    flex-direction:row;
    flex-wrap:wrap;
    gap:8px;
  }
  .tnk-sf__group--type .tnk-sf__opt{
    border-color:var(--tnk-line);
    border-radius:999px;
    padding:8px 14px !important;
    min-height:40px;
  }
  .tnk-sf__group--type .tnk-sf__name{ flex:0 1 auto; }

  .tnk-sf__foot{
    display:block;
    position:sticky;
    bottom:0;
    margin:0 -20px;
    padding:12px 20px calc(12px + env(safe-area-inset-bottom));
    background:#fff;
    border-top:1px solid var(--tnk-line);
  }
  .tnk-sf__show{
    display:block !important;
    width:100% !important;
    min-height:52px;
    margin:0 !important;
    padding:0 16px !important;
    border:0 !important;
    border-radius:12px !important;
    background:var(--tnk-accent) !important;
    color:#fff !important;
    font-family:inherit !important;
    font-size:16px !important;
    font-weight:600 !important;
    letter-spacing:0 !important;
    text-transform:none !important;
    cursor:pointer;
    touch-action:manipulation;
  }

  .tnk-sf-overlay{
    position:fixed;
    inset:0;
    z-index:99980;
    background:rgba(21,42,41,.38);
    opacity:0;
    visibility:hidden;
    transition:opacity .3s ease, visibility 0s linear .3s;
  }
  html.tnk-sf-is-open .tnk-sf-overlay{
    opacity:1;
    visibility:visible;
    transition:opacity .3s ease, visibility 0s;
  }
  html.tnk-sf-is-open,
  html.tnk-sf-is-open body{ overflow:hidden; }
  /* the language flag and other floating buttons step aside */
  html.tnk-sf-is-open #trp-floater-ls{ display:none !important; }
}
