/* ==========================================================
   PJF Shop V2 — v2.0
   ========================================================== */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,400;1,500&family=Manrope:wght@400;500;600;700&display=swap");

/* ——————————————————————————————————
   TOKENS
—————————————————————————————————— */
.pjf-v2 {
  --pjf-green-900: #1f3527;
  --pjf-green-800: #2c4a2e;
  --pjf-green-700: #3d5e3f;
  --pjf-green-100: #dce5d3;
  --pjf-green-50: #eef2e8;
  --pjf-cream-50: #fbf8f0;
  --pjf-cream-100: #f6f2e8;
  --pjf-cream-200: #ede6d4;
  --pjf-terra-700: #a05a28;
  --pjf-terra-600: #c97b3a;
  --pjf-terra-500: #d89561;
  --pjf-ink: #1b1d17;
  --pjf-ink-soft: #4a4f44;
  --pjf-ink-mute: #7a7e73;
  --pjf-line: #d9d4c3;
  --pjf-line-soft: #eae5d5;
  --pjf-font-display: "Cormorant Garamond", Georgia, serif;
  --pjf-font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --pjf-radius-sm: 4px;
  --pjf-radius-md: 8px;
  --pjf-radius-lg: 16px;
  --pjf-radius-pill: 999px;
  --pjf-shadow-sm: 0 2px 8px rgba(31, 53, 39, 0.06);
  --pjf-shadow-md: 0 6px 20px rgba(31, 53, 39, 0.08);
  --pjf-shadow-lg: 0 16px 40px rgba(31, 53, 39, 0.12);
}

/* ——————————————————————————————————
   RESET LOCAL
—————————————————————————————————— */
.pjf-v2,
.pjf-v2 * {
  box-sizing: border-box;
}
.pjf-v2 {
  font-family: var(--pjf-font-body);
  font-size: 16px;
  color: var(--pjf-ink);
  background: var(--pjf-cream-100);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0; /* pas de padding sur le wrapper — laissé au thème */
}
.pjf-v2 a {
  color: inherit;
}
.pjf-v2 button {
  font-family: var(--pjf-font-body);
}
.pjf-v2 p,
.pjf-v2 ul,
.pjf-v2 ol {
  margin: 0;
  padding: 0;
}
.pjf-v2 ul {
  list-style: none;
}
.pjf-v2-hidden {
  display: none !important;
}

/* ——————————————————————————————————
   LAYOUT
—————————————————————————————————— */
.pjf-v2-container {
  max-width: 1280px;
  margin: 0;
  padding: 0;
}
.pjf-v2-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  align-items: start;
}

/* ——————————————————————————————————
   SIDEBAR
—————————————————————————————————— */
.pjf-v2-sidebar {
  position: sticky;
  top: 48px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-bottom: 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--pjf-line) transparent;
}
.pjf-v2-sidebar::-webkit-scrollbar {
  width: 4px;
}
.pjf-v2-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.pjf-v2-sidebar::-webkit-scrollbar-thumb {
  background: var(--pjf-line);
  border-radius: 2px;
}
.pjf-v2-filters-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.pjf-v2-filters-title {
  font-family: var(--pjf-font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--pjf-green-900);
  line-height: 1;
}

/* "Tout effacer" */
.pjf-v2-clear-all {
  font-family: var(--pjf-font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--pjf-terra-600); /* terracotta, pas bleu */
  letter-spacing: 0.04em;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.15s;
}
.pjf-v2-clear-all:hover {
  color: var(--pjf-terra-700);
}

/* Active chips */
.pjf-v2-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 0;
}
.pjf-v2-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--pjf-radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--pjf-green-100);
  color: var(--pjf-green-900) !important; /* force vert, pas bleu hérité */
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: opacity 0.15s;
  font-family: var(--pjf-font-body);
}
.pjf-v2-chip:hover {
  opacity: 0.75;
}
.pjf-v2-chip span {
  font-size: 14px;
  line-height: 1;
}

/* Form */
#pjf-v2-form,
#pjf-v2-form-drawer {
  margin: 0;
}

/* Filter group */
.pjf-v2-filter-group {
  border-bottom: 1px solid var(--pjf-line-soft);
  padding: 18px 0;
}
.pjf-v2-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}
.pjf-v2-filter-head-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--pjf-green-900);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex: 1;
}
.pjf-v2-filter-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pjf-ink-mute);
  font-size: 20px;
  font-weight: 300;
  flex-shrink: 0;
  line-height: 1;
}

/* Filter body */
.pjf-v2-filter-body {
  margin-top: 14px;
}
.pjf-v2-filter-body.collapsed {
  display: none;
}

/* Custom checkbox */
.pjf-v2-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--pjf-ink);
  cursor: pointer;
  line-height: 1.3;
}
.pjf-v2-check-label:last-child {
  margin-bottom: 0;
}
.pjf-v2-check-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pjf-v2-check-box {
  width: 18px;
  height: 18px;
  border-radius: var(--pjf-radius-sm);
  border: 1.5px solid var(--pjf-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.pjf-v2-check-label input[type="checkbox"]:checked ~ .pjf-v2-check-box {
  background: var(--pjf-green-800);
  border-color: var(--pjf-green-800);
}
.pjf-v2-check-box svg {
  display: none;
}
.pjf-v2-check-label input[type="checkbox"]:checked ~ .pjf-v2-check-box svg {
  display: block;
}
.pjf-v2-check-label:hover .pjf-v2-check-box {
  border-color: var(--pjf-green-700);
}
.pjf-v2-check-name {
  flex: 1;
}
.pjf-v2-check-count {
  font-size: 12px;
  color: var(--pjf-ink-mute);
  flex-shrink: 0;
}

/* Submit button */
.pjf-v2-filter-submit {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 13px 24px;
  background: var(--pjf-green-800);
  color: #fff;
  border: none;
  border-radius: var(--pjf-radius-pill);
  font-family: var(--pjf-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}
.pjf-v2-filter-submit:hover {
  background: var(--pjf-green-900);
}
.pjf-v2-filter-submit:active {
  transform: scale(0.98);
}

/* ——————————————————————————————————
   PRICE SLIDER
—————————————————————————————————— */
.pjf-v2-price-slider-wrap {
  padding-top: 8px;
}

.pjf-v2-range-track {
  position: relative;
  height: 4px;
  background: var(--pjf-line);
  border-radius: 2px;
  margin: 14px 0;
}
.pjf-v2-range-fill {
  position: absolute;
  top: 0;
  height: 4px;
  background: var(--pjf-green-800);
  border-radius: 2px;
}

/* Les deux range inputs superposés */
.pjf-v2-range {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
  margin: 0;
}
.pjf-v2-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--pjf-green-800);
  cursor: pointer;
  pointer-events: all;
  box-shadow: var(--pjf-shadow-sm);
  transition:
    border-color 0.15s,
    transform 0.1s;
}
.pjf-v2-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--pjf-green-800);
  cursor: pointer;
  pointer-events: all;
  box-shadow: var(--pjf-shadow-sm);
}
.pjf-v2-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  border-color: var(--pjf-green-900);
}
.pjf-v2-range:focus::-webkit-slider-thumb {
  outline: 2px solid var(--pjf-green-300);
  outline-offset: 2px;
}

.pjf-v2-price-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--pjf-ink-soft);
  margin-top: 10px;
}
.pjf-v2-price-lo-val,
.pjf-v2-price-hi-val {
  font-weight: 600;
  color: var(--pjf-green-900);
}
.pjf-v2-price-sep {
  color: var(--pjf-ink-mute);
}

/* ——————————————————————————————————
   MOBILE BAR
—————————————————————————————————— */
.pjf-v2-mobile-bar {
  display: none;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.pjf-v2-mobile-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--pjf-green-800);
  color: #fff;
  border: none;
  border-radius: var(--pjf-radius-pill);
  font-family: var(--pjf-font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.pjf-v2-mobile-filter-btn:hover {
  background: var(--pjf-green-900);
}
.pjf-v2-filter-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pjf-terra-500);
  margin-left: 2px;
}

/* ——————————————————————————————————
   TOOLBAR
—————————————————————————————————— */
.pjf-v2-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--pjf-line-soft);
}
.pjf-v2-result-count {
  font-size: 14px;
  color: var(--pjf-ink-soft);
}
.pjf-v2-result-count strong {
  color: var(--pjf-green-900);
  font-weight: 600;
}

/* Sort select */
.pjf-v2-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--pjf-line);
  border-radius: var(--pjf-radius-md);
  background: #fff;
  cursor: pointer;
}
.pjf-v2-sort-label {
  font-size: 14px;
  color: var(--pjf-ink-soft);
  white-space: nowrap;
}
.pjf-v2-sort-select {
  font-family: var(--pjf-font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--pjf-green-900);
  border: none;
  background: transparent;
  outline: none;
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231F3527' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 18px;
}

/* ——————————————————————————————————
   LOADING
—————————————————————————————————— */
.pjf-v2-main {
  position: relative;
}

.pjf-v2-loading {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  background: rgba(246, 242, 232, 0.7);
  backdrop-filter: blur(2px);
  border-radius: var(--pjf-radius-md);
}
.pjf-v2-loading.active {
  display: flex;
}

.pjf-v2-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--pjf-green-100);
  border-top-color: var(--pjf-green-800);
  border-radius: 50%;
  animation: pjf-spin 0.7s linear infinite;
}
@keyframes pjf-spin {
  to {
    transform: rotate(360deg);
  }
}

.pjf-v2-results--loading {
  pointer-events: none;
  user-select: none;
}
.pjf-v2-results--loading .pjf-v2-grid {
  opacity: 0.45;
  transition: opacity 0.2s;
}

/* ——————————————————————————————————
   PRODUCT GRID
—————————————————————————————————— */
.pjf-v2-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  transition: opacity 0.2s;
}

/* ——————————————————————————————————
   PRODUCT CARD
—————————————————————————————————— */
.pjf-v2-card {
  background: #fff;
  border-radius: var(--pjf-radius-lg);
  overflow: hidden;
  border: 1px solid var(--pjf-line-soft);
  display: flex;
  flex-direction: column;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.pjf-v2-card:hover {
  box-shadow: var(--pjf-shadow-md);
  transform: translateY(-3px);
}

/* Image */
.pjf-v2-card-image-wrap {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--pjf-green-50);
  flex-shrink: 0;
  text-decoration: none !important;
}
.pjf-v2-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.pjf-v2-card:hover .pjf-v2-card-image-wrap img {
  transform: scale(1.04);
}
.pjf-v2-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--pjf-green-50) 0%,
    var(--pjf-green-100) 100%
  );
}

/* Badge */
.pjf-v2-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: var(--pjf-radius-pill);
  background: var(--pjf-green-900);
  color: #fbf8f0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.pjf-v2-badge--out {
  background: rgba(31, 29, 23, 0.5);
}

/* Card body */
.pjf-v2-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.pjf-v2-card-name-link {
  text-decoration: none !important;
}
.pjf-v2-card-name {
  font-family: var(--pjf-font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--pjf-green-900);
  line-height: 1.2;
  transition: color 0.15s;
}
.pjf-v2-card:hover .pjf-v2-card-name {
  color: var(--pjf-green-700);
}
.pjf-v2-card-subtitle {
  font-size: 12px;
  color: var(--pjf-ink-mute);
  font-style: italic;
  margin-top: 5px;
  line-height: 1.4;
}

/* Option pills */
.pjf-v2-card-options {
  display: flex;
  gap: 5px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.pjf-v2-option-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--pjf-radius-sm);
  background: var(--pjf-green-50);
  color: var(--pjf-green-800);
  font-weight: 500;
  border: 1px solid var(--pjf-green-100);
}
/* Variation épuisée */
.pjf-v2-option-pill--out {
  background: #f3f0eb;
  color: var(--pjf-ink-mute);
  border-color: var(--pjf-line);
  text-decoration: line-through;
  opacity: 0.75;
}
.pjf-v2-pill-cross {
  font-size: 13px;
  line-height: 1;
  color: var(--pjf-terra-600);
  text-decoration: none;
}

/* Card footer */
.pjf-v2-card-footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.pjf-v2-price-wrap {
  flex-shrink: 0;
  min-width: 0;
}
.pjf-v2-price-from {
  font-size: 11px;
  color: var(--pjf-ink-mute);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 3px;
}
.pjf-v2-price {
  font-family: var(--pjf-font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--pjf-green-900);
  line-height: 1;
}
.pjf-v2-price .woocommerce-Price-amount,
.pjf-v2-price bdi {
  font-family: var(--pjf-font-display);
  font-size: inherit;
  font-weight: 600;
  color: inherit;
}
.pjf-v2-price del {
  font-size: 14px;
  color: var(--pjf-ink-mute);
  display: block;
  line-height: 1;
  margin-bottom: 2px;
}
.pjf-v2-price ins {
  text-decoration: none;
}

/* CTA button */
.pjf-v2-btn-choose {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 16px;
  background: var(--pjf-terra-600);
  color: #fff !important;
  border-radius: var(--pjf-radius-pill);
  font-family: var(--pjf-font-body);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  letter-spacing: 0.02em;
  transition:
    background 0.15s,
    transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}
.pjf-v2-btn-choose:hover {
  background: var(--pjf-terra-700);
  transform: scale(1.02);
}
.pjf-v2-btn-choose-disabled {
  background: var(--pjf-line) !important;
  color: var(--pjf-ink-mute) !important;
  cursor: default;
  pointer-events: none;
  transform: none !important;
}

/* ——————————————————————————————————
   EMPTY STATE
—————————————————————————————————— */
.pjf-v2-no-results {
  padding: 60px 0;
  text-align: center;
  grid-column: 1 / -1;
}
.pjf-v2-no-results p {
  font-size: 16px;
  color: var(--pjf-ink-soft);
  margin-bottom: 20px;
}

/* ——————————————————————————————————
   PAGINATION
—————————————————————————————————— */
.pjf-v2-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 52px;
}
.pjf-v2-pagination .page-numbers {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--pjf-radius-md);
  border: 1px solid var(--pjf-line);
  background: #fff;
  color: var(--pjf-green-900);
  font-family: var(--pjf-font-body);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  cursor: pointer;
}
.pjf-v2-pagination .page-numbers.current {
  background: var(--pjf-green-800);
  color: #fff;
  border-color: var(--pjf-green-800);
}
.pjf-v2-pagination .page-numbers:not(.current):hover {
  background: var(--pjf-green-50);
  border-color: var(--pjf-green-100);
}
.pjf-v2-pagination .prev,
.pjf-v2-pagination .next {
  color: var(--pjf-ink-soft);
}

/* ——————————————————————————————————
   OVERLAY + DRAWER MOBILE
—————————————————————————————————— */
.pjf-v2-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31, 53, 39, 0.45);
  z-index: 9998;
  backdrop-filter: blur(2px);
}
.pjf-v2-overlay.open {
  display: block;
}
.pjf-v2-drawer {
  position: fixed;
  top: 0;
  left: -110%;
  width: min(320px, 92vw);
  height: 100%;
  background: #fff;
  color: var(--pjf-ink);
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 40px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--pjf-shadow-lg);
}
.pjf-v2-drawer.open {
  left: 0;
}
.pjf-v2-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.pjf-v2-drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pjf-v2-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pjf-ink-mute);
  padding: 4px;
  display: flex;
  border-radius: var(--pjf-radius-sm);
  transition:
    color 0.15s,
    background 0.15s;
}
.pjf-v2-drawer-close:hover {
  color: var(--pjf-ink);
  background: var(--pjf-line-soft);
}

/* ——————————————————————————————————
   RESPONSIVE — Tablette (≤ 1024px)
—————————————————————————————————— */
@media (max-width: 1024px) {
  .pjf-v2-layout {
    grid-template-columns: 240px 1fr;
    gap: 48px;
  }
  .pjf-v2-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pjf-v2-card-name {
    font-size: 18px;
  }
}

/* ——————————————————————————————————
   RESPONSIVE — Mobile (≤ 768px)
—————————————————————————————————— */
@media (max-width: 768px) {
  .pjf-v2-container {
    padding: 0;
  }
  .pjf-v2-layout {
    grid-template-columns: 1fr;
  }
  .pjf-v2-sidebar {
    display: none;
  }
  .pjf-v2-main {
    padding: 0 16px;
  }
  .pjf-v2-mobile-bar {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .pjf-v2-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .pjf-v2-card-name {
    font-size: 16px;
  }
  .pjf-v2-price {
    font-size: 20px;
  }
  .pjf-v2-btn-choose {
    font-size: 12px;
    padding: 8px 12px;
  }
  .pjf-v2-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }
}

/* ——————————————————————————————————
   RESPONSIVE — Petit mobile (≤ 480px)
—————————————————————————————————— */
@media (max-width: 480px) {
  .pjf-v2-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
  }
  .pjf-v2-card-image-wrap {
    aspect-ratio: 4 / 3;
  }
}
