/* ==========================================================================
   Two-column layout: filter (left) + product grid (right)
   Independent of theme sidebar system.
   ========================================================================== */

.wccf-layout {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  width: 100%;
}

/* Sticky sidebar — stays visible while user scrolls products */
.wccf-layout .wccf-root--desktop {
  flex: 0 0 260px;
  width: 260px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  margin-bottom: 0;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.wccf-layout .wccf-root--desktop::-webkit-scrollbar {
  width: 4px;
}
.wccf-layout .wccf-root--desktop::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

.wccf-layout .wccf-results {
  flex: 1 1 0;
  min-width: 0;
}

.wccf-results {
  width: 100%;
  min-height: 40px;
}

@media (max-width: 849px) {
  .wccf-layout {
    display: block;
  }

  .wccf-layout .wccf-root--desktop {
    display: none;
  }

  .wccf-layout .wccf-results {
    width: 100%;
  }
}

/* ==========================================================================
   Filter panel
   ========================================================================== */

.wccf-root {
  margin-bottom: 24px;
  padding: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
}

.wccf-root.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.wccf-header {
  padding: 20px 18px 0;
}

.wccf-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
}

.wccf-heading__icon,
.wccf-mobile-trigger__icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
  flex-shrink: 0;
}

.wccf-heading__icon::before,
.wccf-heading__icon::after,
.wccf-mobile-trigger__icon::before,
.wccf-mobile-trigger__icon::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.wccf-heading__icon::before,
.wccf-mobile-trigger__icon::before {
  top: 3px;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.wccf-heading__icon::after,
.wccf-mobile-trigger__icon::after {
  width: 6px;
  height: 6px;
  top: 1px;
  left: 1px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #fff;
  box-shadow: 6px 6px 0 -2px #fff, 6px 6px 0 0 currentColor,
              12px 12px 0 -2px #fff, 12px 12px 0 0 currentColor;
}

.wccf-groups {
  padding: 0 18px;
}

.wccf-group {
  padding: 24px 0 20px;
  border-top: 1px solid #ececec;
}

.wccf-group:first-child {
  border-top: 0;
}

.wccf-group__title {
  margin-bottom: 14px;
  color: #161616;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 500;
}

.wccf-group__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wccf-option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #161616;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}

.wccf-option input:disabled + span {
  color: #a8a8a8;
  cursor: default;
}

.wccf-option input:disabled {
  accent-color: #a8a8a8;
  cursor: default;
}

.wccf-option input:checked + span,
.wccf-option:hover {
  font-weight: 600;
  color: #db5a2b;
}

.wccf-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #333333;
  flex-shrink: 0;
}

.wccf-group.is-collapsed .wccf-option--extra {
  display: none;
}

.wccf-group__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f1f1f;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
}

.wccf-group__toggle-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
}

.wccf-group.is-expanded .wccf-group__toggle-icon {
  transform: rotate(-135deg) translateY(-1px);
}

.wccf-footer {
  padding: 8px 18px;
  border-top: 1px solid #ececec;
}

.wccf-clear {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #db5a2b;
  background: #db5a2b;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 50px;
  margin-bottom: 0;
}

.wccf-clear:disabled {
  opacity: 0.5;
  cursor: default;
}

.wccf-status {
  margin-top: 10px;
  color: #4c4c4c;
  font-size: 14px;
  line-height: 1.5;
}

/* ==========================================================================
   Mobile trigger + drawer
   ========================================================================== */

.wccf-mobile-trigger-wrap,
.wccf-mobile {
  display: none;
}

@media (max-width: 849px) {
  .wccf-mobile-trigger-wrap {
    display: block;
    margin-bottom: 18px;
  }

  .wccf-mobile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #db5a2b;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
  }

  .wccf-mobile-trigger__icon {
    color: #222222;
  }

  /* Full-screen overlay */
  .wccf-mobile {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99999;       /* above Flatsome header z:9999 */
    visibility: hidden;
    pointer-events: none;
  }

  .wccf-mobile.is-open {
    visibility: visible;
    pointer-events: auto;
  }

  /* Semi-transparent backdrop — clicking closes the drawer */
  .wccf-mobile__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: pointer;
    /* Make it a real block element, not a button */
    display: block;
    width: 100%;
    height: 100%;
  }

  .wccf-mobile.is-open .wccf-mobile__backdrop {
    opacity: 1;
  }

  /* Slide-in drawer panel */
  .wccf-mobile__drawer {
    position: absolute;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    height: 100%;
    background: #ffffff;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1;             /* above backdrop within .wccf-mobile */
  }

  .wccf-mobile.is-open .wccf-mobile__drawer {
    transform: translateX(0);
  }

  .wccf-mobile__top {
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px 0;
  }

  .wccf-mobile__close {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .wccf-mobile__close span {
    position: absolute;
    top: 15px;
    left: 7px;
    width: 18px;
    height: 2px;
    background: #222222;
    display: block;
  }

  .wccf-mobile__close span:first-child {
    transform: rotate(45deg);
  }

  .wccf-mobile__close span:last-child {
    transform: rotate(-45deg);
  }

  /* Filter panel inside the drawer */
  .wccf-root--mobile {
    margin-bottom: 0;
    border: 0;
  }

  .wccf-root--mobile .wccf-header {
    padding-top: 6px;
  }

  body.wccf-mobile-open {
    overflow: hidden;
  }

  .wccf-root--mobile .wccf-heading {
    font-size: 16px;
  }

  .wccf-root--mobile .wccf-group__title,
  .wccf-root--mobile .wccf-option,
  .wccf-root--mobile .wccf-group__toggle,
  .wccf-root--mobile .wccf-clear {
    font-size: 14px;
  }
}
