/* ═══════════════════════════════════════════
   MALAGA — style.css
   Feuille de style partagée par toutes les pages
═══════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Filet de sécurité global : toute <img> insérée sans style explicite
   (via innerHTML dans app.js, nav.js, profil.html, connexion.html...) ne
   peut jamais dépasser la largeur de son conteneur. Évite qu'une image
   (selfie, pièce d'identité, logo, avatar...) s'affiche à sa taille brute
   et casse la mise en page. N'affecte pas les images qui ont déjà leur
   propre taille définie par une classe ou un style inline — ça les borne
   juste en plus par ce plafond. */
img { max-width: 100%; height: auto; }

:root {
  --vert: #009E60;
  --vert-fonce: #007A4A;
  --jaune: #FCD116;
  --jaune-fonce: #E5BC00;
  --bleu: #3A75C4;
  --bleu-fonce: #2C5A96;
  --texte: #1A2332;
  --gris-fond: #F5F6FA;
  --gris-bordure: #E5E7EB;
  --gris-clair: #9CA3AF;
  --texte-secondaire: #5B6472;
  --rouge: #EF4444;
  --radius: 12px;
  /* Couleur foncée FIXE (ne change jamais avec le thème) : utilisée pour le
     texte posé sur des fonds toujours colorés (jaune, dégradés), afin que ce
     texte reste lisible même quand --texte s'éclaircit en mode sombre. */
  --texte-fixe: #1A2332;
  /* Fond du footer, volontairement indépendant du thème (déjà sombre en
     mode clair, donc pas besoin de le faire varier). */
  --fond-pied: #1A2332;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--gris-fond);
  color: var(--texte);
  line-height: 1.6;
}

a { color: inherit; }

/* ===== HEADER (compact) ===== */
.header {
  background: linear-gradient(135deg, var(--vert) 0%, var(--vert-fonce) 100%);
  padding: 8px 14px;
  color: white;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  position: sticky;
  top: 0;
  z-index: 500;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.logo-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: white; min-width: 0; flex: 1 1 auto; }
.logo-img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: white; }
.logo-text-wrap { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; min-width: 0; }
.logo-text { font-size: 16px; font-weight: 900; letter-spacing: 1.5px; color: var(--jaune); white-space: nowrap; }
.slogan { font-size: 9.5px; opacity: .85; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* .header-actions (dans le header, id="navActions") ne doit JAMAIS passer à
   la ligne : sinon les icônes se chevauchent avec le contenu sous le header
   sticky. .nav-actions (utilisé ailleurs) garde le flex-wrap d'origine. */
.header-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; flex-shrink: 0; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.32);
  color: white; font-size: 16px; cursor: pointer; text-decoration: none; flex-shrink: 0;
  transition: background .15s, transform .15s; position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,.28); }
.icon-btn:active { transform: scale(.94); }

.avatar-btn.avatar-initiales {
  background: var(--jaune); color: var(--texte-fixe); font-weight: 800; font-size: 13px;
  border-color: var(--jaune-fonce);
}

.badge-favoris {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--rouge); color: white; font-size: 9.5px; font-weight: 800; border-radius: 20px;
  display: none; align-items: center; justify-content: center; border: 1.5px solid var(--vert-fonce);
}

/* ══════════ TRADUCTION (Google Translate) — masquage de l'UI Google ══════════
   Le widget Google Translate reste entièrement piloté par le bouton 🌐 (nav.js) ;
   sa propre interface (barre du haut, icône, popup de sélection de langue) ne
   doit jamais être visible : on ne garde que la traduction du texte elle-même.
   Google insère parfois un décalage inline ("top: 40px") sur <html> et <body>
   quand sa bannière est active, ce qui désynchronise la position visuelle du
   header sticky de sa zone cliquable réelle (les taps semblent "rater" les
   boutons) : on neutralise ce décalage en plus de masquer la bannière. */
#google_translate_element,
.goog-te-banner-frame,
.goog-te-gadget-icon,
.goog-te-menu-frame,
iframe.goog-te-menu-frame,
.skiptranslate > iframe {
  display: none !important;
}
html, html body, body { top: 0 !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
/* Bulle "Texte d'origine / Évaluez cette traduction" qui apparaît au tap sur un
   fragment traduit : c'est un iframe distinct injecté par Google, sans lien
   avec les contrôles du site (boutons, liens…), donc le masquer ne touche à
   rien d'autre. */
.goog-te-balloon-frame,
.goog-te-ftab,
iframe[src*="translate.google"],
iframe[src*="translate.googleapis"] {
  display: none !important;
}
#btnLangue.langue-actif { background: rgba(255,255,255,.32); }

/* Petits écrans : 3 icônes (thème, favoris, compte) + logo doivent tenir sur
   une seule ligne dans le header — on réduit légèrement icônes/espaces et on
   laisse le slogan se tronquer davantage plutôt que de déborder. */
@media (max-width: 380px) {
  .header-actions { gap: 4px; }
  .header .icon-btn { width: 34px; height: 34px; font-size: 14px; }
  .slogan { max-width: 46vw; }
}

/* ===== MENU LATÉRAL (DRAWER) ===== */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-overlay.visible { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 84vw;
  background: white; z-index: 950; box-shadow: 4px 0 24px rgba(0,0,0,.2);
  transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.ouvert { transform: translateX(0); }

.drawer-header {
  background: linear-gradient(135deg, var(--vert) 0%, var(--vert-fonce) 100%);
  padding: 20px 16px; display: flex; align-items: center; justify-content: space-between;
}
.drawer-logo { width: 44px; height: 44px; border-radius: 11px; background: white; object-fit: cover; }
.drawer-close {
  width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.2);
  color: white; font-size: 15px; cursor: pointer;
}

.drawer-nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.drawer-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 10px;
  text-decoration: none; color: var(--texte); font-size: 14px; font-weight: 600;
  transition: background .15s;
}
.drawer-link:hover, .drawer-link.actif { background: #F0FDF6; color: var(--vert-fonce); }
.drawer-sep { height: 1px; background: var(--gris-bordure); margin: 10px 4px; }
.drawer-footer { padding: 14px 16px; font-size: 11px; color: var(--gris-clair); border-top: 1px solid var(--gris-bordure); }

/* ===== BARRE DE NAVIGATION BASSE ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
  background: white; border-top: 1px solid var(--gris-bordure);
  box-shadow: 0 -2px 14px rgba(0,0,0,.08);
  display: flex; align-items: stretch; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 8px 4px 7px; text-decoration: none; color: var(--gris-clair);
  font-size: 10.5px; font-weight: 700; position: relative;
}
.bn-icon { font-size: 19px; line-height: 1; }
.bn-item.actif { color: var(--vert); }
.bn-item.actif .bn-icon { transform: translateY(-1px); }
.bn-central { flex: 0 0 62px; }
.bn-central .bn-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--jaune) 0%, var(--jaune-fonce) 100%);
  color: var(--texte-fixe); display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900; box-shadow: 0 3px 10px rgba(0,0,0,.2);
  margin-top: -22px; border: 3px solid white;
}
body { padding-bottom: 68px; }
@media (min-width: 960px) { .bottom-nav { display: none; } body { padding-bottom: 0; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 9px;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s;
}

.btn:active { transform: scale(.97); }

.btn-jaune { background: var(--jaune); color: var(--texte-fixe); }
.btn-jaune:hover { background: var(--jaune-fonce); }

.btn-blanc { background: rgba(255,255,255,.18); color: white; border: 1.5px solid rgba(255,255,255,.4); }
.btn-blanc:hover { background: rgba(255,255,255,.28); }

.btn-vert { background: var(--vert); color: white; }
.btn-vert:hover { background: var(--vert-fonce); }

.btn-bleu { background: var(--bleu); color: white; }
.btn-bleu:hover { background: var(--bleu-fonce); }

.btn-rouge { background: #FEE2E2; color: #B91C1C; }
.btn-rouge:hover { background: #FECACA; }

.btn-outline { background: white; color: var(--vert); border: 1.5px solid var(--vert); }
.btn-outline:hover { background: #F0FDF6; }

.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ===== HERO ===== */
.hero {
  background:
    linear-gradient(135deg, rgba(58,117,196,.92) 0%, rgba(44,90,150,.94) 100%),
    url("img/hero-maison.jpg") center 30%/cover no-repeat;
  padding: 34px 20px 30px;
  color: white;
  text-align: center;
}
.hero h1 {
  font-family: 'Playfair Display', serif; font-size: clamp(21px, 4.4vw, 29px); font-weight: 700;
  letter-spacing: .3px; margin-bottom: 16px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* En mode sombre, le fond du héros peut devenir très foncé (l'image de fond
   s'assombrit fortement) : un blanc pur perdait un peu de lisibilité/élégance,
   on passe à un ivoire chaud assorti au jaune de la marque, avec une lueur
   plus marquée pour bien détacher le titre du fond noir. */
body.theme-sombre .hero h1 {
  color: #F7ECD1;
  text-shadow: 0 2px 18px rgba(0,0,0,.55), 0 0 24px rgba(252,209,22,.15);
}

.search-bar { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.search-bar input, .search-bar button {
  padding: 12px 16px; border-radius: 10px; border: none; font-size: 14px; font-family: inherit; font-weight: 700;
}
.search-bar input { flex: 1; min-width: 200px; color: var(--texte); }

/* ===== STATS ===== */
.stats-section {
  background: white; border-bottom: 1px solid var(--gris-bordure); padding: 10px 20px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 13px; max-width: 620px; margin: 0 auto;
}
.stat-item { text-align: center; }
.stat-num { font-weight: 800; font-size: 15px; color: var(--vert); line-height: 1.1; }
.stat-label { color: var(--gris-clair); font-size: 10px; white-space: nowrap; }
@media (max-width: 380px) { .stat-label { font-size: 9px; } }

/* ===== FILTRES ===== */
.filters-bar {
  max-width: 1200px; margin: 16px auto; padding: 0 20px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.filters-bar input, .filters-bar select {
  padding: 10px 12px; border: 1.5px solid var(--gris-bordure); border-radius: 9px;
  font-size: 13px; font-family: inherit; flex: 1; min-width: 140px; background: white;
}
.filters-bar input:focus, .filters-bar select:focus { outline: none; border-color: var(--vert); }

/* ===== "HÔTELS & MOTELS" / "LES CATALOGUES" / "PRÈS DE CHEZ MOI" =====
   Trois boutons indépendants et bien séparés (espace entre chaque bloc),
   chacun avec ses 4 coins arrondis et un dégradé "luxe" brillant distinct. */
.hotels-motels-bar {
  max-width: 1200px; margin: 16px auto; padding: 0 20px;
}
.btn-hotels-motels {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 48%, #B45309 100%);
  border: none; border-radius: 12px;
  padding: 12px; font-size: 13.5px; font-weight: 800; letter-spacing: .2px;
  color: #fff; cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),
              inset 0 -10px 14px -10px rgba(0,0,0,.3),
              0 2px 0 rgba(0,0,0,.12);
  position: relative; overflow: hidden; transition: filter .15s, transform .1s;
}
.btn-hotels-motels::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 55%);
}
.btn-hotels-motels:hover { filter: brightness(1.1); }
.btn-hotels-motels:active { transform: scale(.99); }
.btn-hotels-motels.actif { filter: brightness(.9) saturate(1.2); }

/* Menu déroulant "Hôtels / Motels / Auberges" — même dégradé "luxe" que
   l'ancien bouton unique, mais permet de choisir précisément une catégorie
   (voir app.js → onChangeHebergement / HEBERGEMENT_OPTIONS). */
.select-hotels-motels {
  width: 100%; display: block; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background:
    linear-gradient(135deg, #FCD34D 0%, #F59E0B 48%, #B45309 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 0, right 14px center;
  background-size: 100% 100%, 18px 18px;
  border: none; border-radius: 12px;
  padding: 12px 40px 12px 14px; font-size: 13.5px; font-weight: 800; letter-spacing: .2px;
  color: #fff; cursor: pointer; text-align: center; text-align-last: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),
              inset 0 -10px 14px -10px rgba(0,0,0,.3),
              0 2px 0 rgba(0,0,0,.12);
}
.select-hotels-motels:hover { filter: brightness(1.1); }
.select-hotels-motels:focus { outline: none; filter: brightness(.97); }
.select-hotels-motels option { color: #1A2332; background: #fff; font-weight: 600; text-align: left; }

/* ===== "PRÈS DE CHEZ MOI" (géolocalisation + rayon) ===== */
.pres-de-moi-bar {
  max-width: 1200px; margin: 16px auto; padding: 0 20px;
}
.btn-pres-de-moi {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(135deg, #34D399 0%, #10B981 48%, #047857 100%);
  border: none; border-radius: 12px;
  padding: 12px; font-size: 13.5px; font-weight: 800; letter-spacing: .2px;
  color: #fff; cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4),
              inset 0 -10px 14px -10px rgba(0,0,0,.3),
              0 4px 10px rgba(4,120,87,.3);
  position: relative; overflow: hidden; transition: filter .15s, transform .1s;
}
.btn-pres-de-moi::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,0) 55%);
}
.btn-pres-de-moi:hover { filter: brightness(1.1); }
.btn-pres-de-moi:active { transform: scale(.99); }
.btn-pres-de-moi.actif { filter: brightness(.9) saturate(1.2); }
.btn-pres-de-moi.chargement { opacity: .7; cursor: wait; }

.rayon-control {
  margin-top: 10px; background: #fff; border: 1.5px solid var(--gris-bordure);
  border-radius: 12px; padding: 12px 14px;
}
.rayon-ligne {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--texte); margin-bottom: 6px;
}
.rayon-ligne strong { color: var(--vert); font-size: 14px; }
.rayon-control input[type="range"] {
  width: 100%; accent-color: var(--vert); cursor: pointer;
}
.rayon-statut {
  margin-top: 8px; font-size: 12px; color: var(--texte-secondaire); text-align: center;
}

/* ===== LAYOUT ACCUEIL : liste + carte côte à côte ===== */
.split-layout {
  max-width: 1200px; margin: 0 auto; padding: 0 20px 40px;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; align-items: start;
}
@media (max-width: 860px) {
  /* Mobile : la liste et la carte sont empilées. On "déplie" le conteneur
     .liste-col (display:contents) pour que le titre, les icônes de mode
     d'affichage, la carte et la grille d'annonces deviennent des éléments
     indépendants du même flex, réordonnables individuellement — la carte
     s'intercale juste après les icônes de vue, sans les recouvrir ni
     laisser d'espace vide au-dessus. */
  .split-layout { grid-template-columns: 1fr; display: flex; flex-direction: column; }
  .split-layout .liste-col { display: contents; }
  .split-layout .section-header { order: 1; }
  .split-layout .vue-modes-bar { order: 2; }
  .split-layout .map-wrap { order: 3; margin: 0 0 18px; }
  .split-layout .grille-annonces { order: 4; }
}

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-header h2 { color: var(--vert); font-weight: 800; font-size: 17px; }
.section-header span { font-size: 12px; color: var(--gris-clair); }

.grille-annonces {
  --tile-min: 240px;
  --tile-img-h: 150px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr)); gap: 14px;
  transition: grid-template-columns .2s ease;
}
/* Quand il y a beaucoup d'annonces, la colonne liste devient scrollable au lieu
   d'étirer la hauteur de toute la page indéfiniment. */
.grille-annonces.grille-scroll {
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  align-content: start;
}
.grille-annonces.grille-scroll::-webkit-scrollbar { width: 6px; }
.grille-annonces.grille-scroll::-webkit-scrollbar-thumb { background: var(--gris-bordure); border-radius: 6px; }
@media (max-width: 860px) {
  /* Sur mobile la page défile naturellement : pas de scroll interne, juste des tuiles plus compactes */
  .grille-annonces.grille-scroll { max-height: none; overflow-y: visible; padding-right: 0; }
}

.carte-annonce {
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s;
  cursor: pointer; border: 2px solid transparent;
}
.carte-annonce:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.14); }
.carte-annonce.survolee { border-color: var(--vert); }

/* ═══ "Près de chez moi" — carte dans le rayon choisi : mise en avant douce
   (halo qui pulse), pas de clignotement agressif. Voir togglePresDeMoi()/
   changerRayon() dans app.js. ═══ */
.carte-annonce.carte-proche {
  border-color: var(--vert);
  animation: pulseProche 1.8s ease-in-out infinite;
}
@keyframes pulseProche {
  0%, 100% { box-shadow: 0 2px 10px rgba(0,0,0,.08), 0 0 0 0 rgba(16,185,129,.45); }
  50% { box-shadow: 0 2px 10px rgba(0,0,0,.08), 0 0 0 6px rgba(16,185,129,0); }
}
.badge-distance {
  position: absolute; top: 8px; left: 44px; background: var(--vert); color: #fff;
  font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.carte-annonce .visuel {
  height: var(--tile-img-h); background: #e0e0e0; display: flex; align-items: center; justify-content: center;
  position: relative; font-size: 44px; color: #999; overflow: hidden;
  transition: height .2s ease;
}
.carte-annonce .visuel img { width: 100%; height: 100%; object-fit: cover; }

.btn-favori {
  position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.9); border: none; display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .15s;
}
.btn-favori:active { transform: scale(.9); }
.btn-favori.actif { background: var(--rouge); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 800;
}
.badge-disponible { background: #D1FAE5; color: var(--vert-fonce); }
.badge-occupe { background: #FEE2E2; color: #B91C1C; }

/* Distinction agence/entreprise vs particulier, sur les cartes d'annonces et le détail */
.badge-vendeur-particulier { background: rgba(255,255,255,.92); color: var(--texte); }
.badge-vendeur-entreprise { background: #DBEAFE; color: #1D4ED8; }
.badge-vendeur-verifie { background: #D1FAE5; color: var(--vert-fonce); }

.carte-info { padding: 12px 14px; }
/* Ces textes sont posés sur le fond BLANC fixe de la carte (.carte-annonce),
   qui ne change pas de couleur avec le thème. On fixe donc leur couleur en
   dur plutôt que de dépendre de --texte (qui s'éclaircit en mode sombre pour
   le reste du site) : sinon le texte devient quasi invisible sur ce fond
   resté blanc en mode sombre. */
.carte-info h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 6px; color: #1A2332; }
/* Étiquette de type de bien (Maison, Appartement, Villa...) — utilise la
   couleur déjà calculée par annonce (--couleur-type, posée sur .carte-annonce)
   pour rester lisible sur le fond blanc fixe de la carte, quel que soit le
   thème actif. */
.type-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  color: var(--couleur-type, #374151); background: color-mix(in srgb, var(--couleur-type, #374151) 12%, white);
  border: 1px solid var(--couleur-type, #374151); border-radius: 20px;
  padding: 2px 9px; margin-bottom: 6px;
}
.carte-info .prix { color: var(--vert); font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.carte-info .localisation { color: #5B6472; font-size: 12px; }

/* Date + heure de publication, affichée en miniature sur chaque carte d'annonce */
.carte-info .date-publication {
  display: block; color: #6B7280; font-size: 10.5px; margin-top: 4px; opacity: .85;
}

/* Numéro d'identification MALAGA (système de numérotation membres/annonces) */
.carte-info .numero-annonce {
  display: inline-block; font-family: 'Courier New', monospace; font-weight: 700;
  font-size: 10px; letter-spacing: .3px; color: var(--vert-fonce); background: #E6F7F0;
  padding: 2px 8px; border-radius: 8px; margin-top: 6px;
}

/* ===== CARTE LEAFLET ===== */
.map-wrap { position: sticky; top: 90px; }
#carteMap {
  width: 100%; height: 420px; max-height: 68vh; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.08);
  z-index: 1; transition: height .2s ease;
}
/* Bureau : quand la liste passe en scroll interne, la carte s'aligne sur la même hauteur */
.split-layout:has(.grille-scroll) #carteMap { height: 68vh; }
@media (max-width: 860px) {
  /* Mobile : carte réduite et non "collée" (sticky) pour ne pas manger l'écran */
  .map-wrap { position: static; }
  #carteMap { height: 240px; max-height: 240px; }
}
.leaflet-popup-content { font-family: 'Plus Jakarta Sans', sans-serif; }
.popup-annonce { min-width: 180px; }
.popup-annonce h4 { font-size: 13px; margin-bottom: 4px; }

/* Marqueur "vous êtes ici" (bouton "Près de chez moi") : pastille bleue avec
   un halo qui pulse, dans l'esprit de la position GPS sur Google Maps. */
.leaflet-div-icon.marqueur-moi { background: transparent; border: none; }
.pin-moi {
  width: 16px; height: 16px; background: #2563EB; border: 3px solid #fff;
  border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.35); position: relative;
}
.pin-moi-pulse {
  position: absolute; inset: -9px; border-radius: 50%; background: rgba(37,99,235,.35);
  animation: pulseMoi 1.8s ease-out infinite;
}
@keyframes pulseMoi {
  0% { transform: scale(.5); opacity: .8; }
  100% { transform: scale(2.4); opacity: 0; }
}
.popup-annonce .prix { color: var(--vert); font-weight: 800; font-size: 13px; }

/* Marqueur personnalisé */
.marker-prix {
  background: var(--vert); color: white; font-weight: 800; font-size: 11px;
  padding: 5px 9px; border-radius: 20px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  border: 2px solid white;
}
.marker-prix.occupe { background: var(--gris-clair); }

/* ===== FORMULAIRES ===== */
.page-form { max-width: 640px; margin: 30px auto; padding: 0 20px 40px; }
.form-card {
  background: white; border-radius: 16px; padding: 26px 22px; box-shadow: 0 2px 14px rgba(0,0,0,.07);
}
.form-card h2 { color: var(--vert); font-size: 19px; margin-bottom: 4px; }
.form-card .sous-titre { color: var(--gris-clair); font-size: 13px; margin-bottom: 20px; }

.champ { margin-bottom: 16px; }
.champ label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.champ .aide { font-size: 11.5px; color: var(--gris-clair); margin-top: 4px; }

.champ input[type=text], .champ input[type=email], .champ input[type=password],
.champ input[type=number], .champ input[type=tel], .champ select, .champ textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--gris-bordure); border-radius: 9px;
  font-family: inherit; font-size: 14px; background: white;
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--vert); }
.champ textarea { resize: vertical; min-height: 90px; }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grille-2 { grid-template-columns: 1fr; } }

.role-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.role-carte {
  border: 2px solid var(--gris-bordure); border-radius: 12px; padding: 16px 12px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.role-carte.selectionne { border-color: var(--vert); background: #F0FDF6; }
.role-carte .icone { font-size: 26px; margin-bottom: 6px; }
.role-carte .titre { font-weight: 800; font-size: 13.5px; color: #1A2332; }
.role-carte .desc { font-size: 11px; color: #6B7280; margin-top: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--gris-bordure); border-radius: 20px; padding: 7px 13px; font-size: 12.5px;
  cursor: pointer; user-select: none; transition: all .15s; background: white; font-weight: 600;
}
.chip.actif { background: var(--vert); color: white; border-color: var(--vert); }

.toggle-oui-non { display: flex; gap: 8px; }
.toggle-oui-non .chip { flex: 1; text-align: center; }

/* Upload photos */
.upload-zone {
  border: 2px dashed var(--gris-bordure); border-radius: 12px; padding: 20px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s; background: #FAFBFC;
}
.upload-zone:hover, .upload-zone.survol { border-color: var(--vert); background: #F0FDF6; }
.upload-zone .icone { font-size: 26px; margin-bottom: 6px; }
.upload-zone p { font-size: 12.5px; color: var(--gris-clair); }

.previsu-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 12px; }
.previsu-item { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: #eee; }
.previsu-item img, .previsu-item video { width: 100%; height: 100%; object-fit: cover; }
.previsu-item .suppr {
  position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.6); color: white; border: none;
  width: 20px; height: 20px; border-radius: 50%; font-size: 11px; cursor: pointer; line-height: 1;
}

.mini-map { width: 100%; height: 220px; border-radius: 10px; margin-top: 8px; }

.erreur-msg {
  background: #FEE2E2; color: #B91C1C; padding: 10px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; display: none;
}
.erreur-msg.visible { display: block; }
.succes-msg {
  background: #D1FAE5; color: var(--vert-fonce); padding: 10px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; display: none;
}
.succes-msg.visible { display: block; }

/* ===== DASHBOARD PROPRIÉTAIRE ===== */
.dashboard-header { max-width: 1000px; margin: 0 auto; padding: 24px 20px 0; }
.dashboard-header h1 { font-size: 20px; font-weight: 800; color: var(--texte); }
.dashboard-header p { color: var(--gris-clair); font-size: 13px; margin-top: 4px; }

.liste-dashboard { max-width: 1000px; margin: 20px auto 40px; padding: 0 20px; display: flex; flex-direction: column; gap: 12px; }

.ligne-annonce {
  background: white; border-radius: 14px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: grid; grid-template-columns: 80px 1fr auto; gap: 14px; align-items: center;
}
@media (max-width: 560px) { .ligne-annonce { grid-template-columns: 60px 1fr; } .ligne-actions { grid-column: 1/-1; } }

.ligne-annonce .miniature {
  width: 80px; height: 80px; border-radius: 10px; background: #eee; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: #999;
}
.ligne-annonce .miniature img { width: 100%; height: 100%; object-fit: cover; }
.ligne-annonce h3 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.ligne-annonce .meta { font-size: 12px; color: var(--gris-clair); }

.ligne-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ligne-actions .btn { padding: 8px 12px; font-size: 12px; }

.toggle-statut {
  display: flex; border-radius: 20px; overflow: hidden; border: 1.5px solid var(--gris-bordure); font-size: 11px; font-weight: 700;
}
.toggle-statut button { flex: 1; padding: 6px 8px; border: none; background: white; cursor: pointer; color: var(--gris-clair); }
.toggle-statut button.actif-dispo { background: var(--vert); color: white; }
.toggle-statut button.actif-occupe { background: var(--rouge); color: white; }

.etat-vide { text-align: center; padding: 60px 20px; color: var(--gris-clair); }
.etat-vide .icone { font-size: 40px; margin-bottom: 10px; }

/* ===== MODAL DÉTAIL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none;
  align-items: flex-end; justify-content: center; z-index: 5000;
}
.modal-overlay.ouverte { display: flex; }
.modal-panneau { background: white; border-radius: 18px 18px 0 0; width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto; }

/* ===== MODALES CONTACT / SIGNALEMENT ===== */
.mini-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 0;
}
.mini-modal-header h2 { font-size: 17px; color: var(--vert); }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--gris-fond);
  font-size: 15px; cursor: pointer; color: var(--texte); flex-shrink: 0;
}
.modal-close:hover { background: var(--gris-bordure); }
.mini-modal-body { box-shadow: none; padding: 16px 22px 24px; }
.mini-modal-body .btn:disabled { opacity: .6; cursor: default; }

/* ===== FOOTER ===== */
.footer {
  background: var(--fond-pied); color: white; text-align: center; padding: 24px 20px;
  font-size: 13px; line-height: 2; margin-top: 30px;
}
.footer .brand { font-size: 16px; font-weight: 800; color: var(--jaune); letter-spacing: 2px; margin-bottom: 6px; }

/* ===== BOUTONS DE SCROLL (haut / bas) — discrets et dynamiques ===== */
.scroll-nav { position: fixed; right: 12px; bottom: 84px; z-index: 750;
  display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.scroll-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(11,59,46,.72); color: #fff; backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.16);
  opacity: 0; transform: translateY(8px) scale(.85); pointer-events: none;
  transition: opacity .28s ease, transform .28s ease, background .2s ease;
}
.scroll-btn.visible { opacity: .75; transform: translateY(0) scale(1); pointer-events: auto; }
.scroll-btn:hover, .scroll-btn:active { opacity: 1; background: var(--vert); }
@media (min-width: 960px) { .scroll-nav { bottom: 28px; } }

/* ===== SPINNER ===== */
.spinner { text-align: center; color: var(--gris-clair); padding: 40px; grid-column: 1/-1; }

/* Correction carte mobile */
@media (max-width: 860px) {
  .map-wrap {
    position: relative !important;
    top: auto !important;
    margin-top: 10px !important;
    margin-bottom: 18px !important;
    margin-left: 22px !important;
    margin-right: 22px !important;
    height: 240px !important;
    min-height: 240px !important;
    max-height: 240px !important;
    overflow: hidden !important;
    border-radius: var(--radius) !important;
  }

  #carteMap {
    height: 240px !important;
    max-height: 240px !important;
    border-radius: var(--radius) !important;
  }
}

/* Boutons statistiques cliquables */
.stats-section .stat-item {
  border: none;
  cursor: pointer;
  background: white;
  border-radius: 12px;
  padding: 10px 6px;
  transition: transform .15s, box-shadow .15s;
  font-family: inherit;
}

.stats-section .stat-item:active {
  transform: scale(.96);
}

.stat-dispo {
  border: 2px solid #009E60 !important;
}

.stat-zone {
  border: 2px solid #3A75C4 !important;
}

.stat-public {
  border: 2px solid #FCD116 !important;
}

.stat-dispo .stat-num {
  color: #009E60;
}

.stat-zone .stat-num {
  color: #3A75C4;
}

.stat-public .stat-num {
  color: #C49A00;
}

/* ═══════════════════════════════════════════
   MODE SOMBRE
   Activé via la classe .theme-sombre sur <body> (voir nav.js).
   Le header et le bandeau du menu latéral restent en dégradé vert
   dans les deux modes (identité de marque).
═══════════════════════════════════════════ */
body.theme-sombre {
  --gris-fond: #10151C;
  --gris-bordure: #2A3444;
  --gris-clair: #8E9AAB;
  --texte-secondaire: #AEB8C7;
  --texte: #EAEDF2;
}

body.theme-sombre .drawer,
body.theme-sombre .bottom-nav,
body.theme-sombre .stats-section,
body.theme-sombre .stats-section .stat-item,
body.theme-sombre .carte-annonce,
body.theme-sombre .form-card,
body.theme-sombre .ligne-annonce,
body.theme-sombre .modal-panneau,
body.theme-sombre .filters-bar input,
body.theme-sombre .filters-bar select,
body.theme-sombre .champ input,
body.theme-sombre .champ select,
body.theme-sombre .champ textarea,
body.theme-sombre .chip,
body.theme-sombre .toggle-statut button,
body.theme-sombre .role-carte,
body.theme-sombre .rayon-control {
  background: #1A2130;
}
/* .btn-pres-de-moi et .btn-hotels-motels gardent leur dégradé luxe dans les deux thèmes */
body.theme-sombre .rayon-ligne { color: var(--texte); }

/* Titre des cartes d'annonce (.carte-info h3) : fixé en dur (#1A2332) car il
   était censé rester sur le fond BLANC fixe de la carte. Mais en mode sombre,
   .carte-annonce passe en fond #1A2130 (juste au-dessus) — quasi identique à
   #1A2332, ce qui rendait le titre invisible (texte foncé sur fond foncé).
   On force donc une couleur claire pour le titre uniquement en mode sombre. */
body.theme-sombre .carte-info h3 {
  color: #EAEDF2;
}

body.theme-sombre .drawer-link:hover,
body.theme-sombre .drawer-link.actif,
body.theme-sombre .role-carte.selectionne,
body.theme-sombre .upload-zone:hover,
body.theme-sombre .upload-zone.survol {
  background: #123024;
}

body.theme-sombre .upload-zone {
  background: #161C27;
}

body.theme-sombre .mini-modal-header h2,
body.theme-sombre .form-card h2,
body.theme-sombre .section-header h2 {
  color: #34D399;
}

body.theme-sombre .modal-close {
  background: #232C3D;
  color: var(--texte);
}
body.theme-sombre .modal-close:hover { background: #2A3444; }

body.theme-sombre .btn-outline { background: transparent; }

body.theme-sombre .carte-annonce .visuel,
body.theme-sombre .previsu-item,
body.theme-sombre .ligne-annonce .miniature {
  background: #232C3D;
}

body.theme-sombre .erreur-msg { background: #3B1B1B; color: #FCA5A5; }
body.theme-sombre .succes-msg { background: #12301F; color: #6EE7B7; }

body.theme-sombre .badge-disponible { background: #12301F; }
body.theme-sombre .badge-occupe { background: #3B1B1B; }
body.theme-sombre .badge-vendeur-entreprise { background: #16233F; color: #93C5FD; }
body.theme-sombre .badge-vendeur-verifie { background: #12301F; }
body.theme-sombre .badge-vendeur-particulier { background: rgba(255,255,255,.08); color: var(--texte); }

body.theme-sombre .etat-vide { color: var(--gris-clair); }

body.theme-sombre .icon-btn {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.22);
}

/* Contrôles natifs (select, checkbox, scrollbars) : indique au navigateur de
   dessiner ses propres widgets dans une variante sombre, pour un rendu
   professionnel et cohérent même sur les <select> non stylés ailleurs. */
body.theme-sombre { color-scheme: dark; }

/* Texte des placeholders, plus doux que le texte plein en mode sombre */
body.theme-sombre ::placeholder { color: var(--gris-clair); opacity: .8; }

/* Champ de recherche du héros : pas de fond défini par défaut (le navigateur
   utilise du blanc), ce qui rendait le texte illisible une fois --texte
   éclairci en mode sombre. */
body.theme-sombre .search-bar input {
  background: #1A2130;
  color: var(--texte);
}

/* Bouton "rouge" (annuler/supprimer) : la version pastel claire d'origine
   jurait sur fond sombre — on la remplace par une variante sombre assortie
   aux badges "occupé"/erreur déjà adaptés plus haut. */
body.theme-sombre .btn-rouge { background: #3B1B1B; color: #FCA5A5; }
body.theme-sombre .btn-rouge:hover { background: #4A2222; }

/* Bouton mode sombre du header : rotation douce de l'icône au clic */
#btnTheme { transition: transform .25s ease, background .15s; }
#btnTheme:active { transform: rotate(20deg) scale(.9); }

/* ══════════ CENTRE D'ALERTES (🔔 en-tête) ══════════
   Panneau déroulant injecté dynamiquement par nav.js (voir initCentreAlertes).
   Remplace l'icône de traduction dans le header — celle-ci reste dans le
   menu ☰ et dans Paramètres. À ne pas confondre avec le réglage "Activer les
   notifications" (notifications push du téléphone), qui reste inchangé. */
.alertes-panel {
  position: fixed; top: 62px; right: 10px; width: min(340px, calc(100vw - 20px));
  max-height: 70vh; background: var(--fond-carte, #fff); border: 1px solid var(--gris-bordure, #E2E8F0);
  border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.18); z-index: 999;
  display: none; flex-direction: column; overflow: hidden;
}
.alertes-panel.ouvert { display: flex; }
.alertes-titre {
  padding: 12px 14px; font-weight: 800; font-size: 14px; color: var(--vert-fonce, #0B4D2E);
  border-bottom: 1px solid var(--gris-bordure, #E2E8F0);
}
.alertes-liste { overflow-y: auto; max-height: 44vh; }
.alertes-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px;
  text-decoration: none; color: var(--texte, #1A2130); border-bottom: 1px solid rgba(0,0,0,.05);
  font-size: 12.8px; line-height: 1.35;
}
.alertes-item:last-child { border-bottom: none; }
.alertes-item.non-vue { background: rgba(16,185,129,.07); font-weight: 600; }
.alertes-icone { flex-shrink: 0; font-size: 15px; }
.alertes-vide { padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--gris-clair, #8A94A6); }
.alertes-prefs-toggle {
  border: none; background: transparent; padding: 10px 14px; font-size: 11.5px;
  color: var(--gris-clair, #8A94A6); text-align: left; cursor: pointer;
  border-top: 1px solid var(--gris-bordure, #E2E8F0);
}
.alertes-prefs {
  padding: 4px 14px 12px; flex-direction: column; gap: 6px; font-size: 12px;
}
.alertes-prefs label { display: flex; align-items: center; gap: 7px; }

body.theme-sombre .alertes-panel { background: #1A2130; border-color: #2A3346; }
body.theme-sombre .alertes-titre,
body.theme-sombre .alertes-item { border-color: rgba(255,255,255,.08); }
body.theme-sombre .alertes-item.non-vue { background: rgba(16,185,129,.12); }
