/* Shop listing filters: slim left column from 992px, slide-in drawer below it.
   Loaded by the catalog listing page only. Script: assets/js/shop-filter.js */

.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.shop-layout > .content-side {
  min-width: 0;
}

/* Panel (sidebar column on wide screens) */
.shop-sidebar {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid #F1E6DE;
  border-radius: 8px;
  background: #fff;
}

.shop-sidebar .filter-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #F1E6DE;
}

.shop-sidebar .filter-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
}

.shop-sidebar .filter-reset {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme-color);
  text-decoration: underline;
}

.shop-sidebar .filter-close {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #F6F7F9;
  font-size: 24px;
  line-height: 1;
  color: var(--title-color);
  cursor: pointer;
}

.shop-sidebar .filter-reset + .filter-close,
.shop-sidebar .filter-head h3 + .filter-close {
  margin-left: auto;
}

.shop-sidebar .filter-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.shop-sidebar .filter-body {
  padding: 0 16px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.shop-sidebar .filter-foot {
  display: none;
  padding: 12px 16px;
  border-top: 1px solid #F1E6DE;
  background: #fff;
}

.shop-sidebar .filter-foot .theme-btn {
  width: 100%;
  text-align: center;
}

/* Search box */
.shop-sidebar .filter-search {
  position: relative;
  margin: 16px 0 6px;
}

.shop-sidebar .filter-search input[type="search"] {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 52px 0 16px;
  border: 1px solid #E5E5E5;
  border-radius: 42px;
  font-size: 14px;
  color: var(--title-color);
}

.shop-sidebar .filter-search input[type="search"]:focus {
  border-color: var(--theme-color);
  outline: 0;
}

.shop-sidebar .filter-search button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 34px;
  border: 0;
  border-radius: 34px;
  background: var(--theme-color);
  font-size: 15px;
  color: #fff;
}

/* Collapsible groups */
.shop-sidebar .filter-group {
  border-bottom: 1px solid #F1E6DE;
}

.shop-sidebar .filter-group:last-child {
  border-bottom: 0;
}

.shop-sidebar .filter-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  border: 0;
  background: transparent;
  font-family: var(--title-font);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  text-align: left;
  color: var(--title-color);
  cursor: pointer;
}

.shop-sidebar .filter-chevron {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin: 0 4px 3px 12px;
  border-right: 2px solid #8a8a8a;
  border-bottom: 2px solid #8a8a8a;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.shop-sidebar .filter-group.is-open .filter-chevron {
  margin-bottom: -3px;
  transform: rotate(-135deg);
}

.shop-sidebar .filter-group:not(.is-open) .filter-group__body {
  display: none;
}

.shop-sidebar .filter-group__body {
  padding-bottom: 14px;
}

.shop-sidebar .category-list {
  max-height: 260px;
  overflow-y: auto;
}

.shop-sidebar .accordion-box .category-list {
  max-height: none;
}

.shop-sidebar .check-box label {
  display: block;
  font-size: 14px;
  line-height: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.shop-sidebar .check-box label:before,
.shop-sidebar .check-box label:after {
  top: 6px;
}

.shop-sidebar .category-widget .accordion .acc-btn {
  font-size: 14px;
  line-height: 28px;
}

.shop-sidebar .category-widget .accordion .acc-btn:before,
.shop-sidebar .category-widget .accordion .acc-btn .icon-box {
  top: 6px;
}

/* A parent heading only opens and closes its list; the ticks live on the choices below it */
.shop-sidebar .category-widget .accordion .acc-btn {
  padding-left: 0;
}

.shop-sidebar .category-widget .accordion .acc-btn:before {
  display: none;
}

.shop-sidebar .category-widget .accordion .acc-content {
  padding-left: 12px;
}

/* Price: Min/Max boxes and a dual-handle slider */
.shop-sidebar .price-fields {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.shop-sidebar .price-fields label {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.shop-sidebar .price-fields label span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 16px;
  color: #7C7C7C;
}

.shop-sidebar .price-fields input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #E5E5E5;
  border-radius: 6px;
  font-size: 14px;
  color: var(--title-color);
}

.shop-sidebar .price-fields input:focus {
  border-color: var(--theme-color);
  outline: 0;
}

.shop-sidebar .price-fields .price-dash {
  flex: 0 0 auto;
  padding-bottom: 8px;
  color: #7C7C7C;
}

.dual-range {
  position: relative;
  height: 32px;
  margin: 12px 10px 0;
}

.dual-range__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 4px;
  border-radius: 4px;
  background: #F1E6DE;
}

.dual-range__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--theme-color);
  border-radius: 4px;
}

.dual-range input[type="range"] {
  position: absolute;
  left: -10px;
  top: 0;
  width: calc(100% + 20px);
  height: 32px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.dual-range.min-on-top input[data-range-min] {
  z-index: 2;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 32px;
  background: transparent;
}

.dual-range input[type="range"]::-moz-range-track {
  height: 32px;
  background: transparent;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: 4px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--theme-color);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  cursor: grab;
  -webkit-appearance: none;
  appearance: none;
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--theme-color);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  cursor: grab;
}

.dual-range input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--title-color);
  outline-offset: 2px;
}

/* Toolbar: Filter button (drawer trigger) next to the sort control */
.shop-page-section .item-shorting {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.shop-page-section .item-shorting .right-column {
  flex-wrap: wrap;
  gap: 8px 20px;
}

.shop-page-section .item-shorting .right-column .per-page-box {
  margin-right: 0;
}

.filter-open-btn {
  display: none;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--theme-color);
  border-radius: 40px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme-color);
  cursor: pointer;
}

.filter-open-btn .filter-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 20px;
  background: var(--theme-color);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  color: #fff;
}

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

/* Wide: slim left column */
@media only screen and (min-width: 992px) {
  .shop-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
}

@media only screen and (min-width: 1500px) {
  .shop-layout {
    grid-template-columns: 270px minmax(0, 1fr);
  }
}

/* Narrow: the panel becomes a slide-in drawer */
@media only screen and (max-width: 991.98px) {
  .shop-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100001;
    width: min(88vw, 380px);
    border: 0;
    border-radius: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.2);
  }

  .shop-sidebar.is-open {
    visibility: visible;
    transform: none;
    transition: transform 0.28s ease, visibility 0s;
  }

  .shop-sidebar .filter-close {
    display: block;
  }

  .shop-sidebar .filter-body {
    flex: 1 1 auto;
  }

  .shop-sidebar .filter-foot {
    display: block;
  }

  .filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
  }

  .filter-open-btn {
    display: inline-flex;
  }

  body.filter-open {
    overflow: hidden;
  }

  .shop-page-section .item-shorting .right-column {
    margin-left: auto;
  }
}

@media only screen and (max-width: 575.98px) {
  .shop-page-section .item-shorting {
    flex-direction: column;
    align-items: stretch;
  }

  .shop-page-section .item-shorting .right-column {
    margin-left: 0;
    justify-content: space-between;
    gap: 8px 12px;
  }

  .shop-page-section .item-shorting .right-column .per-page-box {
    display: none;
  }
}
