/* ===== PAGE ACHETER – Mise en page professionnelle ===== */

.acheter-page {
  padding-bottom: 2rem;
}

/* ----- Hero ----- */
.acheter-page .acheter-hero {
  background: linear-gradient(160deg, rgba(44, 62, 80, 0.96) 0%, rgba(56, 94, 107, 0.92) 100%);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  color: #fff;
}

.acheter-page .acheter-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.acheter-page .acheter-hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: #fff;
}

.acheter-page .acheter-hero .acheter-lead {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

/* ----- Layout filtre + résultats ----- */
.acheter-page .acheter-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 2rem auto 2rem;
  padding: 0 1.5rem;
  align-items: start;
}

/* ----- Colonne Filtres ----- */
.acheter-page .filters-section-acheter {
  background: #fff;
  border: 1px solid rgba(44, 62, 80, 0.06);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(44, 62, 80, 0.04), 0 8px 32px -8px rgba(44, 62, 80, 0.06);
  padding: 1.35rem 1.1rem;
  position: sticky;
  top: 92px;
  height: fit-content;
}

.acheter-page .filters-title-acheter {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-dark, var(--primary-dark));
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent, #f2deb9);
}

.acheter-page .filters-form-acheter .filter-group-acheter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.acheter-page .filters-form-acheter .filter-group-acheter:last-of-type {
  margin-bottom: 0;
}

.acheter-page .filter-group-acheter-label {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.875rem;
}

.acheter-page .filter-group-acheter-select,
.acheter-page .filter-group-acheter-input {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.acheter-page .filter-group-acheter-select:focus,
.acheter-page .filter-group-acheter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(56, 94, 107, 0.1);
  outline: none;
}

.acheter-page .filter-group-acheter-select-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.acheter-page .filter-button-acheter {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  background: var(--primary, #385e6b);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.acheter-page .filter-button-acheter:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(56, 94, 107, 0.18);
  background: var(--primary-dark, var(--primary-dark));
}

/* ----- Sous-menus Marque / Univers (même format que les autres filtres) ----- */
.filter-submenu-acheter-wrap {
  margin-bottom: 1rem;
}
.filter-submenu-acheter-wrap .filter-group-acheter-label {
  margin-bottom: 0.35rem;
}
.filter-submenu-acheter {
  position: relative;
}
/* Même style que .filter-group-acheter-select */
.filter-submenu-trigger.filter-submenu-trigger-select-style {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff !important;
  font-size: 0.9rem;
  font-weight: 400;
  color: #374151 !important;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.filter-submenu-trigger.filter-submenu-trigger-select-style:hover {
  border-color: var(--primary, #385e6b);
  box-shadow: 0 2px 8px rgba(56, 94, 107, 0.06);
}
.filter-submenu-trigger.filter-submenu-trigger-select-style[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(56, 94, 107, 0.1);
}
.filter-submenu-selected {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
}
.filter-submenu-selected:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
}
.filter-submenu-trigger-arrow {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #6b7280;
  transition: transform 0.2s;
}
.filter-submenu-trigger[aria-expanded="true"] .filter-submenu-trigger-arrow {
  transform: rotate(180deg);
}
.filter-submenu-panel {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.1);
}
.filter-submenu-panel[hidden] {
  display: none !important;
}
.filter-submenu-search {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #f9fafb;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.filter-submenu-search:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.filter-submenu-list {
  max-height: 200px;
  overflow-y: auto;
  border-radius: 6px;
}
.filter-submenu-item {
  padding: 8px 10px;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.filter-submenu-item:hover,
.filter-submenu-item:focus {
  background: rgba(56, 94, 107, 0.08);
  outline: none;
}
.filter-submenu-item.filter-submenu-item-clear {
  color: #64748b;
  font-style: italic;
}
.filter-submenu-item.filter-submenu-item-empty {
  color: #94a3b8;
  cursor: default;
  font-style: italic;
}

/* ----- Zone résultats ----- */
.acheter-page .acheter-results-wrap {
  min-width: 0;
}

.acheter-page .acheter-results-wrap .container-acheter {
  padding: 0;
}

.acheter-page .acheter-results-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark, var(--primary-dark));
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(44, 62, 80, 0.08);
}

/* Bandeaux type leboncoin (page Acheter) */
.acheter-page .banner-ad-wrap,
.banner-ad-wrap {
  margin: 0 0 1rem;
  padding: 10px 16px;
  background: #f1f5f9;
  border-radius: 12px;
  text-align: center;
}
.acheter-page .banner-ad-label,
.banner-ad-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.acheter-page .banner-ad-brand,
.banner-ad-brand { font-size: 1rem; font-weight: 700; color: var(--primary, #385e6b); }
.acheter-page .banner-ad-tag,
.banner-ad-tag { font-size: 0.75rem; color: #64748b; }

.acheter-page .banner-promo-wrap,
.banner-promo-wrap { margin: 0 0 1.5rem; }
.acheter-page .banner-promo,
.banner-promo {
  background: linear-gradient(135deg, rgba(254, 215, 170, 0.4) 0%, rgba(251, 207, 232, 0.35) 100%);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.acheter-page .banner-promo-text,
.banner-promo-text {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.acheter-page .banner-promo-question,
.banner-promo-question { font-size: 0.9375rem; color: #475569; margin: 0 0 1rem; }
.acheter-page .banner-promo-actions,
.banner-promo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.acheter-page .banner-promo-btn,
.banner-promo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.15s;
}
.acheter-page .banner-promo-btn:hover,
.banner-promo-btn:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.acheter-page .banner-promo-btn-icon,
.banner-promo-btn-icon { font-size: 1.5rem; line-height: 1; }

.acheter-page .statues-grid-acheter,
.statues-grid-acheter.tsume-style {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.75rem;
  padding: 0.5rem 0;
}

.acheter-page .pagination-acheter {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.acheter-page .pagination-acheter .page {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

/* Cartes annonces – enveloppe raffinée */
.acheter-page .listing-card-acheter-wrap,
.listing-card-acheter-wrap {
  position: relative;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.acheter-page .listing-card-acheter-wrap .listing-card-acheter,
.listing-card-acheter-wrap .listing-card-acheter {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.acheter-page .listing-card-acheter-wrap .listing-card-favori,
.listing-card-acheter-wrap .listing-card-favori {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  font-size: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.acheter-page .listing-card-acheter-wrap .listing-card-favori:hover,
.listing-card-acheter-wrap .listing-card-favori:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  background: #fff;
}

.acheter-page .listing-card-acheter-wrap .listing-card-favori.is-favori,
.listing-card-acheter-wrap .listing-card-favori.is-favori {
  background: rgba(233, 30, 99, 0.12);
  box-shadow: 0 2px 12px rgba(233, 30, 99, 0.2);
}

.acheter-page .listing-card-acheter,
.listing-card-acheter {
  display: block;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(44, 62, 80, 0.06);
  box-shadow: 0 2px 12px rgba(44, 62, 80, 0.04), 0 8px 32px -8px rgba(44, 62, 80, 0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.2s ease;
}

.acheter-page .listing-card-acheter:hover,
.listing-card-acheter:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px -8px rgba(44, 62, 80, 0.14), 0 0 0 1px rgba(255, 111, 0, 0.08);
  border-color: rgba(255, 111, 0, 0.15);
}

.acheter-page .listing-card-acheter-image,
.listing-card-acheter-image {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  overflow: hidden;
  position: relative;
}

/* Badge À la une (annonces en avant) */
.acheter-page .listing-badge-featured,
.listing-badge-featured {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(94, 53, 177, 0.95);
  color: #fff;
}

.acheter-page .listing-card-acheter-image::after,
.listing-card-acheter-image::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.acheter-page .listing-card-acheter-image img,
.listing-card-acheter-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.acheter-page .listing-card-acheter:hover .listing-card-acheter-image img,
.listing-card-acheter:hover .listing-card-acheter-image img {
  transform: scale(1.04);
}

.acheter-page .listing-card-acheter-placeholder,
.listing-card-acheter-placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.acheter-page .listing-card-acheter-content,
.listing-card-acheter-content {
  padding: 1rem 1.25rem 1.25rem;
  background: linear-gradient(to bottom, #ffffff 0%, #fefefe 100%);
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

/* Format type leboncoin : prix en tête, puis titre, puis meta (catégorie · lieu) – hauteur uniforme */
.acheter-page .listing-card-acheter-price,
.listing-card-acheter-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary, #385e6b);
  margin: 0 0 0.4rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.acheter-page .listing-card-acheter-title,
.listing-card-acheter-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.35rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  min-height: 2.7em;
}

.acheter-page .listing-card-acheter-meta,
.listing-card-acheter-meta {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.listing-card-acheter-footer {
  padding: 0.5rem 1.25rem 1rem;
  background: #fff;
  border: 1px solid rgba(44, 62, 80, 0.06);
  border-top: none;
  border-radius: 0 0 16px 16px;
  margin-top: -1px;
}

.listing-card-acheter-actions {
  margin: 0;
  padding: 0;
}

.listing-card-acheter-direct {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary, #385e6b);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--primary, #385e6b);
  transition: background 0.2s, color 0.2s;
}

.listing-card-acheter-direct:hover {
  background: var(--primary, #385e6b);
  color: #fff;
}

.acheter-page .acheter-loading,
.acheter-page .acheter-empty,
.acheter-page .acheter-error,
.acheter-loading,
.acheter-empty,
.acheter-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 2rem;
  color: #64748b;
  font-size: 1rem;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  border: 1px dashed var(--border-light);
}

/* ----- Badge et chips filtres appliqués ----- */
.acheter-filters-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
}
.acheter-filters-badge.is-visible {
  display: inline-flex;
}

.acheter-filters-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
  min-height: 0;
}

.acheter-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.875rem;
  background: var(--light-gray);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: var(--primary-dark);
}

.acheter-filter-chip-label {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acheter-filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--gray);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.acheter-filter-chip-remove:hover {
  background: var(--border-light);
  color: var(--primary-dark);
}

.acheter-filter-chip-remove:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ----- Toggle filtres (mobile) ----- */
.acheter-filters-toggle-btn {
  display: none;
}

.filters-section-acheter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
}

.filters-section-acheter-header .filters-title-acheter {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filters-section-acheter-header {
  display: none;
}

.acheter-filters-close-btn {
  display: none;
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.acheter-filters-close-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .acheter-page .acheter-layout {
    grid-template-columns: 1fr;
    position: relative;
  }

  .acheter-page .filters-section-acheter {
    position: static;
  }

  .acheter-filters-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
    color: var(--primary-dark, var(--primary-dark));
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
  }

  .acheter-filters-toggle-btn:hover {
    background: #f9fafb;
    border-color: var(--accent, #f2deb9);
    color: var(--accent, #f2deb9);
  }

  .acheter-filters-toggle-btn[aria-expanded="true"] .acheter-filters-toggle-icon {
    transform: rotate(-180deg);
  }

  .acheter-filters-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
  }

  .filters-section-acheter-header {
    display: flex;
  }

  .acheter-page .filters-section-acheter,
  .acheter-layout-flex .filters-section-acheter {
    display: none;
    margin-bottom: 1.5rem;
  }

  .acheter-page .acheter-layout.filters-open .filters-section-acheter,
  .acheter-layout-flex.filters-open .filters-section-acheter {
    display: block !important;
  }

  /* Raccorder visuellement le bouton au panneau quand ouvert */
  .acheter-layout-flex.filters-open .acheter-filters-toggle-btn {
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
  }
  .acheter-layout-flex.filters-open .filters-section-acheter {
    border-radius: 0 0 12px 12px;
  }

  .acheter-filters-close-btn {
    display: inline-flex;
    align-items: center;
  }
}

/* ----- Grille annonces : cartes compactes type leboncoin sur mobile ----- */
@media (max-width: 768px) {
  .acheter-page .statues-grid-acheter,
  .statues-grid-acheter.tsume-style,
  .bibliotheque-section-acheter .statues-grid-acheter {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  /* Image plus petite pour cartes compactes */
  .acheter-page .listing-card-acheter-image,
  .listing-card-acheter-image {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    max-height: 140px;
    min-height: 0;
  }
  .acheter-page .listing-card-acheter-image img,
  .listing-card-acheter-image img {
    border-radius: 10px;
  }
  .acheter-page .listing-card-acheter,
  .listing-card-acheter {
    border-radius: 10px;
  }
  /* Zone texte plus compacte */
  .acheter-page .listing-card-acheter-content,
  .listing-card-acheter-content {
    padding: 8px 10px 10px;
    min-height: 4.25rem;
  }
  .acheter-page .listing-card-acheter-price,
  .listing-card-acheter-price {
    font-size: 1rem;
    margin: 0 0 2px;
  }
  .acheter-page .listing-card-acheter-title,
  .listing-card-acheter-title {
    font-size: 0.8125rem;
    margin: 0 0 2px;
    min-height: 2.4em;
  }
  .acheter-page .listing-card-acheter-meta,
  .listing-card-acheter-meta {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  /* Garder 2 colonnes pour cartes compactes (style leboncoin) */
  .acheter-page .statues-grid-acheter,
  .statues-grid-acheter.tsume-style,
  .bibliotheque-section-acheter .statues-grid-acheter {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .acheter-page .listing-card-acheter-image,
  .listing-card-acheter-image {
    max-height: 120px;
  }
  .acheter-page .listing-card-acheter-content,
  .listing-card-acheter-content {
    padding: 6px 8px 8px;
    min-height: 3.75rem;
  }
  .acheter-page .listing-card-acheter-price,
  .listing-card-acheter-price {
    font-size: 0.9375rem;
  }
  .acheter-page .listing-card-acheter-title,
  .listing-card-acheter-title {
    font-size: 0.75rem;
    min-height: 2.2em;
  }
}
