/* ============================================================
   Product Filter Ajax Pro — Frontend Styles
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --pfap-primary:       #6366f1;
  --pfap-primary-dark:  #4f46e5;
  --pfap-primary-light: #ede9fe;
  --pfap-accent:        #f59e0b;
  --pfap-success:       #22c55e;
  --pfap-danger:        #ef4444;
  --pfap-bg:            #f8fafc;
  --pfap-card:          #ffffff;
  --pfap-border:        #e2e8f0;
  --pfap-border-hover:  #c7d2fe;
  --pfap-text:          #1e293b;
  --pfap-text-light:    #64748b;
  --pfap-radius:        12px;
  --pfap-radius-sm:     8px;
  --pfap-shadow:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --pfap-shadow-md:     0 4px 20px rgba(0,0,0,.10);
  --pfap-shadow-card:   0 2px 12px rgba(99,102,241,.08);
  --pfap-transition:    all .22s cubic-bezier(.4,0,.2,1);
}

/* ── Skin: Modern — Bo tròn mạnh, đổ bóng rõ ────────────────── */
.pfap-skin-modern {
  --pfap-radius:      24px;
  --pfap-radius-sm:   14px;
  --pfap-shadow:      0 4px 16px rgba(0,0,0,.10);
  --pfap-shadow-md:   0 8px 28px rgba(0,0,0,.14);
  --pfap-shadow-card: 0 4px 20px rgba(0,0,0,.12);
}

/* ── Skin: Minimal — Phẳng, góc vuông, viền mỏng ───────────── */
.pfap-skin-minimal {
  --pfap-radius:      2px;
  --pfap-radius-sm:   2px;
  --pfap-shadow:      none;
  --pfap-shadow-md:   0 1px 4px rgba(0,0,0,.08);
  --pfap-shadow-card: 0 1px 4px rgba(0,0,0,.06);
  --pfap-border:      #d0d5dd;
}

/* ── Layout ────────────────────────────────────────────────── */

/* Reset theme global styles that bleed into the plugin (e.g. Flatsome) */
.pfap-wrapper *::before,
.pfap-wrapper *::after {
  border-left: none !important;
  border-right: none !important;
}
.pfap-wrapper ul,
.pfap-wrapper ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pfap-wrapper li {
  border: none;
  background-image: none;
}
.pfap-wrapper li::before,
.pfap-wrapper li::after {
  display: none !important;
  content: none !important;
  border: none !important;
}

.pfap-wrapper {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  width: 100%;
}

.pfap-wrapper--top {
  flex-direction: column;
}

.pfap-wrapper--top .pfap-filter-panel {
  width: 100%;
}

.pfap-wrapper--top .pfap-filter-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.pfap-wrapper--top .pfap-filter-section {
  flex: 0 0 auto;
  min-width: 180px;
}

/* ── Filter Panel ──────────────────────────────────────────── */
.pfap-filter-panel {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
}

.pfap-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  background: var(--pfap-primary);
  color: #fff;
  border-radius: var(--pfap-radius) var(--pfap-radius) 0 0;
}

.pfap-filter-header__title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pfap-filter-header__title svg { opacity: .9; }

/* ── Panel search (inside sidebar) ────────────────────────── */
.pfap-panel-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--pfap-border);
}

.pfap-panel-search__wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pfap-panel-search__wrap input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--pfap-border);
  border-radius: var(--pfap-radius-sm);
  font-size: 13px;
  color: var(--pfap-text);
  background: var(--pfap-bg);
  transition: border-color .15s;
  box-sizing: border-box;
}

.pfap-panel-search__wrap input:focus {
  outline: none;
  border-color: var(--pfap-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}



.pfap-filter-reset {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--pfap-transition);
  white-space: nowrap;
}

.pfap-filter-reset:hover { background: rgba(255,255,255,.3); }

.pfap-filter-inner {
  background: var(--pfap-card);
  border: 1px solid var(--pfap-border);
  border-top: none;
  border-radius: 0 0 var(--pfap-radius) var(--pfap-radius);
  box-shadow: var(--pfap-shadow-md);
}

/* ── Filter Section ────────────────────────────────────────── */
.pfap-filter-section {
  border-bottom: 1px solid var(--pfap-border);
}

.pfap-filter-section:last-child { border-bottom: none; }

.pfap-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background .15s;
}

.pfap-section-header:hover { background: var(--pfap-bg); }

.pfap-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--pfap-text);
}

.pfap-section-chevron {
  color: var(--pfap-text-light);
  transition: transform .2s;
}

.pfap-filter-section.collapsed .pfap-section-chevron {
  transform: rotate(-90deg);
}

.pfap-section-body {
  padding: 4px 20px 16px;
  overflow: hidden;
  transition: var(--pfap-transition);
}

.pfap-filter-section.collapsed .pfap-section-body {
  display: none;
}

/* ── Search box inside filter ──────────────────────────────── */
.pfap-filter-search {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--pfap-border);
  border-radius: var(--pfap-radius-sm);
  font-size: 13px;
  color: var(--pfap-text);
  transition: border-color .15s;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.pfap-filter-search:focus {
  outline: none;
  border-color: var(--pfap-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* ── Checkbox List ─────────────────────────────────────────── */
.pfap-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Reset theme global list styles */
.pfap-check-list li,
.pfap-check-list li::before,
.pfap-check-list li::after {
  border: none;
  background: none;
  content: none;
  padding-left: 0;
  margin-left: 0;
}

.pfap-check-list::-webkit-scrollbar { width: 4px; }
.pfap-check-list::-webkit-scrollbar-track { background: transparent; }
.pfap-check-list::-webkit-scrollbar-thumb { background: var(--pfap-border); border-radius: 4px; }

.pfap-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: var(--pfap-radius-sm);
  cursor: pointer;
  transition: background .12s;
  font-size: 13px;
  color: var(--pfap-text);
}

.pfap-check-item:hover { background: var(--pfap-bg); }

.pfap-check-item input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--pfap-border);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--pfap-transition);
  position: relative;
  top: 0;
}

.pfap-check-item input[type="checkbox"]:checked {
  background: var(--pfap-primary);
  border-color: var(--pfap-primary);
}

.pfap-check-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 6px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  display: block;
}

.pfap-check-label { flex: 1; line-height: 1.4; }
.pfap-check-count {
  font-size: 11px;
  color: var(--pfap-text-light);
  background: var(--pfap-bg);
  padding: 2px 6px;
  border-radius: 10px;
}

/* Nested subcategories */
.pfap-check-nested {
  padding-left: 20px;
  margin-left: 8px;
}

.pfap-show-more {
  background: none;
  border: none;
  color: var(--pfap-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
  transition: color .15s;
}

.pfap-show-more:hover { color: var(--pfap-primary-dark); }

/* ── Price Range Slider ────────────────────────────────────── */
.pfap-price-range {
  padding: 4px 0 2px;
}

/* Formatted price badge above slider */
.pfap-price-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--pfap-primary);
}

.pfap-price-dash {
  font-weight: 400;
  color: var(--pfap-text-light);
  font-size: 13px;
}

/* Inputs row below slider */
.pfap-price-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.pfap-price-sep {
  color: var(--pfap-text-light);
  flex-shrink: 0;
  font-size: 13px;
}

.pfap-price-field {
  flex: 1;
  position: relative;
}

.pfap-price-field input {
  width: 100%;
  padding: 7px 22px 7px 9px;
  border: 1.5px solid var(--pfap-border);
  border-radius: var(--pfap-radius-sm);
  font-size: 12px;
  color: var(--pfap-text);
  box-sizing: border-box;
  transition: border-color .15s;
  text-align: center;
}

.pfap-price-field input:focus {
  outline: none;
  border-color: var(--pfap-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.pfap-price-unit {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--pfap-text-light);
  pointer-events: none;
}

.pfap-slider-wrapper {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

.pfap-range-slider {
  position: absolute;
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  top: 50%;
  transform: translateY(-50%);
}

.pfap-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pfap-primary);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--pfap-primary), 0 2px 6px rgba(99,102,241,.35);
  cursor: pointer;
  pointer-events: all;
  transition: transform .15s;
}

.pfap-range-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.pfap-range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pfap-primary);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--pfap-primary);
  cursor: pointer;
  pointer-events: all;
}

.pfap-range-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  width: 100%;
  background: var(--pfap-border);
  border-radius: 4px;
  z-index: 0;
}

.pfap-range-fill {
  position: absolute;
  height: 100%;
  background: var(--pfap-primary);
  border-radius: 4px;
}

/* ── Rating Filter ─────────────────────────────────────────── */
.pfap-rating-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pfap-rating-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .12s;
}

.pfap-rating-item:hover { background: var(--pfap-bg); }

.pfap-rating-item input[type="radio"] { display: none; }

.pfap-rating-stars { display: flex; gap: 2px; }

.pfap-rating-star {
  font-size: 16px;
  color: #d1d5db;
  line-height: 1;
}

.pfap-rating-star.on { color: #f59e0b; }

.pfap-rating-item.active .pfap-rating-star.on,
.pfap-rating-item input:checked ~ .pfap-rating-stars .pfap-rating-star.on { color: #f59e0b; }

.pfap-rating-label {
  font-size: 12px;
  color: var(--pfap-text-light);
}

/* ── Toggle pills (on sale / in stock) ─────────────────────── */
.pfap-toggle-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pfap-pill-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1.5px solid var(--pfap-border);
  border-radius: var(--pfap-radius-sm);
  cursor: pointer;
  transition: var(--pfap-transition);
  font-size: 13px;
  color: var(--pfap-text);
  font-weight: 500;
}

.pfap-pill-toggle:hover { border-color: var(--pfap-border-hover); background: var(--pfap-bg); }

.pfap-pill-toggle input { display: none; }

.pfap-pill-toggle__switch {
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 10px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}

.pfap-pill-toggle__switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.pfap-pill-toggle.active {
  border-color: var(--pfap-primary);
  background: var(--pfap-primary-light);
}

.pfap-pill-toggle.active .pfap-pill-toggle__switch { background: var(--pfap-primary); }
.pfap-pill-toggle.active .pfap-pill-toggle__switch::after { transform: translateX(16px); }

/* ── Color swatches ────────────────────────────────────────── */
.pfap-swatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pfap-swatch-item label {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  position: relative;
}

.pfap-swatch-item label:hover { transform: scale(1.15); }

.pfap-swatch-item input { display: none; }

.pfap-swatch-item input:checked + label {
  box-shadow: 0 0 0 3px var(--pfap-primary);
}

/* ── Main Content ──────────────────────────────────────────── */
.pfap-main-content { flex: 1; min-width: 0; }


/* Drawer toggle button */
.pfap-filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--pfap-primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--pfap-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.pfap-filter-toggle-btn:hover { background: var(--pfap-primary-dark); }


/* ── Product Grid ──────────────────────────────────────────── */
.pfap-products {
  display: grid;
  gap: 20px;
}

.pfap-cols-2 { grid-template-columns: repeat(2, 1fr); }
.pfap-cols-3 { grid-template-columns: repeat(3, 1fr); }
.pfap-cols-4 { grid-template-columns: repeat(4, 1fr); }
.pfap-cols-5 { grid-template-columns: repeat(5, 1fr); }


/* Reset theme pseudo-elements that bleed into product cards (e.g. Flatsome vertical lines) */
.pfap-products *::before,
.pfap-products *::after {
  display: none !important;
  content: none !important;
  border: none !important;
  box-shadow: none !important;
  background: none !important;
  background-image: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Kill Flatsome generic div rules (border, outline, box-shadow on any div inside results area) */
.pfap-results-area div,
.pfap-products-wrap div {
  border-left: none !important;
  border-right: none !important;
  outline: none !important;
}

.pfap-results-area div::before,
.pfap-results-area div::after,
.pfap-products-wrap div::before,
.pfap-products-wrap div::after {
  display: none !important;
  content: none !important;
  border: none !important;
  box-shadow: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
  position: static !important;
}

/* Restore needed pseudo-elements */
.pfap-loading-overlay::after {
  display: block !important;
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  background: rgba(255,255,255,.8) !important;
}

/* Restore card border & shadow */
.pfap-product-card {
  border: 1px solid var(--pfap-border) !important;
  box-shadow: var(--pfap-shadow) !important;
}

.pfap-product-card:hover {
  border-color: var(--pfap-border-hover) !important;
  box-shadow: var(--pfap-shadow-card) !important;
}

/* ── Product Card ──────────────────────────────────────────── */
.pfap-product-card {
  background: var(--pfap-card);
  border: 1px solid var(--pfap-border);
  border-radius: var(--pfap-radius);
  overflow: hidden;
  box-shadow: var(--pfap-shadow);
  transition: var(--pfap-transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.pfap-product-card:hover {
  box-shadow: var(--pfap-shadow-card);
  border-color: var(--pfap-border-hover);
  transform: translateY(-3px);
}

.pfap-product-card__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--pfap-bg);
}

.pfap-product-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  display: block;
}

.pfap-product-card:hover .pfap-product-card__thumb img {
  transform: scale(1.06);
}

/* Badges */
.pfap-product-card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pfap-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pfap-badge--sale { background: #fef2f2; color: #dc2626; }
.pfap-badge--outofstock { background: #f1f5f9; color: #64748b; }

/* Hover actions */
.pfap-product-card__actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transition: opacity .2s;
}

.pfap-product-card:hover .pfap-product-card__actions { opacity: 1; }

.pfap-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #fff;
  border-radius: var(--pfap-radius-sm);
  color: var(--pfap-text-light);
  text-decoration: none;
  box-shadow: var(--pfap-shadow-md);
  transition: var(--pfap-transition);
}

.pfap-action-btn:hover { background: var(--pfap-primary); color: #fff; transform: scale(1.1); }

/* Body */
.pfap-product-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pfap-product-card__cat {
  font-size: 11px;
  color: var(--pfap-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
}

.pfap-product-card__title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pfap-product-card__title a {
  color: var(--pfap-text);
  text-decoration: none;
  transition: color .15s;
}

.pfap-product-card__title a:hover { color: var(--pfap-primary); }

.pfap-product-card__rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.pfap-stars { display: flex; gap: 2px; }

.pfap-star { font-size: 14px; line-height: 1; }
.pfap-star--full  { color: #f59e0b; }
.pfap-star--half  { color: #f59e0b; opacity: .6; }
.pfap-star--empty { color: #d1d5db; }

.pfap-product-card__review-count {
  font-size: 12px;
  color: var(--pfap-text-light);
}

.pfap-product-card__price {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--pfap-primary);
  margin-top: auto;
}

.pfap-product-card__price del {
  font-size: 13px;
  color: var(--pfap-text-light);
  font-weight: 400;
  margin-right: 4px;
}

.pfap-product-card__price ins {
  text-decoration: none;
  color: var(--pfap-danger);
}

.pfap-product-card__footer { display: flex; }

/* Add to cart button */
.pfap-btn-cart {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--pfap-primary);
  color: #fff;
  border: none;
  border-radius: var(--pfap-radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--pfap-transition);
  text-decoration: none;
  text-align: center;
}

.pfap-btn-cart:hover { background: var(--pfap-primary-dark); transform: translateY(-1px); }
.pfap-btn-cart:active { transform: translateY(0); }

.pfap-btn-cart--details {
  background: transparent;
  color: var(--pfap-primary);
  border: 1.5px solid var(--pfap-primary);
}

.pfap-btn-cart--details:hover { background: var(--pfap-primary); color: #fff; }

.pfap-btn-cart.pfap-loading {
  opacity: .7;
  pointer-events: none;
}

.pfap-btn-cart.pfap-added {
  background: var(--pfap-success);
}

/* ── Add to cart toast ─────────────────────────────────────── */
.pfap-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--pfap-shadow-md);
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
}

.pfap-toast.pfap-toast--show {
  transform: translateY(0);
  opacity: 1;
}

.pfap-toast--success { border-left: 4px solid var(--pfap-success); }
.pfap-toast--error   { border-left: 4px solid var(--pfap-danger); }



/* ── Loading overlay ───────────────────────────────────────── */
.pfap-loading-overlay {
  position: relative;
  min-height: 200px;
}

.pfap-loading-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.8);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 10;
  border-radius: var(--pfap-radius);
}

.pfap-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  width: 40px;
  height: 40px;
  border: 3px solid var(--pfap-primary-light);
  border-top-color: var(--pfap-primary);
  border-radius: 50%;
  animation: pfap-spin .7s linear infinite;
}

@keyframes pfap-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* ── Pagination ────────────────────────────────────────────── */
.pfap-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.pfap-page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 1.5px solid var(--pfap-border);
  border-radius: var(--pfap-radius-sm);
  background: var(--pfap-card);
  color: var(--pfap-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--pfap-transition);
}

.pfap-page-btn:hover:not(.pfap-page-btn--active) {
  border-color: var(--pfap-primary);
  color: var(--pfap-primary);
  background: var(--pfap-primary-light);
}

.pfap-page-btn--active {
  background: var(--pfap-primary);
  color: #fff;
  border-color: var(--pfap-primary);
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

.pfap-page-prev,
.pfap-page-next { font-size: 18px; }

.pfap-page-dots { color: var(--pfap-text-light); line-height: 38px; }

/* ── Drawer mode ───────────────────────────────────────────── */
.pfap-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9998;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}

.pfap-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.pfap-drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--pfap-card);
  z-index: 9999;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--pfap-shadow-md);
}

.pfap-drawer.open { transform: translateX(0); }

.pfap-drawer-close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 16px;
}

.pfap-drawer-close-btn {
  background: none;
  border: 1.5px solid var(--pfap-border);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--pfap-text-light);
  transition: var(--pfap-transition);
}

.pfap-drawer-close-btn:hover { border-color: var(--pfap-primary); color: var(--pfap-primary); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pfap-cols-4 { grid-template-columns: repeat(3, 1fr); }
  .pfap-cols-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .pfap-wrapper {
    flex-direction: column;
  }

  .pfap-filter-panel {
    width: 100%;
    position: static;
    display: none;
  }

  .pfap-filter-panel.open { display: block; }

  .pfap-filter-toggle-btn { display: inline-flex; }

  .pfap-cols-3,
  .pfap-cols-4,
  .pfap-cols-5 { grid-template-columns: repeat(2, 1fr); }

  .pfap-toolbar { flex-direction: column; align-items: flex-start; }
  .pfap-toolbar-right { width: 100%; }
}

@media (max-width: 480px) {
  .pfap-cols-2,
  .pfap-cols-3,
  .pfap-cols-4,
  .pfap-cols-5 { grid-template-columns: 1fr; }
}
