/* ============================================================
   BAYAGO — DESIGN SYSTEM V2 (refonte)
   Direction : sobre, confiante, pilotée par la photo.
   Chargé en dernier : il supplante main.css / components.css /
   theme-upgrade.css sans toucher au HTML ni au JS.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Verts affinés (plus profonds, moins saturés) */
  --color-primary: #1B4332;
  --color-primary-light: #2D6A4F;
  --color-primary-dark: #0D2B1D;
  --v2-green-tint: #EFF5F1;
  --v2-green-tint-2: #E2EDE6;

  /* Orange discipliné : réservé aux actions et promos */
  --color-accent: #F45D22;
  --color-accent-2: #FF8A5B;

  /* Neutres plus doux */
  --color-bg: #FAFBFC;
  --color-surface: #FFFFFF;
  --color-surface-2: #F3F5F7;
  --color-text: #16202B;
  --color-text-muted: #5D6B7A;
  --color-text-light: #93A0AD;
  --color-border: #E5E9ED;
  --color-border-light: #F0F2F5;

  /* Géométrie */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Ombres douces à deux couches */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.06);
  --shadow-lg: 0 16px 40px rgba(16,24,40,.14);
  --shadow-accent: 0 10px 26px rgba(244,93,34,.28);
}

/* ---------- 2. BASE ---------- */
body { background: var(--color-bg); }

/* Titres : sans-serif discipliné (fin du serif Playfair) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  letter-spacing: -0.022em;
  font-weight: 700;
}
h1 { font-size: clamp(1.9rem, 4.2vw, 3.1rem); }

/* ---------- 3. NAVBAR ---------- */
.navbar {
  background: rgba(255,255,255,.96);
  box-shadow: none;
  border-bottom: 1px solid var(--color-border);
  height: 68px;
}
.navbar-inner { max-width: 1440px; }
.navbar-logo .brand-logo { height: 34px; }
.navbar-link { font-weight: 600; font-size: .92rem; color: var(--color-text-muted); border-radius: 9px; }
.navbar-link:hover, .navbar-link.active { background: var(--v2-green-tint); color: var(--color-primary); }
.nav-dropdown-menu { border-radius: 14px; box-shadow: var(--shadow-lg); border-color: var(--color-border); padding: .45rem; }
.nav-dropdown-item { border-radius: 9px; }

/* ---------- 4. BOUTONS ---------- */
.btn { border-radius: var(--radius); font-weight: 600; letter-spacing: -0.01em; }
.btn-lg, .btn-xl { border-radius: 12px; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(27,67,50,.24); }
.btn-accent { background: var(--color-accent-strong); box-shadow: none; }
.btn-accent:hover:not(:disabled) { background: #9A3412; box-shadow: var(--shadow-accent); }
.btn-outline { border-width: 1.5px; }
.btn-surface { border-width: 1.5px; }

/* ---------- 5. BADGES ---------- */
.badge { font-weight: 600; border-radius: 8px; letter-spacing: 0; }
.badge-available { background: #fff; color: var(--color-success); border: none; box-shadow: var(--shadow-sm); }
.badge-verified { background: #fff; color: var(--color-primary); border: none; box-shadow: var(--shadow-sm); }
.badge-furnished { background: #fff; color: #8B5E00; border: none; box-shadow: var(--shadow-sm); }
.badge-featured { background: #fff; color: var(--color-accent); border: none; box-shadow: var(--shadow-sm); }

/* ---------- 6. CARTES D'ANNONCES (le cœur du design) ---------- */
.listing-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.listing-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.listing-card-img::after { background: linear-gradient(180deg, rgba(0,0,0,.06) 0%, transparent 30%); opacity: 1; }
.listing-card:hover .listing-card-img img { transform: scale(1.05); }

/* Sobriété : 2 badges maximum sur la photo (les plus importants d'abord) */
.listing-card-badges .badge:nth-child(n+3) { display: none; }
.listing-card-badges { gap: .3rem; }

/* Cœur « sauvegarder » : pastille blanche flottante */
.listing-card-favorite,
.listing-card-favorite.btn-ghost {
  width: 36px; height: 36px;
  padding: 0 !important;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
}
.listing-card-favorite:hover { background: #fff; transform: scale(1.08); }

/* Prix : badge orange posé sur la photo (maquette).
   Le prix est la donnée la plus lue d'une carte : il doit passer 4,5:1,
   d'où le ton dense plutôt que l'orange de marque. */
.listing-price-tag {
  position: absolute;
  bottom: .7rem;
  left: .7rem;
  background: var(--color-accent-strong);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -0.01em;
  padding: .32rem .75rem;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  max-width: calc(100% - 1.4rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.listing-price-tag span { color: #fff !important; }
.listing-price-tag span[style*="line-through"] { opacity: .75; }
.listing-card-body { padding: .9rem 1.05rem 1rem; }
.listing-card-title { font-size: .95rem; font-weight: 600; color: var(--color-text); }
.listing-card-location { font-size: .8rem; }
.listing-card-meta { border-top: 1px solid var(--color-border-light); gap: .8rem; }

/* Icônes SVG des cartes (mêmes partout, contrairement aux émojis) */
.lb-ic {
  width: 15px; height: 15px;
  vertical-align: -2px;
  flex-shrink: 0;
}
.listing-card-meta .lb-ic, .listing-card-location .lb-ic { color: var(--color-text-light); }
.listing-card-location .lb-ic { color: var(--color-accent); }
[data-fav] { display: flex; align-items: center; justify-content: center; }
[data-fav] .lb-heart { width: 17px; height: 17px; color: #8a97a5; transition: color .15s ease; }
[data-fav].fav-on .lb-heart { color: #E24B4A; fill: #E24B4A; }
.listing-card-favorite:hover .lb-heart { color: #E24B4A; }

/* Bandeau confiance (maquette) */
.trust-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0 .5rem;
}
.trust-tile {
  background: var(--v2-green-tint);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  gap: .9rem;
  align-items: center;
}
.trust-tile .trust-ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
/* Le titre et la description étaient empilés en s'appuyant sur les affichages
   par défaut : <b> forcé en block, <span> laissé inline. Si une seule de ces
   deux règles n'est pas appliquée, les deux textes se collent sur une ligne.
   La colonne flex rend l'empilement explicite. */
.trust-tile > div:last-child {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}
.trust-tile b { font-size: .95rem; letter-spacing: -0.01em; }
.trust-tile span { font-size: .82rem; color: var(--color-text-muted); }

/* ---------- 7. HÉRO + RECHERCHE ---------- */
.hero {
  background: linear-gradient(160deg, #0D2B1D 0%, #1B4332 55%, #24573F 100%);
  padding: 5.5rem 1rem 5.5rem;
}
.hero::before {
  background:
    radial-gradient(ellipse 45% 70% at 88% 12%, rgba(244,93,34,.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 8% 85%, rgba(45,106,79,.35) 0%, transparent 55%);
}
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.35rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-shadow: none;
  margin-bottom: 1rem;
}
.hero p { font-size: 1.12rem; opacity: .92; margin-bottom: 2rem; }
.hero-counter {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 600;
}

/* Carte de recherche : onglets + champs dans une même carte blanche (maquette) */
.search-card {
  background: #fff;
  border-radius: 18px;
  padding: .65rem .75rem .75rem;
  box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.12);
  text-align: left;
}
.search-card #hero-tabs {
  display: flex;
  gap: .25rem;
  border: none;
  margin: 0 0 .6rem;
  padding: 0 .15rem;
}
.search-card #hero-tabs .tab {
  border: none;
  border-radius: 9px;
  padding: .5rem 1.05rem;
  font-weight: 600;
  font-size: .92rem;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.search-card #hero-tabs .tab:hover { color: var(--color-primary); background: var(--v2-green-tint); }
.search-card #hero-tabs .tab.active { background: var(--color-primary); color: #fff; }
.search-card #hero-search {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: .5rem;
  align-items: center;
}
.search-card #hero-search .form-control {
  height: 54px;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  font-size: .95rem;
  font-weight: 500;
  padding: 0 1rem;
  color: var(--color-text);
}
.search-card #hero-search .form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,.12);
}
.search-card #hero-search .btn {
  height: 54px;
  padding: 0 1.9rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
}

/* Bandeau stats du héro */
#hero-stats-bar { font-size: .84rem !important; }

/* ---------- 8. SECTIONS ---------- */
.section { padding: 3.75rem 0; }
.section-header { align-items: center; margin-bottom: 1.5rem; }
.section-title { font-size: 1.5rem; letter-spacing: -0.025em; }
.section-title::after { display: none; }
.section-subtitle { font-size: .92rem; }
.section-header .btn-ghost { font-weight: 600; color: var(--color-primary); }
.section-header .btn-ghost:hover { color: var(--color-accent); background: transparent; }

/* Stat cards */
.stat-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  background: var(--color-surface);
}
.stat-card .stat-value { font-family: var(--font-body); font-weight: 700; letter-spacing: -0.02em; font-size: 1.75rem; }

/* Quartiers populaires */
#neighborhoods .card {
  border-radius: var(--radius-lg);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
#neighborhoods .card:hover { border-color: var(--color-primary); box-shadow: var(--shadow); transform: translateY(-3px); }

/* ---------- 9. BANDES SERVICES / PRO / FOOTER ---------- */
section[style*="var(--color-primary)"] { padding: 4rem 0 !important; }
section[style*="var(--color-primary)"] .card { border-radius: var(--radius-lg) !important; transition: transform .2s ease, background .2s ease; }
section[style*="var(--color-primary)"] a.card:hover { background: rgba(255,255,255,.16) !important; transform: translateY(-3px); }

#pro-cta-section { background: var(--v2-green-tint) !important; border-top: 1px solid var(--v2-green-tint-2) !important; padding: 4.25rem 0 !important; }
#pro-cta-grid > div { border-radius: var(--radius-lg) !important; border-width: 1px !important; box-shadow: var(--shadow-sm) !important; transition: transform .2s ease, box-shadow .2s ease; }
#pro-cta-grid > div:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg) !important; }

footer h5 { letter-spacing: .04em; font-size: .78rem; text-transform: uppercase; opacity: .92; }
footer a:hover { color: #fff !important; }

/* ---------- 10. FORMULAIRES & MODALES ---------- */
.form-control {
  border-radius: var(--radius);
  border-width: 1.5px;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,.10);
}
.modal { border-radius: var(--radius-lg); }
.modal-header h3 { letter-spacing: -0.02em; }

/* Chips */
.chip { border-radius: 9px; font-weight: 600; }
.chip-clickable:hover { background: var(--v2-green-tint); color: var(--color-primary); }

/* ---------- 12. PAGE RECHERCHE ---------- */
.filter-section { padding: 1rem 0; }
.filter-section-title {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  margin-bottom: .6rem;
}
#view-list.active, #view-map.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.check-group { border-radius: 8px; }
.check-group:hover { background: var(--v2-green-tint); }

/* ---------- 13. FICHE DU BIEN ---------- */
/* La grille contenu + panneau (1fr 340px) doit s'empiler sur petit écran */
@media (max-width: 900px) {
  .listing-layout { grid-template-columns: 1fr !important; }
  .listing-layout > div[style*="sticky"] { position: static !important; }
}
#listing-content .price-large {
  color: var(--color-text) !important;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.02em;
}
#listing-content h1 { font-size: clamp(1.45rem, 2.8vw, 2rem); }
#listing-content .chip .lb-ic { color: var(--color-primary); margin-right: 2px; }
#listing-content .gallery-main img { border-radius: var(--radius-lg); }

/* ---------- 11. MOBILE ---------- */
@media (max-width: 768px) {
  .hero { padding: 3.25rem 1rem 3.5rem; }
  .hero h1 { font-size: 1.85rem; }
  .search-card #hero-search { grid-template-columns: 1fr !important; }
  .search-card #hero-search .form-control, .search-card #hero-search .btn { height: 50px; width: 100%; }
  .search-card #hero-tabs { flex-wrap: wrap; justify-content: center; }
  .listing-card:hover { transform: none; }
  .section { padding: 2.5rem 0; }
}

/* Rangée Sauvegarder / Partager / Signaler : jamais rognée */
.listing-actions-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .15rem; }
.listing-actions-row .btn { padding: .4rem .45rem; font-size: .78rem; flex: 1 1 auto; min-width: 0; }
