/* ===================================
   FILTER SIDEBAR — Fixed trigger + Drawer
   Design: production lareservedufumeur.com
   =================================== */

/* ---------- Fixed Trigger Wrap (left edge) ---------- */
.fsb-trigger-wrap {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 997;
}

.fsb-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--black);
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-family: var(--font-sporting);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0 0 10px 10px;
  transform-origin: top left;
  transform: rotate(-90deg) translateX(-100%);
  transition: background .2s;
  position: relative;
}
.fsb-trigger:hover {
  background: #222;
}

.fsb-trigger__label {
  pointer-events: none;
}

.fsb-trigger__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 50%;
  background: var(--green);
  color: var(--black);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Overlay ---------- */
.fsb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.fsb-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* ---------- Panel ---------- */
.fsb {
  position: fixed;
  top: 0;
  left: 0;
  width: 524px;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  border-radius: 0 27px 27px 0;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fsb--open {
  transform: translateX(0);
}

/* ---------- Header ---------- */
.fsb__header {
  flex-shrink: 0;
  padding: 30px 34px 0;
  position: relative;
  z-index: 20;
}
.fsb__title {
  font-family: var(--font-sporting);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  color: var(--black);
  text-transform: uppercase;
  margin: 0 0 20px;
}
.fsb__header-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---------- Search ---------- */
.fsb__search {
  flex: 1;
  position: relative;
}
.fsb__search-input {
  width: 100%;
  height: 48px;
  border: 1px solid #666;
  border-radius: 4px;
  background: #fff;
  padding: 0 16px;
  font-family: var(--font-sporting);
  font-weight: 700;
  font-size: 12px;
  line-height: 15px;
  color: var(--black);
  outline: none;
}
.fsb__search-input::placeholder {
  color: var(--black);
  opacity: 1;
}
.fsb__search-input:focus {
  border-color: var(--black);
}

.fsb__search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  width: 100%;
  max-height: 200px;
  overflow-y: scroll;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.fsb__search-suggest-link {
  display: block;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.25;
  color: var(--black);
  text-decoration: none;
  transition: background .2s;
}

.fsb__search-suggest-item:last-child .fsb__search-suggest-link {
  border-bottom: 0;
}

.fsb__search-suggest-title {
  display: inline-block;
}

.fsb__search-suggest-highlight {
  background: #fde68a;
  border-radius: 4px;
  padding: 0 4px;
}

.fsb__search-suggest-link:hover {
  background: var(--green);
}

.fsb__scroll {
  position: relative;
  z-index: 1;
}

/* ---------- Close ---------- */
.fsb__close {
  flex-shrink: 0;
  width: 47px;
  height: 47px;
  border-radius: 50%;
  border: 1px solid var(--black);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.fsb__close:hover {
  background: var(--green);
}

/* ---------- Form / Scroll ---------- */
.fsb__form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
}
.fsb__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 34px 40px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Section ---------- */
.fsb__section {
  margin-bottom: 8px;
}
.fsb__section-title {
  display: block;
  font-family: var(--font-sporting);
  font-weight: 700;
  font-size: 11px;
  line-height: 12px;
  color: var(--black);
  text-transform: none;
  margin: 0 0 16px;
  border-top: 1px solid var(--black);
  padding-top: 15px;
}

/* ---------- Checkboxes (native + custom) ---------- */
.fsb__checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.fsb__checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fsb__checkbox-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fsb__check {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--black);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background .15s;
}
.fsb__check:checked {
  background: transparent;
  border-color: var(--black);
}
.fsb__check:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}

.fsb__label {
  font-family: var(--font-sporting);
  font-weight: 400;
  font-size: 14px;
  line-height: 18px;
  color: var(--black);
  cursor: pointer;
}

/* ---------- Effect pictos ---------- */
.fsb__effect-picto {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--green);
  object-fit: contain;
  padding: 5px;
  flex-shrink: 0;
}

/* ---------- Price slider ---------- */
.fsb__price-slider {
  padding: 0 4px;
}
.fsb__price-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.fsb__price-val {
  font-family: var(--font-sporting);
  font-weight: 700;
  font-size: 11px;
  line-height: 12px;
  color: var(--black);
}
.fsb__range-track {
  position: relative;
  height: 6px;
  background: #DFDFDF;
  border-radius: 50px;
  margin: 12px 0 8px;
}
.fsb__range-fill {
  position: absolute;
  top: 0;
  height: 6px;
  background: var(--green);
  border-radius: 50px;
  pointer-events: none;
}

/* Dual range inputs stacked */
.fsb__range {
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 22px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  margin: 0;
}
.fsb__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  cursor: grab;
  pointer-events: all;
  position: relative;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.fsb__range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  cursor: grab;
  pointer-events: all;
}
.fsb__range:active::-webkit-slider-thumb {
  cursor: grabbing;
}

.fsb__price-pills {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}
.fsb__price-pill {
  display: inline-block;
  padding: 4px 10px;
  background: var(--green);
  border-radius: 5px;
  font-family: var(--font-sporting);
  font-weight: 700;
  font-size: 11px;
  line-height: 12px;
  color: var(--black);
  text-align: center;
}

/* ---------- Footer (CTA + Clear) ---------- */
.fsb__footer {
  flex-shrink: 0;
  padding: 16px 34px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.fsb__submit {
  width: 100%;
  max-width: 455px;
  height: 48px;
  background: var(--black);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-family: var(--font-sporting);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s;
}
.fsb__submit:hover {
  background: #333;
}
.fsb__submit-count {
  opacity: .7;
}
.fsb__submit--loading {
  opacity: .6;
  pointer-events: none;
}

/* Locked checkbox (context-aware: current taxonomy term) */
.fsb__check--locked {
  pointer-events: none;
  opacity: .6;
}
.fsb__check--locked + .fsb__label {
  color: #999;
  cursor: default;
}

/* AJAX grid loading overlay */
#products-ajax-wrap {
  transition: opacity .3s ease;
  min-height: 200px;
}
.products-ajax-wrap--loading {
  opacity: .35;
  pointer-events: none;
}

.fsb__clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: var(--font-sporting);
  font-weight: 700;
  font-size: 11px;
  line-height: 13px;
  color: var(--black);
  cursor: pointer;
  transition: opacity .2s;
}
.fsb__clear:hover {
  opacity: .6;
}
.fsb__clear svg {
  width: 18px;
  height: 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .fsb-trigger-wrap {
    top: auto;
    bottom: 20px;
    left: 20px;
  }
  .fsb-trigger {
    transform: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 11px;
  }
  .fsb-trigger__badge {
    position: static;
  }
}

@media (max-width: 600px) {
  .fsb {
    width: 100%;
    border-radius: 0;
  }
  .fsb__header {
    padding: 20px 20px 0;
  }
  .fsb__close {
    width: 40px;
    height: 40px;
  }
  .fsb__scroll {
    padding: 16px 20px 30px;
  }
  .fsb__footer {
    padding: 12px 20px 20px;
  }
}
