/* ==========================================================================
   Vitrine "Nos biens" — remplace Bootstrap (que fournissait Odoo)
   Tout est scopé sous #vitrine pour ne jamais entrer en conflit
   avec style.css. Environ 6 Ko contre 190 Ko pour Bootstrap.
   ========================================================================== */

/* --- Grille -------------------------------------------------------------- */
#vitrine .row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
#vitrine [class*="col-"] { padding: 0 12px; width: 100%; }

#vitrine .g-2 { row-gap: 8px; }
#vitrine .g-3 { row-gap: 16px; }
#vitrine .g-4 { row-gap: 28px; }

#vitrine .col-12 { width: 100%; }
#vitrine .col-6  { width: 50%; }

@media (min-width: 768px) {
  #vitrine .col-md-3 { width: 25%; }
  #vitrine .col-md-5 { width: 41.666%; }
  #vitrine .col-md-6 { width: 50%; }
  #vitrine .col-md-7 { width: 58.333%; }
}
@media (min-width: 992px) {
  #vitrine .col-lg-1 { width: 8.333%; }
  #vitrine .col-lg-2 { width: 16.666%; }
  #vitrine .col-lg-4 { width: 33.333%; }
  #vitrine .col-lg-5 { width: 41.666%; }
  #vitrine .col-lg-7 { width: 58.333%; }
}

/* --- Utilitaires --------------------------------------------------------- */
#vitrine .d-flex { display: flex; }
#vitrine .flex-wrap { flex-wrap: wrap; }
#vitrine .flex-column { flex-direction: column; }
#vitrine .flex-grow-1 { flex: 1; min-width: 0; }
#vitrine .align-items-end { align-items: flex-end; }
#vitrine .align-items-center { align-items: center; }
#vitrine .align-items-start { align-items: flex-start; }
#vitrine .justify-content-between { justify-content: space-between; }
#vitrine .justify-content-center { justify-content: center; }
#vitrine .gap-2 { gap: 8px; }
#vitrine .gap-3 { gap: 16px; }

#vitrine .w-100 { width: 100%; }
#vitrine .mb-0 { margin-bottom: 0; }
#vitrine .mb-1 { margin-bottom: 4px; }
#vitrine .mb-2 { margin-bottom: 8px; }
#vitrine .mb-3 { margin-bottom: 16px; }
#vitrine .mb-4 { margin-bottom: 24px; }
#vitrine .mt-3 { margin-top: 16px; }
#vitrine .p-3 { padding: 16px; }
#vitrine .py-4 { padding-top: 24px; padding-bottom: 24px; }

#vitrine .text-muted { color: var(--texte-doux); }
#vitrine .text-center { text-align: center; }
#vitrine .fw-bold { font-weight: 700; }
#vitrine .fw-semibold { font-weight: 600; }
#vitrine .small { font-size: 0.85rem; }
#vitrine .bg-light { background: var(--gris-fond); }
#vitrine .rounded { border-radius: 0; }
#vitrine .img-fluid { max-width: 100%; height: auto; }

#vitrine .h4 { font-family: var(--f-titre); font-size: 1.5rem; font-weight: 700; color: var(--navy); }
#vitrine .h6 { font-family: var(--f-titre); font-size: 1rem; font-weight: 700; color: var(--navy); }

/* --- Formulaire de filtres ---------------------------------------------- */
#vitrine .form-label {
  display: block; margin-bottom: 5px;
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--navy);
}
#vitrine .form-control,
#vitrine .form-select {
  width: 100%; padding: 9px 11px;
  font-family: var(--f-texte); font-size: 0.92rem; color: var(--texte);
  background: var(--blanc);
  border: 1px solid var(--gris-bord); border-radius: 0;
  transition: border-color 0.2s;
}
#vitrine .form-control:focus,
#vitrine .form-select:focus {
  border-color: var(--navy); outline: none;
  box-shadow: 0 0 0 3px rgba(220, 178, 83, 0.35);
}

/* --- Cartes -------------------------------------------------------------- */
#vitrine .card {
  display: flex; flex-direction: column;
  background: var(--blanc);
  border: 1px solid var(--gris-bord);
}
#vitrine .card-body { flex: 1; padding: 18px; }
#vitrine .card-footer {
  padding: 14px 18px;
  background: var(--gris-fond);
  border-top: 1px solid var(--gris-bord);
}
#vitrine .card-title {
  font-family: var(--f-titre); font-size: 1.15rem; font-weight: 700;
  color: var(--navy); margin: 0 0 6px;
}
#vitrine .card-text { font-size: 0.9rem; margin: 0 0 8px; }
#vitrine .card-img-top { width: 100%; }

#vitrine .prop-card-img { object-fit: cover; height: 220px; width: 100%; }
#vitrine .prop-card { height: 100%; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
#vitrine .prop-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(2, 41, 80, 0.13); }

/* --- Boutons ------------------------------------------------------------- */
#vitrine .btn {
  display: inline-block; padding: 10px 20px;
  font-family: var(--f-texte); font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  border: 2px solid transparent; border-radius: 0;
  cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
#vitrine .btn-sm { padding: 7px 14px; font-size: 0.75rem; }
#vitrine .btn-primary { background: var(--navy); color: var(--blanc); border-color: var(--navy); }
#vitrine .btn-primary:hover { background: var(--or); border-color: var(--or); color: var(--navy); }
#vitrine .btn-outline-primary { background: transparent; color: var(--navy); border-color: var(--navy); }
#vitrine .btn-outline-primary:hover { background: var(--navy); color: var(--blanc); }
#vitrine .btn-light { background: var(--gris-fond); color: var(--texte); border-color: var(--gris-bord); }
#vitrine .btn-light:hover { background: var(--gris-bord); }
#vitrine .btn.disabled { opacity: 0.4; pointer-events: none; }

#vitrine .btn-close {
  width: 34px; height: 34px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font-size: 0; line-height: 0;
}
#vitrine .btn-close::before {
  content: "\00d7"; font-size: 30px; line-height: 1;
  color: var(--texte-doux);
}
#vitrine .btn-close:hover::before { color: var(--navy); }

/* --- Modale -------------------------------------------------------------- */
#vitrine .modal {
  position: fixed; inset: 0;
  background: rgba(2, 26, 51, 0.7);
  z-index: 1050; overflow: auto;
  padding: 20px;
}
#vitrine .modal-dialog { max-width: 1140px; margin: 40px auto; }
#vitrine .modal-content { background: var(--blanc); border: 1px solid var(--gris-bord); }
#vitrine .modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 24px;
  border-bottom: 1px solid var(--gris-bord);
}
#vitrine .modal-title {
  font-family: var(--f-titre); font-size: 1.35rem; font-weight: 700;
  color: var(--navy); margin: 0;
}
#vitrine .modal-body { padding: 24px; }
#vitrine .modal-footer {
  padding: 16px 24px; text-align: right;
  border-top: 1px solid var(--gris-bord);
  background: var(--gris-fond);
}
#vitrine .img-thumbnail {
  border: 1px solid var(--gris-bord); padding: 2px;
  cursor: pointer; transition: border-color 0.2s;
}
#vitrine .img-thumbnail:hover { border-color: var(--or); }

/* --- Étiquettes DPE ------------------------------------------------------ */
#vitrine .dpe-pill {
  font-size: 0.78rem; border-radius: 999px; padding: 3px 9px;
  line-height: 1; display: inline-flex; gap: 5px; align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.08); font-weight: 700;
}
#vitrine .dpe-dot { width: 10px; height: 10px; border-radius: 50%; }

/* --- Agent --------------------------------------------------------------- */
#vitrine .agent { display: flex; align-items: center; gap: 10px; }
#vitrine .agent img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
#vitrine .agent .agent-name { font-weight: 700; line-height: 1.2; font-size: 0.9rem; color: var(--navy); }
#vitrine .agent .agent-phone { font-size: 0.85rem; }
#vitrine .agent-card { border: 1px solid var(--gris-bord); background: var(--blanc); }
#vitrine .agent-card .agent-photo { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: var(--gris-fond); }

/* --- Alerte -------------------------------------------------------------- */
#vitrine .alert { padding: 16px 20px; border-left: 4px solid; }
#vitrine .alert-warning { background: #fdf6e8; border-color: var(--or-dark); color: #6b4f13; }

/* --- Barre de filtres ---------------------------------------------------- */
#vitrine .filtres {
  background: var(--blanc);
  border: 1px solid var(--gris-bord);
  border-top: 3px solid var(--or);
  padding: 20px;
  margin-bottom: 32px;
}
#vitrine .compteur {
  font-size: 0.9rem; color: var(--texte-doux);
  margin-bottom: 20px;
}
#vitrine .compteur strong { color: var(--navy); font-size: 1.1rem; }

@media (max-width: 640px) {
  #vitrine .modal { padding: 0; }
  #vitrine .modal-dialog { margin: 0; }
  #vitrine .prop-card-img { height: 190px; }
}

/* ==========================================================================
   Corrections mobile + animations au survol
   ========================================================================== */

/* --- SVG DPE : fluide au lieu de 260px fixes (la lettre G etait coupee) --- */
#vitrine .dpe-svg { width: 100%; max-width: 300px; height: auto; display: block; }

/* --- Zoom de la photo au survol ----------------------------------------- */
#vitrine .prop-media {
  margin: 0;
  overflow: hidden;
  position: relative;
  background: var(--navy-dark);
}
#vitrine .prop-media img {
  display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
#vitrine .prop-card:hover .prop-media img { transform: scale(1.07); }

/* Voile navy qui monte au survol */
#vitrine .prop-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(2, 41, 80, 0.55) 0%, rgba(2, 41, 80, 0) 55%);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
#vitrine .prop-card:hover .prop-media::after { opacity: 1; }

/* Mention "Voir le bien" qui apparait */
#vitrine .prop-media::before {
  content: "Voir le bien";
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 1;
  padding: 14px 18px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--or);
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
#vitrine .prop-card:hover .prop-media::before { transform: translateY(0); }

/* Filet or qui se deploie sous le titre */
#vitrine .prop-card .card-title { position: relative; padding-bottom: 8px; }
#vitrine .prop-card .card-title::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--or);
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
#vitrine .prop-card:hover .card-title::after { width: 42px; }

/* Focus clavier : meme rendu que le survol */
#vitrine .prop-card:focus-visible {
  outline: 3px solid var(--or); outline-offset: 3px;
}
#vitrine .prop-card:focus-visible .prop-media img { transform: scale(1.07); }

/* --- Corrections mobile -------------------------------------------------- */
@media (max-width: 640px) {
  #vitrine .modal-body { padding: 16px; }
  #vitrine .modal-header { padding: 14px 16px; }
  #vitrine .modal-footer { padding: 12px 16px; }
  #vitrine .modal-content { min-height: 100vh; }
  #vitrine .filtres { padding: 16px; }
  #vitrine .form-label { font-size: 0.68rem; letter-spacing: 0.03em; }
  #vitrine .agent-card .d-flex { flex-wrap: wrap; }
  /* Vignettes de la modale : defilement horizontal plutot qu'empilement */
  #vitrine #prop-modal-thumbs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  #vitrine #prop-modal-thumbs img { flex: 0 0 auto; }
}

/* Le survol n'existe pas au doigt : on neutralise pour eviter les etats colles */
@media (hover: none) {
  #vitrine .prop-card:hover .prop-media img { transform: none; }
  #vitrine .prop-card:hover .prop-media::after,
  #vitrine .prop-card:hover .prop-media::before { opacity: 0; transform: translateY(100%); }
  #vitrine .prop-card:hover { transform: none; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  #vitrine .prop-media img,
  #vitrine .prop-media::after,
  #vitrine .prop-media::before,
  #vitrine .prop-card,
  #vitrine .prop-card .card-title::after { transition: none !important; }
  #vitrine .prop-card:hover .prop-media img { transform: none; }
}
