/**
 * producteurs-carte.css
 * Styles pour le shortcode [producteurs_carte]
 * Layout liste + carte + filtres
 */

/* ── Barre de filtres ─────────────────────────────────────────────────────── */
.pc-filter-bar {
  margin-bottom: 28px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #FFF7EA;
  overflow: visible;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.pc-filter-bar__top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.pc-filter-bar__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 16px;
}
.pc-filter-bar__tags:empty { display: none; }

/* ── Champ recherche ──────────────────────────────────────────────────────── */
.pc-search-input {
  flex: 1 1 200px;
  min-width: 160px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #e4ddd4;
  border-radius: 22px;
  font-size: 14px;
  color: #333;
  background: #faf8f5;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pc-search-input::placeholder { color: #b0a89e; }
.pc-search-input:focus {
  border-color: #c8bfb4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200,185,170,0.2);
}

/* ── Dropdowns ────────────────────────────────────────────────────────────── */
.pc-dropdown {
  position: relative;
  flex-shrink: 0;
}

.pc-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid #e4ddd4;
  border-radius: 22px;
  background: #faf8f5;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none;
  min-width: 130px;
}
.pc-dropdown__trigger:hover,
.pc-dropdown.is-open .pc-dropdown__trigger {
  border-color: #c8bfb4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200,185,170,0.2);
}

.pc-dropdown__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #3a3228;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.pc-dropdown__count:empty,
.pc-dropdown__count[data-count="0"] { display: none; }

.pc-dropdown__chevron {
  width: 14px; height: 14px;
  opacity: 0.45;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: auto;
}
.pc-dropdown.is-open .pc-dropdown__chevron { transform: rotate(180deg); opacity: 0.7; }

.pc-dropdown__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e4ddd4;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.10);
  padding: 8px 0;
  z-index: 1000;
  display: none;
}
.pc-dropdown.is-open .pc-dropdown__panel { display: block; }

.pc-dropdown__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.pc-dropdown__option:hover { background: #faf8f5; }
.pc-dropdown__option input[type="checkbox"] {
  width: 16px; height: 16px;
  flex-shrink: 0;
  accent-color: #3a3228;
  cursor: pointer;
}

/* ── Bouton Rechercher ────────────────────────────────────────────────────── */
.pc-btn-apply {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 26px;
  border: none;
  border-radius: 22px;
  background: #1e1a16;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
  margin-left: auto;
}
.pc-btn-apply:hover { background: #0d0b09; }
.pc-btn-apply:active { transform: scale(0.97); }

/* ── Tags actifs ──────────────────────────────────────────────────────────── */
.pc-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px 0 14px;
  border-radius: 15px;
  background: #f0ebe4;
  font-size: 13px;
  color: #3a3228;
  font-weight: 500;
}
.pc-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #d5cdc4;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #555;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.pc-tag__remove:hover { background: #8b7d6e; color: #fff; }

.pc-tag-reset {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  border: 1px solid #ddd6ce;
  background: transparent;
  font-size: 13px;
  color: #8b7d6e;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pc-tag-reset:hover { background: #f0ebe4; color: #3a3228; }

/* ── Layout liste + carte ─────────────────────────────────────────────────── */
.pc-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* Liste scrollable */
.pc-layout__list {
  flex: 1 1 50%;
  min-width: 0;
  max-height: 82vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding-right: 8px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: #d5cdc4 transparent;
}
.pc-layout__list::-webkit-scrollbar { width: 5px; }
.pc-layout__list::-webkit-scrollbar-thumb { background: #d5cdc4; border-radius: 3px; }

/* Carte sticky */
.pc-layout__map {
  flex: 0 0 48%;
  position: sticky;
  top: 86px;
}

#pc-map {
  width: 100%;
  height: 82vh;
  min-height: 400px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

/* ── Cards producteurs ────────────────────────────────────────────────────── */
.pc-card {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: #FEF7EC;
  border: none;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 14px;
  gap: 14px;
}
.pc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.10);
}

.pc-card__media {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 14px;
}
.pc-card__img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s;
}
.pc-card:hover .pc-card__img { transform: scale(1.04); }
.pc-card__img-placeholder {
  width: 100%; height: 100%;
  background: #f5e9d5;
  border-radius: 14px;
}

.pc-card__body {
  padding: 0 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pc-card__title {
  font-size: 15px;
  font-weight: 600;
  color: #1e1a16;
  margin: 0;
  line-height: 1.3;
}
.pc-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pc-card__tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 12px;
  color: #3a3228;
  font-weight: 400;
}

/* ── Aucun résultat ───────────────────────────────────────────────────────── */
.pc-no-results {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  font-size: 15px;
  color: #8b7d6e;
}
.pc-widen {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  height: 36px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid #ddd6ce;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #3a3228;
  cursor: pointer;
  transition: background 0.15s;
}
.pc-widen:hover { background: #f0ebe4; }

/* ── Popup carte ──────────────────────────────────────────────────────────── */
.pc-popup { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.pc-popup__title { font-size: 14px; font-weight: 600; color: #1e1a16; }
.pc-popup__link {
  font-size: 13px; color: #3a3228; text-decoration: none;
  font-weight: 500; border-bottom: 1px solid #e4ddd4;
  transition: color 0.15s;
}
.pc-popup__link:hover { color: #1e1a16; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pc-layout__list { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .pc-layout { flex-direction: column; }
  .pc-layout__map { display: none; }
  .pc-layout__list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    grid-template-columns: repeat(2, 1fr);
  }
  .pc-filter-bar__top { flex-wrap: wrap; }
  .pc-search-input { flex: 1 1 100%; }
  .pc-btn-apply { flex: 1; justify-content: center; margin-left: 0; }
  .pc-dropdown__panel {
    left: 0; right: auto;
    width: calc(100vw - 40px);
    min-width: unset;
  }
  .pc-dropdown__trigger { min-width: unset; }
}

@media (max-width: 480px) {
  .pc-layout__list { grid-template-columns: 1fr; }
}
