/**
 * Fiche terrain — retour, galerie, partage, lien vendeur (09/10/2026).
 * Reprend les variables de mapp-portail-design.css (--mapp-mint, --mapp-orange…).
 */

/* 1. Retour aux annonces : en haut ; barre fixe sur téléphone. */
.mapp-fiche-retour {
  margin: 0 0 0.75rem;
}
.mapp-fiche-retour__lien {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  font-weight: 700;
  color: var(--mapp-black, #2a2a2a);
  text-decoration: none;
}
.mapp-fiche-retour__lien:hover,
.mapp-fiche-retour__lien:focus-visible {
  color: var(--mapp-mint, #5EC7A5);
}

/* 2. Galerie : chaque photo est un lien vers la galerie plein écran. */
.mapp-portail-gallery__main {
  position: relative;
}
.mapp-fiche-photo {
  display: block;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
}
.mapp-fiche-photo[hidden] {
  display: none;
}
.mapp-portail-gallery__main .mapp-fiche-photo {
  height: 100%;
  border-radius: var(--mapp-radius, 14px);
}
.mapp-portail-gallery__side > .mapp-fiche-photo:has(.mapp-portail-gallery__more) {
  grid-column: span 2;
}
.mapp-fiche-photo .mapp-portail-gallery__more {
  height: 100%;
}
.mapp-fiche-photo:focus-visible {
  outline: 3px solid var(--mapp-mint, #5EC7A5);
  outline-offset: 2px;
}
.mapp-fiche-badge-photos {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 50px;
  background: rgba(42, 42, 42, 0.78);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  pointer-events: none;
}
.pswp__custom-caption {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
}

/* 3. Partager cette annonce. */
.mapp-fiche-partage {
  position: relative;
  margin: -0.5rem 0 1.5rem;
}
.mapp-fiche-partage__btn {
  min-height: 44px;
}
.mapp-fiche-partage__menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--mapp-border, #e8e8e8);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.mapp-fiche-partage__menu[hidden] {
  display: none;
}
.mapp-fiche-partage__menu a,
.mapp-fiche-partage__menu button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--mapp-black, #2a2a2a);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.mapp-fiche-partage__menu a:hover,
.mapp-fiche-partage__menu button:hover,
.mapp-fiche-partage__menu a:focus-visible,
.mapp-fiche-partage__menu button:focus-visible {
  background: var(--mapp-bg-alt, #fafafa);
}
.mapp-fiche-partage__ok {
  padding: 0 12px;
  color: var(--mapp-mint, #5EC7A5);
  font-weight: 700;
}
.mapp-fiche-partage__ok:empty {
  display: none;
}

/* 4b. Vous êtes le vendeur ? */
.mapp-fiche-vendeur {
  margin: 2rem 0;
  font-size: 0.9rem;
  color: var(--mapp-muted, #666);
}
.mapp-fiche-vendeur summary {
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.mapp-fiche-vendeur__form {
  display: grid;
  gap: 0.5rem;
  max-width: 420px;
  margin-top: 0.5rem;
}
.mapp-fiche-vendeur__form input[type="email"] {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--mapp-border, #e8e8e8);
  border-radius: 8px;
  font: inherit;
}
.mapp-fiche-vendeur__message {
  margin: 0.5rem 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(94, 199, 165, 0.12);
  color: var(--mapp-black, #2a2a2a);
}

/* Barre du bas : téléphone seulement. */
.mapp-fiche-barre-bas {
  display: none;
}

@media (max-width: 767px) {
  .mapp-fiche-retour {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0 -16px 0.75rem;
    padding: 4px 16px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--mapp-border, #e8e8e8);
  }
  .mapp-fiche-barre-bas {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    gap: 8px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--mapp-border, #e8e8e8);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  }
  .mapp-fiche-barre-bas > * {
    flex: 1;
    min-height: 44px;
    justify-content: center;
  }
  .mapp-portail-single {
    padding-bottom: 76px;
  }
  .mapp-fiche-partage__menu {
    position: fixed;
    top: auto;
    left: 16px;
    right: 16px;
    bottom: 76px;
  }
}
