/* ===== Trigger button ===== */
.ph-facet-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #222;
  color: #222;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.ph-facet-trigger:hover {
  background: #222;
  color: #fff;
}

/* ===== Overlay ===== */
.ph-facet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.ph-facet-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* ===== Drawer panel ===== */
.ph-facet-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: #fff;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}
.ph-facet-drawer--open {
  transform: translateX(0);
}

/* ===== Header ===== */
.ph-facet-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 30px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.ph-facet-drawer__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #222;
}
.ph-facet-drawer__close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #222;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-facet-drawer__close:hover {
  color: #666;
}

/* ===== Scrollable body ===== */
.ph-facet-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 30px 30px;
}

/* ===== Accordion sections ===== */
.ph-facet-section {
  border-bottom: 1px solid #e5e5e5;
}
.ph-facet-section__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #222;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
}
.ph-facet-section__title::after {
  content: '';
  width: 12px;
  height: 12px;
  border-right: 2px solid #888;
  border-bottom: 2px solid #888;
  transform: rotate(45deg);
  transition: transform 0.25s;
  flex-shrink: 0;
  margin-left: 12px;
}
.ph-facet-section__title[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

/* Override theme's facet title styles inside drawer */
.ph-facet-drawer .block-facets .facet-block-title::after {
  display: none;
}
.ph-facet-drawer .block-facets .facet-block-title {
  padding-left: 0;
}

/* ===== Section content ===== */
.ph-facet-section__content {
  padding: 0 0 18px;
}

/* ===== Checkbox items inside drawer ===== */
.ph-facet-drawer .facets-widget-checkbox ul {
  margin: 0;
  padding: 0;
}
.ph-facet-drawer .facets-widget-checkbox li {
  list-style: none;
  margin-bottom: 4px;
}
.ph-facet-drawer .facets-widget-checkbox [type="checkbox"] + label {
  font-size: 14px;
  font-weight: 400;
  color: #333;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
  .ph-facet-drawer {
    width: 100%;
  }
}
