/* =========================================================
   PLP Filter Panel — modern compact sidebar / mobile drawer
   Namespace: .plp-filter*  (do not reuse legacy filter classes)
   ========================================================= */

/* =========================================================
   PLP Filter Panel — modern compact sidebar / mobile drawer
   Namespace: .plp-filter*  (do not reuse legacy filter classes)
   ========================================================= */

.plp-filter-col,
.plp-filter-drawer,
.plp-filter {
  --plp-f-sticky-top: 96px;
}

.plp-filter {
  --plp-f-ink: #1a1a1a;
  --plp-f-muted: #8a8a8a;
  --plp-f-line: #ececec;
  --plp-f-soft: #f7f7f7;
  --plp-f-brand: #88013e;
  --plp-f-brand-soft: rgba(136, 1, 62, 0.08);
  --plp-f-radius: 10px;
  --plp-f-gap: 14px;

  background: #fff;
  border: 1px solid var(--plp-f-line);
  border-radius: 14px;
  padding: 14px 14px 16px;
  box-shadow: 0 1px 2px rgba(16, 12, 14, 0.04);
  max-height: calc(100vh - var(--plp-f-sticky-top) - 16px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(136, 1, 62, 0.28) transparent;
}

/* Desktop: keep filter pinned while products scroll */
@media (min-width: 992px) {
  .shop-section .row {
    align-items: flex-start;
  }

  .plp-filter-col {
    position: static !important;
    overflow: visible !important;
    align-self: flex-start !important;
    transform: none !important;
    will-change: auto !important;
  }

  .plp-filter-drawer {
    position: sticky !important;
    top: var(--plp-f-sticky-top) !important;
    z-index: 20 !important;
    width: 100% !important;
    max-height: calc(100vh - var(--plp-f-sticky-top) - 16px) !important;
    overflow: visible !important;
    transform: none !important;
  }

  .plp-filter-drawer .plp-filter {
    max-height: calc(100vh - var(--plp-f-sticky-top) - 16px);
  }
}

.plp-filter::-webkit-scrollbar {
  width: 4px;
}
.plp-filter::-webkit-scrollbar-thumb {
  background: rgba(136, 1, 62, 0.28);
  border-radius: 999px;
}

.plp-filter__back {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--plp-f-brand);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 0 12px;
  margin: 0 0 4px;
  border-bottom: 1px solid var(--plp-f-line);
  cursor: pointer;
}

.plp-filter__section {
  padding: 0 0 var(--plp-f-gap);
  margin: 0 0 var(--plp-f-gap);
  border-bottom: 1px solid var(--plp-f-line);
}
.plp-filter__section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.plp-filter__heading {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plp-f-ink);
}

.plp-filter__search {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.plp-filter__input,
.plp-filter__price-input,
.plp-filter__brand-query {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--plp-f-line);
  border-radius: var(--plp-f-radius);
  background: var(--plp-f-soft);
  color: var(--plp-f-ink);
  font-size: 13px;
  font-weight: 500;
  padding: 0 10px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.plp-filter__input:focus,
.plp-filter__price-input:focus,
.plp-filter__brand-query:focus {
  border-color: var(--plp-f-brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--plp-f-brand-soft);
}

.plp-filter__search-btn,
.plp-filter__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: var(--plp-f-radius);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.plp-filter__search-btn {
  width: 36px;
  flex: 0 0 36px;
  background: var(--plp-f-brand);
  color: #fff;
}
.plp-filter__search-btn:hover:not(:disabled) {
  background: #6e0132;
}
.plp-filter__search-btn:disabled,
.plp-filter__action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.plp-filter__price-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
}

.plp-filter__price-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.plp-filter__price-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--plp-f-muted);
}

.plp-filter__price-input {
  text-align: center;
  font-weight: 700;
  -moz-appearance: textfield;
}
.plp-filter__price-input::-webkit-outer-spin-button,
.plp-filter__price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.plp-filter__price-sep {
  color: var(--plp-f-muted);
  font-weight: 700;
  padding-bottom: 8px;
  line-height: 1;
}

.plp-filter__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.plp-filter__action {
  width: 100%;
}
.plp-filter__action--ghost {
  background: #fff;
  color: #444;
  border-color: #ddd;
}
.plp-filter__action--ghost:hover:not(:disabled) {
  background: var(--plp-f-soft);
  border-color: #ccc;
}
.plp-filter__action--primary {
  background: var(--plp-f-brand);
  color: #fff;
  border-color: var(--plp-f-brand);
}
.plp-filter__action--primary:hover:not(:disabled) {
  background: #6e0132;
}

.plp-filter__brand-query {
  margin-bottom: 8px;
}

.plp-filter__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 168px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(136, 1, 62, 0.28) transparent;
}
.plp-filter__list::-webkit-scrollbar {
  width: 4px;
}
.plp-filter__list::-webkit-scrollbar-thumb {
  background: rgba(136, 1, 62, 0.28);
  border-radius: 999px;
}

.plp-filter__item {
  margin: 0;
}

.plp-filter__check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease;
}
.plp-filter__check:hover {
  background: var(--plp-f-brand-soft);
}

.plp-filter__check input {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  border: 1.5px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.plp-filter__check input::before {
  content: "";
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform 100ms ease;
  box-shadow: inset 1em 1em #fff;
  background-color: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.plp-filter__check input:checked {
  background: var(--plp-f-brand);
  border-color: var(--plp-f-brand);
}
.plp-filter__check input:checked::before {
  transform: scale(1);
}
.plp-filter__check input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.plp-filter__check-label {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  line-height: 1.25;
}

.plp-filter__empty {
  font-size: 12px;
  color: var(--plp-f-muted);
  padding: 6px 2px;
  margin: 0;
}

/* Title-row mobile filter icon */
.plp-filter-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--plp-f-line);
  border-radius: 12px;
  background: #fff;
  color: var(--plp-f-brand);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 12, 14, 0.05);
}
.plp-filter-trigger i {
  font-size: 15px;
}

.plp-filter-title-row {
  position: relative;
}

/* Category image beside title (drawer-style thumb, not full banner) */
.plp-cat-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.plp-cat-heading__icon {
  flex: 0 0 40px;
  width: 40px !important;
  height: 40px !important;
  max-width: 40px;
  max-height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #faf7f8;
  display: block;
}

.plp-cat-heading__text {
  flex: 1 1 auto;
  min-width: 0;
}

.plp-cat-heading__text h2 {
  margin: 0 0 2px;
  line-height: 1.2;
}

/* Drawer shell */
.plp-filter-drawer {
  width: 100%;
}

@media (max-width: 991.98px) {
  .plp-filter-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: min(300px, 88vw);
    height: 100dvh;
    z-index: 1060;
    background: #fff;
    overflow-y: auto;
    transition: left 240ms cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: none;
  }

  .plp-filter-drawer.is-open {
    left: 0;
    box-shadow: 4px 0 28px rgba(20, 16, 18, 0.18);
  }

  .plp-filter-drawer .plp-filter {
    position: static;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 14px 28px;
  }

  .plp-filter__back {
    display: inline-flex;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
  }

  .col-custome-3:has(.plp-filter-drawer) {
    width: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .shop-section .col-custome-9 {
    width: 100% !important;
  }

  .plp-filter-title-row {
    padding-right: 48px;
  }

  .plp-filter-trigger {
    display: inline-flex;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  .bg-overlay {
    z-index: 1050 !important;
  }
}

@media (min-width: 992px) {
  .plp-filter-drawer {
    position: sticky !important;
    top: var(--plp-f-sticky-top, 96px) !important;
    left: auto;
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--plp-f-sticky-top, 96px) - 16px);
    overflow: visible;
    z-index: 20;
    box-shadow: none;
    transform: none !important;
  }

  .plp-filter-drawer .plp-filter {
    position: relative;
    top: auto;
  }
}
