/* ===========================================================================
 * Shop filter — compact bar + slide-in drawer
 * ---------------------------------------------------------------------------
 * Self-contained styles (brand CSS variables only) so the filter renders the
 * same way on mobile and desktop without relying on new Tailwind utilities.
 * ======================================================================== */

:root {
  --sfx-line: rgba(15, 23, 42, 0.12);
  --sfx-muted: #64748b;
}

/* ----------------------------- compact bar ------------------------------ */
.shop-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.shop-bar-btn,
.shop-bar-select select {
  height: 42px;
  border: 1px solid var(--sfx-line);
  border-radius: 10px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}

.shop-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.shop-bar-btn:hover {
  border-color: rgba(15, 23, 42, 0.3);
  background: #f8fafc;
}
.shop-bar-btn svg {
  width: 16px;
  height: 16px;
}
.shop-bar-count {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  padding: 0 5px;
}

.shop-bar-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.shop-bar-select select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 2rem 0 0.85rem;
  max-width: 100%;
  font-weight: 500;
  cursor: pointer;
  text-overflow: ellipsis;
}
.shop-bar-select svg {
  position: absolute;
  right: 0.6rem;
  width: 16px;
  height: 16px;
  color: var(--sfx-muted);
  pointer-events: none;
}

@media (max-width: 480px) {
  .shop-bar-select select {
    max-width: 42vw;
  }
}

/* ------------------------------- drawer --------------------------------- */
.shop-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 80;
}
.shop-drawer-backdrop[hidden] {
  display: none;
}

.shop-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 88vw);
  background: #fff;
  z-index: 90;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px -20px rgba(15, 23, 42, 0.5);
}
.shop-drawer[hidden] {
  display: none;
}

.shop-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--sfx-line);
  font-weight: 700;
  font-size: 0.95rem;
}
.shop-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--sfx-line);
  background: #fff;
  cursor: pointer;
}
.shop-drawer-close svg {
  width: 18px;
  height: 18px;
}

.shop-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.shop-drawer-sec {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}
.shop-drawer-sec:last-child {
  border-bottom: 0;
}
.shop-drawer-sec h3 {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f172a;
}

.shop-drawer-search {
  position: relative;
  display: flex;
  align-items: center;
}
.shop-drawer-search svg {
  position: absolute;
  left: 0.7rem;
  width: 16px;
  height: 16px;
  color: var(--sfx-muted);
  pointer-events: none;
}
.shop-drawer-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--sfx-line);
  border-radius: 10px;
  padding: 0 0.75rem 0 2.2rem;
  font-size: 0.875rem;
  background: #fff;
}

.shop-drawer-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.shop-drawer-price input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--sfx-line);
  border-radius: 10px;
  padding: 0 0.7rem;
  font-size: 0.875rem;
  background: #fff;
}
.shop-drawer-price span {
  color: var(--sfx-muted);
}

.shop-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 240px;
  overflow-y: auto;
}
.shop-drawer-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0 0.25rem;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
  border-radius: 8px;
}
.shop-drawer-check:hover {
  background: #f8fafc;
}
.shop-drawer-check input {
  width: 18px;
  height: 18px;
  accent-color: #0f172a;
}

.shop-drawer-foot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--sfx-line);
}
.shop-drawer-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--sfx-line);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}
.shop-drawer-reset svg {
  width: 16px;
  height: 16px;
}
.shop-drawer-apply {
  flex: 1;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.shop-drawer-apply:hover {
  opacity: 0.92;
}

body.shop-drawer-open {
  overflow: hidden;
}

/* ===========================================================================
 * Desktop sidebar filter (lg and up) — mobile keeps the bar + drawer above.
 * ======================================================================== */
.shop-side { display: none; }

@media (min-width: 1024px) {
  .shop-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 1.75rem;
    align-items: start;
  }
  .shop-form { display: contents; }

  .shop-side {
    display: block;
    grid-column: 1;
    grid-row: 1 / span 2;
    position: sticky;
    top: 1.25rem;
    background: #fff;
    border: 1px solid var(--sfx-line);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
  }
  .shop-bar { grid-column: 2; grid-row: 1; }
  .shop-results { grid-column: 2; grid-row: 2; min-width: 0; }
  .shop-bar-btn-mobile { display: none; }
}

.shop-side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--sfx-line);
  font-size: 0.8rem;
  color: var(--sfx-muted);
}
.shop-side-clear {
  font-weight: 700;
  font-size: 0.78rem;
  color: #0f172a;
  text-decoration: none;
}
.shop-side-clear:hover { text-decoration: underline; }

.shop-side-sec { border-bottom: 1px solid var(--sfx-line); }
.shop-side-sec:last-child { border-bottom: 0; }
.shop-side-sec > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
}
.shop-side-sec > summary::-webkit-details-marker { display: none; }
.shop-side-sec > summary::after {
  content: "+";
  font-size: 1rem;
  font-weight: 500;
  color: var(--sfx-muted);
  line-height: 1;
}
.shop-side-sec[open] > summary::after { content: "\2212"; }

.shop-side-list {
  display: flex;
  flex-direction: column;
  padding: 0 0.55rem 0.75rem;
}
.shop-side-list-scroll { max-height: 320px; overflow-y: auto; }

.shop-side-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0.35rem;
  border-radius: 7px;
  font-size: 0.83rem;
  color: #334155;
  cursor: pointer;
}
.shop-side-check:hover { background: #f8fafc; }
.shop-side-check input {
  width: 15px;
  height: 15px;
  accent-color: #0f172a;
  flex: none;
}

/* --------------------------- price range slider ------------------------- */
.shop-side-price { padding: 0 0.9rem 1.1rem; }
.shop-side-price-vals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.6rem;
}

.shop-range { position: relative; height: 22px; }
.shop-range-track,
.shop-range-fill {
  position: absolute;
  top: 9px;
  height: 4px;
  border-radius: 999px;
}
.shop-range-track { left: 0; right: 0; background: rgba(15, 23, 42, 0.12); }
.shop-range-fill { background: #0f172a; }

.shop-range input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 22px;
  margin: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}
.shop-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
  cursor: pointer;
}
.shop-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #fff;
  cursor: pointer;
}
.shop-range input[type="range"]::-moz-range-track { background: transparent; }
