/* =============================================================================
   Product Filter – WooCommerce AJAX grid with filter panel + tags
   ============================================================================= */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.pf {
  position: relative;
  width: 100%;
  font-family: inherit;
}

/* ── Header row (Bo loc btn + count + sort) ────────────────────────────── */
.pf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pf-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-header__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.pf-topbar__label {
  color: #4A5565;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: #4A5565;
  white-space: nowrap;
}

/* Bộ lọc toggle button */
.pf-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 12px 27px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: #fff;
  color: #0A0A0A;
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
}

.pf-topbar__count {
  font-size: 18px;
  line-height: 20px;
  font-weight: 500;
  color: #0A0A0A;
  white-space: nowrap;
  text-align: right;
  margin-bottom: 25px;
}

.pf-sort {
  padding: 0 32px 0 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  -webkit-appearance: none;
  appearance: none;
  font-size: 14px;
  color: #0A0A0A;
  cursor: pointer;
  min-width: 160px;
  margin-bottom: 0;
  transition: border-color 0.2s ease;
}

.pf-sort:focus {
  outline: 2px solid #f5d000;
  outline-offset: 1px;
  border-color: #f5d000;
}

/* ── Selected filter tags ─────────────────────────────────────────────────── */
.pf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pf-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 6px 14px;
  background: #f5d000;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  animation: pf-tag-in 0.2s ease;
}

@keyframes pf-tag-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.pf-tag__label {
  white-space: nowrap;
}

.pf-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 22px;
  border: none;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: #111;
  cursor: pointer;
  transition: background 0.15s ease;
  padding: 0;
  margin: 0;
  min-height: unset;
}

.pf-tag__remove:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ── Filter panel ─────────────────────────────────────────────────────────── */
.pf-panel {
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  z-index: 9;
  background: #fff;
  border: 1.5px solid #eee;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.pf-panel__section {
  margin-bottom: 24px;
}

.pf-panel__section:last-child {
  margin-bottom: 0;
}

.pf-panel__title {
  margin: 0 0 32px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  color: rgba(16, 24, 40, 1);
}

/* Option pill buttons */
.pf-panel__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pf-panel__opt {
  display: inline-flex;
  align-items: center;
  padding: 10px 31px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: #fff;
  color: #434343;
  font-size: 16px;
  line-height: 20px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
}

.pf-panel__opt--active {
  border-color: #f5d000;
  background: #f5d000;
  color: #111;
  font-weight: 700;
}

.pf-panel__opt--hidden {
  display: none;
}

/* Show-more link */
.pf-panel__show-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  background: none;
  border: none;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.pf-panel__show-more:hover {
  color: #111;
}

/* Price range slider */
.pf-price-range {
  padding: 4px 0;
}

.pf-price-range__label {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #364153;
}

.pf-price-range__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: #FFFF00;
  outline: none;
  cursor: pointer;
}

.pf-price-range__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFF00;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.pf-price-range__slider::-webkit-slider-thumb:hover {
  box-shadow: 0 1px 10px rgba(0,0,0,0.3);
}

.pf-price-range__slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f5d000;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

.pf-price-range__minmax {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 400;
  color: #6A7282;
}

/* Panel footer */
.pf-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.pf-panel__clear {
  background: none;
  border: none;
  color: #364153;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.pf-panel__clear:hover {
  color: #333;
}

.pf-panel__apply {
  padding: 11px 51px;
  background: #FFFF00;
  border: none;
  border-radius: 10px;
  color: #434343;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Loading overlay ─────────────────────────────────────────────────────── */
.pf-loading {
  display: none;
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.72);
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.pf.pf--loading .pf-loading {
  display: flex;
}

.pf-loading__spinner {
  width: 42px;
  height: 42px;
  border: 3px solid #e8e8e8;
  border-top-color: #f5d000;
  border-radius: 50%;
  animation: pf-spin 0.7s linear infinite;
}

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

.pf.pf--loading .pf-grid {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Product grid ─────────────────────────────────────────────────────────── */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  transition: opacity 0.2s ease;
}

@media (min-width: 480px) {
  .pf-grid.col-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pf-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: #aaa;
  font-size: 14px;
}

/* ── Product card ──────────────────────────────────────────────────────────── */
.pf-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.pf-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
  transform: translateY(-3px);
}

.pf-card__img-link {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
}

.pf-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #efefef;
}

.pf-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.pf-card:hover .pf-card__img {
  transform: scale(1.06);
}

.pf-card__img--placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e8e8 0%, #d8d8d8 100%);
}

.pf-card__cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.pf-card__labels {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  max-width: calc(100% - 20px);
}

.pf-card__label {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

.pf-card__label--discount {
  background: rgba(255, 59, 48, 0.1);
  color: #d63031;
  border: 1px solid rgba(214, 48, 49, 0.2);
}

.pf-card__label--sale {
  background: rgba(255, 59, 48, 0.85);
  color: #fff;
}

.pf-card__label--hot {
  background: rgba(255, 149, 0, 0.9);
  color: #fff;
}

.pf-card__body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.pf-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pf-card__title a {
  color: inherit;
  text-decoration: none;
}

.pf-card__title a:hover {
  color: #0073aa;
}

.pf-card__desc {
  margin: 0;
  font-size: 12px;
  color: #777;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pf-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
}

.pf-rating__stars {
  display: flex;
  gap: 1px;
  font-size: 13px;
  line-height: 1;
}

.pf-star--full  { color: #f5a623; }
.pf-star--half  { color: #f5a623; opacity: 0.5; }
.pf-star--empty { color: #d8d8d8; }

.pf-rating__count {
  font-size: 12px;
  color: #aaa;
}

.pf-card__price { font-size: 15px; font-weight: 700; color: #1a1a1a; }
.pf-card__price .price { font-size: 15px; font-weight: 700; color: #1a1a1a; }
.pf-card__price .price del,
.pf-card__price .price del .woocommerce-Price-amount {
  color: #bbb;
  font-size: 12px;
  font-weight: 400;
  margin-right: 2px;
}
.pf-card__price .price ins { text-decoration: none; color: #d63031; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pf-pagination-wrap { margin-top: 36px; }

.pf-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pf-pagination__nav {
  padding: 8px 22px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #444;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pf-pagination__nav:hover:not(:disabled) {
  background: #f5d000;
  border-color: #f5d000;
  color: #111;
}

.pf-pagination__nav:disabled { opacity: 0.35; cursor: default; }

.pf-pagination__numbers {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.pf-pagination__page {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #444;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pf-pagination__page:hover { background: #fafafa; border-color: #bbb; }

.pf-pagination__page--active {
  background: #f5d000;
  border-color: #f5d000;
  color: #111;
  font-weight: 700;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .pf-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .pf-header { flex-direction: column; align-items: flex-start; }
  .pf-header__right { width: 100%; justify-content: space-between; }
  .pf-sort { min-width: 140px; }
  .pf-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pf-panel { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-panel__options { gap: 6px; }
}
