/**
 * wcaf.css — WC Ajax Filter v2
 */

:root {
  --wcaf-accent: #1c89cb;
  --wcaf-accent-hover: #0c1e3c;
  --wcaf-text: #1e293b;
  --wcaf-text-muted: #64748b;
  --wcaf-border: #e2e8f0;
  --wcaf-bg: #f8fafc;
  --wcaf-radius: 6px;
  --wcaf-sidebar-width: 260px;
  --wcaf-gap: 24px;
  --wcaf-transition: 0.2s ease;
}

/* ── Outer shell ──────────────────────────────────────────────────────────── */

.wcaf-shop {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Active filters bar (above the layout row) ───────────────────────────── */

.wcaf-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--wcaf-bg);
  border: 1px solid var(--wcaf-border);
  border-radius: var(--wcaf-radius);
  margin-right: 16px;
}

.wcaf-active-filters__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--wcaf-text-muted);
  white-space: nowrap;
}

.wcaf-active-filters__list {
  display: contents;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wcaf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--wcaf-border);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 0.8rem;
  color: var(--wcaf-text);
}

.wcaf-chip button {
  width: 16px;
  height: 16px;
  line-height: 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 5px !important;
  border: none;
  color: var(--wcaf-text-muted);
  margin-left: 2px;
  font-size: 1rem;
}

.wcaf-chip__remove:hover {
  color: #ef4444;
}

/* ── Two-column layout row ───────────────────────────────────────────────── */

.wcaf-layout {
  display: flex;
  gap: var(--wcaf-gap);
  align-items: flex-start;
}

/* ── Filter sidebar ──────────────────────────────────────────────────────── */

.wcaf-filter-sidebar {
  width: var(--wcaf-sidebar-width);
  border: 1px solid #eef0f4;
  border-radius: 12px;
  overflow: hidden;
}
.wcaf-filter-sidebar-title {
  background: #0c1e3c;
  padding: 14px 18px;
  font-family: "Space Mono", Sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0px;
}
.wcaf-filter-section {
  border-bottom: 1px solid var(--wcaf-border);
  padding: 0;
}

.wcaf-filter-section:last-of-type {
  border-bottom: none;
}

.wcaf-filter-section__title {
  width: 100%;
  padding: 10px 15px;
  margin: 0;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "DM Sans", sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #0c1e3c !important;
  transition: background 0.15s;
}
.wcaf-filter-section_sort {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: row;
  gap: 5px;
}
.wcaf-filter-section__title_sort {
  font-family: "Space Mono", monospace !important;
  font-size: 11px !important;
  color: #6b7280 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}
/* ── Checklist ───────────────────────────────────────────────────────────── */

.wcaf-checklist {
  padding: 15px;
  background: #f8f9fb;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wcaf-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  user-select: none;
}

.wcaf-radio-label:hover .wcaf-radio-label__text {
  color: var(--wcaf-accent);
}

.wcaf-radio {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid var(--wcaf-border);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  transition:
    background var(--wcaf-transition),
    border-color var(--wcaf-transition);
  position: relative;
}

.wcaf-radio checked {
  background: var(--wcaf-accent);
  border-color: var(--wcaf-accent);
}

.wcaf-radio checked::after {
  content: "";
  position: absolute;
  inset: 2px 2px 3px 4px;
  border: 2px solid #fff;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
}

.wcaf-radio-label__count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--wcaf-text-muted);
}

/* ── Select ──────────────────────────────────────────────────────────────── */

.wcaf-select {
  width: 150px;
  padding: 6px 30px 6px 10px;
  border: 1px solid var(--wcaf-border);
  border-radius: var(--wcaf-radius);
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  font-size: 0.9rem;
  color: var(--wcaf-text);
  cursor: pointer;
  appearance: none;
}

.wcaf-select:focus {
  outline: 2px solid var(--wcaf-accent);
  outline-offset: 1px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.wcaf-btn--ghost {
  background: transparent !important;
  color: var(--wcaf-text-muted) !important;
  padding: 4px 10px !important;
  font-size: 0.8rem !important;
  border: none !important;
}

.wcaf-btn--ghost:hover {
  color: var(--wcaf-text) !important;
  border-color: var(--wcaf-text-muted) !important;
}
.wcaf-btn--contact-con {
  padding: 0px 16px 16px;
  text-align: center;
}
.wcaf-btn--contact {
  width: 100%;
  padding: 9px;
  border: 1.5px solid #0c1e3c;
  border-radius: 6px;
  background: transparent;
  color: #0c1e3c !important;
  font-family: "Space Mono", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  display: block;
}

.wcaf-btn--contact:hover {
  background: #0c1e3c;
  color: #fff !important;
}

/* ── Product grid ────────────────────────────────────────────────────────── */

.wcaf-product-filter-con {
  display: grid;
  grid-template-columns: 1fr auto;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.wcaf-products-wrapper {
  flex: 1;
  min-width: 0;
}

.wcaf-grid {
  display: grid;
  grid-template-columns: repeat(var(--wcaf-columns, 3), 1fr);
  gap: 24px;
  transition: opacity var(--wcaf-transition);
}

.wcaf-products-wrapper[data-columns="2"] .wcaf-grid {
  --wcaf-columns: 2;
}
.wcaf-products-wrapper[data-columns="3"] .wcaf-grid {
  --wcaf-columns: 3;
}
.wcaf-products-wrapper[data-columns="4"] .wcaf-grid {
  --wcaf-columns: 4;
}

.wcaf-grid--loading {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Product card ────────────────────────────────────────────────────────── */

.wcaf-product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--wcaf-border);
  border-radius: var(--wcaf-radius);
  overflow: hidden;
  background: #fff;
  transition:
    box-shadow var(--wcaf-transition),
    transform var(--wcaf-transition);
}

.wcaf-product-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
  border-color: #1c89cb;
}
.wcaf-product-card__body img {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 4;
  background: var(--wcaf-bg);
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}

.wcaf-product-card:hover .wcaf-product-card__body img {
  transform: scale(1.04);
}

.wcaf-product-card__title {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #0c1e3c !important;
  line-height: 1.35;
  margin-bottom: 10px !important;
  font-family: "DM Sans", sans-serif !important;
  padding: 8px 16px;
}
.wcaf-product-card__title:hover {
  color: var(--wcaf-accent) !important;
}
.wcaf-product-card__price {
  display: block;
  font-family: "Space Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--wcaf-accent);
  padding: 0 16px 16px;
}

.wcaf-product-card__price .woocommerce-Price-amount {
  color: inherit;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */

.wcaf-pagination {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.wcaf-pagination ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.wcaf-pagination a,
.wcaf-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border: 1px solid var(--wcaf-border);
  border-radius: var(--wcaf-radius);
  font-size: 0.875rem;
  color: var(--wcaf-text);
  text-decoration: none;
  transition:
    background var(--wcaf-transition),
    border-color var(--wcaf-transition);
}

.wcaf-pagination a:hover {
  background: var(--wcaf-bg);
  border-color: var(--wcaf-accent);
  color: var(--wcaf-accent);
}

.wcaf-pagination .current {
  background: var(--wcaf-accent);
  border-color: var(--wcaf-accent);
  color: #fff;
}

/* ── No results / error ──────────────────────────────────────────────────── */

.wcaf-no-results,
.wcaf-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--wcaf-text-muted);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .wcaf-layout {
    flex-direction: column;
  }

  .wcaf-filter-sidebar {
    width: 100%;
    flex: none;
    position: static;
    max-height: none;
  }

  .wcaf-grid {
    --wcaf-columns: 2 !important;
  }
}

@media (max-width: 480px) {
  .wcaf-grid {
    --wcaf-columns: 1 !important;
  }
}

/* ── Radio button overrides ──────────────────────────────────────────────── */

.wcaf-radio {
  border-radius: 50% !important; /* circle instead of square */
}

.wcaf-radio:checked::after {
  content: "" !important;
  position: absolute !important;
  inset: 3px !important; /* inner filled dot */
  background: #fff !important;
  border: none !important;
  border-radius: 50% !important;
  transform: none !important;
}

/* ── Radio buttons ───────────────────────────────────────────────────────── */

.wcaf-radio {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid var(--wcaf-border);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--wcaf-transition);
  position: relative;
}

.wcaf-radio:checked {
  border-color: var(--wcaf-accent);
}

.wcaf-radio:checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--wcaf-accent);
}

.wcaf-radio-label__count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--wcaf-text-muted);
}

/* ── Accordion filter sections ───────────────────────────────────────────── */

.wcaf-accordion__toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  background: none !important;
  border: none !important;
  padding: 12px 10px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #0c1e3c !important;
  background: #fff !important;
}

.wcaf-accordion__toggle:hover {
  color: var(--wcaf-accent, #2563eb);
}

.wcaf-accordion__icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.wcaf-accordion.is-open .wcaf-accordion__icon {
  transform: rotate(180deg);
}
