/* =====================================================================
   Product list: toolbar + filters (sidebar on desktop, drawer on mobile)
   ===================================================================== */
.pl-shop {
  --pl-accent: #a68a64;
  --pl-accent-dark: #8a7355;
  --pl-ink: #2b2520;
  --pl-muted: #7a7068;
  --pl-line: #ece6de;
  --pl-soft: #f7f3ee;
  --pl-radius: 12px;
  padding: 28px 0 60px;
  color: var(--pl-ink);
}

.pl-banner-text {
  padding-top: 24px;
}

.pl-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- buttons ---------- */
.pl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--pl-ink);
  border-radius: 999px;
  background: var(--pl-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.pl-btn:hover {
  background: var(--pl-accent);
  border-color: var(--pl-accent);
}

.pl-btn:active {
  transform: scale(0.97);
}

.pl-btn:focus-visible,
.pl-sort:focus-visible,
.pl-link:focus-visible,
.pl-group summary:focus-visible {
  outline: 2px solid var(--pl-accent);
  outline-offset: 2px;
}

.pl-btn-ghost {
  background: transparent;
  color: var(--pl-ink);
  border-color: var(--pl-line);
}

.pl-btn-ghost:hover {
  background: var(--pl-soft);
  color: var(--pl-ink);
  border-color: var(--pl-accent);
}

.pl-btn[hidden],
.pl-badge[hidden] {
  display: none !important;
}

.pl-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pl-accent);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  letter-spacing: 0;
}

.pl-btn:hover .pl-badge {
  background: #fff;
  color: var(--pl-accent-dark);
}

/* ---------- toolbar ---------- */
.pl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--pl-line);
  position: relative;
  z-index: 25; /* sort dropdown must open above the product grid */
}

.pl-toolbar-left,
.pl-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pl-count {
  font-size: 13px;
  color: var(--pl-muted);
  letter-spacing: 0.02em;
}

.pl-sort-wrap {
  position: relative;
  margin: 0;
}

.pl-sort-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--pl-ink);
  border-bottom: 1.5px solid var(--pl-ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.pl-sort {
  -webkit-appearance: none;
  appearance: none;
  height: 42px;
  padding: 0 40px 0 18px;
  border: 1px solid var(--pl-line);
  border-radius: 999px;
  background: #fff;
  color: var(--pl-ink);
  font-size: 13px;
  cursor: pointer;
}

.pl-sort:hover {
  border-color: var(--pl-accent);
}

/* active filter chips */
.pl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.pl-chips:empty {
  display: none;
}

.pl-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--pl-line);
  border-radius: 999px;
  background: var(--pl-soft);
  color: var(--pl-ink);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  animation: pl-pop 0.2s ease;
}

.pl-chip:hover {
  border-color: var(--pl-accent);
  background: #fff;
}

.pl-chip .pl-chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.pl-chip .pl-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: var(--pl-muted);
  font-size: 14px;
  line-height: 1;
}

.pl-chip:hover .pl-chip-x {
  background: var(--pl-accent);
  color: #fff;
}

@keyframes pl-pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- layout ---------- */
.pl-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.pl-shop.is-collapsed .pl-layout {
  grid-template-columns: minmax(0, 1fr);
}

.pl-shop.is-collapsed .pl-sidebar {
  display: none;
}

/* ---------- sidebar ---------- */
.pl-sidebar {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: #fff;
}

.pl-sidebar-head,
.pl-sidebar-foot {
  display: none;
}

.pl-sidebar-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--pl-line) transparent;
}

.pl-group {
  border-bottom: 1px solid var(--pl-line);
  padding: 16px 0;
}

.pl-group:first-child {
  padding-top: 0;
}

.pl-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pl-ink);
  cursor: pointer;
  user-select: none;
}

.pl-group summary::-webkit-details-marker {
  display: none;
}

.pl-group summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--pl-muted);
  border-bottom: 1.5px solid var(--pl-muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  margin-right: 4px;
}

.pl-group[open] summary::after {
  transform: rotate(-135deg);
}

.pl-group[open] > :not(summary) {
  margin-top: 14px;
  animation: pl-fade 0.25s ease;
}

@keyframes pl-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* link lists */
.pl-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pl-links li + li {
  margin-top: 2px;
}

.pl-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--pl-muted) !important;
  font-size: 14.5px;
  line-height: 1.35;
  transition: color 0.2s ease, padding 0.2s ease;
}

.pl-link::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--pl-line);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pl-link:hover {
  color: var(--pl-ink) !important;
  padding-left: 3px;
}

.pl-link.is-active {
  color: var(--pl-ink) !important;
  font-weight: 700;
}

.pl-link.is-active::before {
  background: var(--pl-accent);
  border-color: var(--pl-accent);
}

/* price */
.pl-price .price-range.ui-slider {
  position: relative;
  height: 4px;
  margin: 10px 9px 22px;
  border: 0;
  border-radius: 4px;
  background: var(--pl-line);
}

.pl-price .ui-slider-range {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  background: var(--pl-accent);
}

.pl-price .ui-slider-handle {
  position: absolute;
  top: -8px;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border: 2px solid var(--pl-accent) !important;
  border-radius: 50%;
  background: #fff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: grab;
  outline: none;
  transition: transform 0.15s ease;
}

.pl-price .ui-slider-handle:hover,
.pl-price .ui-slider-handle:focus {
  transform: scale(1.12);
}

.pl-price-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pl-price-values label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pl-muted);
}

.pl-price-values span {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  padding: 8px 12px;
  border: 1px solid var(--pl-line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--pl-ink);
  letter-spacing: 0;
  text-transform: none;
}

.pl-price-values input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--pl-ink);
  font-size: 14px;
}

/* colour swatches */
.pl-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pl-swatch {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.pl-swatch input,
.pl-size input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pl-swatch-dot {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px transparent;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.pl-swatch:hover .pl-swatch-dot {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--pl-line);
}

.pl-swatch input:checked + .pl-swatch-dot {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--pl-accent);
}

.pl-swatch input:focus-visible + .pl-swatch-dot,
.pl-size input:focus-visible + span {
  outline: 2px solid var(--pl-accent);
  outline-offset: 3px;
}

/* sizes */
.pl-sizes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pl-size {
  margin: 0;
  cursor: pointer;
}

.pl-size span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1px solid var(--pl-line);
  border-radius: 10px;
  font-size: 14px;
  color: var(--pl-ink);
  transition: all 0.2s ease;
}

.pl-size:hover span {
  border-color: var(--pl-accent);
}

.pl-size input:checked + span {
  background: var(--pl-ink);
  border-color: var(--pl-ink);
  color: #fff;
}

/* ---------- results ---------- */
.pl-results {
  min-width: 0;
  position: relative;
}

.pl-results .single-products {
  transition: opacity 0.25s ease;
}

.pl-shop.is-loading .single-products {
  opacity: 0.35;
  pointer-events: none;
}

.pl-shop.is-loading .pl-results::after {
  content: "";
  position: absolute;
  top: 120px;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border: 3px solid var(--pl-line);
  border-top-color: var(--pl-accent);
  border-radius: 50%;
  animation: pl-spin 0.8s linear infinite;
}

@keyframes pl-spin {
  to { transform: rotate(360deg); }
}

.pl-overlay {
  display: none;
}

/* ---------- tablet & mobile: drawer ---------- */
@media (max-width: 991.98px) {
  .pl-shop {
    padding-top: 16px;
  }

  .pl-wrap {
    padding: 0 16px;
  }

  .pl-layout,
  .pl-shop.is-collapsed .pl-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pl-toolbar {
    position: sticky;
    top: 0;
    z-index: 25;
    background: #fff;
    padding-top: 10px;
    margin-bottom: 18px;
  }

  .pl-sidebar,
  .pl-shop.is-collapsed .pl-sidebar {
    display: flex;
    position: fixed;
    z-index: 3001;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(380px, 88vw);
    max-height: none;
    background: #fff;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.18);
    transform: translateX(-105%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    visibility: hidden;
  }

  .pl-shop.is-open .pl-sidebar {
    transform: none;
    visibility: visible;
  }

  .pl-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--pl-line);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .pl-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--pl-soft);
    color: var(--pl-ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .pl-sidebar-body {
    flex: 1;
    padding: 6px 20px 20px;
  }

  .pl-group:first-child {
    padding-top: 16px;
  }

  .pl-sidebar-foot {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--pl-line);
    background: #fff;
  }

  .pl-sidebar-foot .pl-btn {
    justify-content: center;
    height: 46px;
  }

  .pl-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(20, 16, 12, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .pl-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .pl-overlay[hidden] {
    display: none;
  }

  body.pl-lock {
    overflow: hidden;
  }
}

@media (max-width: 575.98px) {
  .pl-toolbar {
    gap: 10px;
  }

  .pl-toolbar-left,
  .pl-toolbar-right {
    width: 100%;
  }

  .pl-toolbar-right {
    justify-content: space-between;
  }

  .pl-toolbar-left .pl-filter-toggle {
    flex: 1;
    justify-content: center;
  }

  .pl-sort {
    padding-left: 14px;
  }

  .pl-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .pl-chips::-webkit-scrollbar {
    display: none;
  }

  .pl-chip {
    flex: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pl-shop *,
  .pl-sidebar {
    animation: none !important;
    transition: none !important;
  }
}

/* no results */
.pl-empty {
  padding: 70px 20px;
  border: 1px dashed var(--pl-line);
  border-radius: var(--pl-radius);
  background: var(--pl-soft);
}

.pl-empty h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.pl-empty p {
  color: var(--pl-muted);
  margin-bottom: 22px;
}

.pl-empty .pl-btn {
  color: #fff !important;
}

/* sort: theme turns .sorting into a nice-select dropdown - style that instead */
.pl-sort-wrap:has(.nice-select)::after {
  display: none;
}

.pl-sort-wrap .nice-select {
  float: none;
  height: 42px;
  line-height: 40px;
  padding: 0 42px 0 18px;
  border: 1px solid var(--pl-line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--pl-ink);
  background: #fff;
}

.pl-sort-wrap .nice-select:hover,
.pl-sort-wrap .nice-select.open {
  border-color: var(--pl-accent);
}

.pl-sort-wrap .nice-select:after {
  right: 18px;
  width: 7px;
  height: 7px;
  border-color: var(--pl-ink);
}

.pl-sort-wrap .nice-select .list {
  left: auto;
  right: 0;
  min-width: 100%;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid var(--pl-line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
  z-index: 30;
}

.pl-sort-wrap .nice-select .option {
  min-height: 38px;
  line-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
}

.pl-sort-wrap .nice-select .option:hover,
.pl-sort-wrap .nice-select .option.focus,
.pl-sort-wrap .nice-select .option.selected.focus {
  background: var(--pl-soft);
}

.pl-sort-wrap .nice-select .option.selected {
  font-weight: 700;
  color: var(--pl-accent-dark);
}
