/* =====================================================================
   BGFI Immobilier — Responsive Fixes (mobile & tablette uniquement)
   Le design desktop (>= 1280px) n'est jamais modifié.
   ===================================================================== */

/* ============ 1. BANNIÈRE HOMEPAGE (.hero) ============ */
@media (max-width: 1024px) {
  .hero {
    min-height: 78vh;
  }

  .hero-logo {
    width: 110px;
    margin: 0 auto 22px;
  }

  .hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem) !important;
    margin-bottom: 18px;
  }

  .hero .tagline {
    font-size: 1.05rem;
    margin: 0 auto 28px;
    max-width: 560px;
  }

  .hero-content {
    padding: 0 24px;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 70vh;
  }

  .hero-logo {
    width: 92px;
    margin: 0 auto 18px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 7vw, 2.6rem) !important;
    margin-bottom: 14px;
  }

  .hero .tagline {
    font-size: .98rem;
    margin-bottom: 22px;
    line-height: 1.55;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-actions .btn {
    padding: 12px 22px;
    font-size: .85rem;
  }

  .hero-scroll {
    bottom: 18px;
    font-size: .68rem;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 64vh;
  }

  .hero-logo {
    width: 78px;
    margin: 0 auto 14px;
  }

  .hero h1 {
    font-size: 1.7rem !important;
    line-height: 1.15;
  }

  .hero .tagline {
    font-size: .92rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    padding: 0 16px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============ 2. SECTION "À PROPOS" — BLOC DIRECTEUR ============ */
/* Empilement vertical propre sur tablette/mobile */
@media (max-width: 992px) {
  .split {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .split>div {
    width: 100%;
  }

  .split .media.dg-media {
    max-width: 520px;
    margin: 0 auto;
  }

  .split .media.dg-media img {
    height: auto !important;
    max-height: 460px;
    aspect-ratio: 4/5;
  }

  .dg-caption {
    margin-top: 16px;
  }

  .split h2 {
    text-align: left;
  }

  .split a.btn {
    margin-top: 20px !important;
  }
}

@media (max-width: 600px) {
  .split {
    gap: 24px !important;
  }

  .split .media.dg-media img {
    max-height: 380px;
    aspect-ratio: 3/4;
  }

  .dg-caption {
    padding: 14px 12px;
  }

  .dg-caption .dg-name {
    font-size: 1.1rem;
  }

  .dg-caption small {
    font-size: .72rem;
    letter-spacing: .1em;
  }

  .split a.btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============ 3. FIL D'ARIANE (.breadcrumb / .crumb) ============ */
.breadcrumb-bar {
  overflow-x: hidden;
}

.breadcrumb,
.page-hero .crumb {
  flex-wrap: wrap;
  word-break: break-word;
  max-width: 100%;
}

@media (max-width: 768px) {
  .breadcrumb-bar {
    padding: 10px 0;
  }

  .breadcrumb {
    font-size: .78rem !important;
    gap: 6px !important;
    line-height: 1.5;
  }

  .breadcrumb a,
  .breadcrumb .current {
    display: inline-block;
  }

  .breadcrumb .current {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .breadcrumb i {
    font-size: .55rem !important;
  }

  .page-hero .crumb {
    font-size: .75rem !important;
    gap: 6px;
    justify-content: center;
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .breadcrumb {
    font-size: .72rem !important;
    gap: 4px !important;
  }
}

/* ============ 4. SLIDER ENGAGEMENTS — aligné sur le slider Services ============ */
/* Sur tablette/mobile, on force le scroll horizontal façon services-carousel */
@media (max-width: 1024px) {
  .engagements-carousel {
    padding: 24px 56px;
    position: relative;
  }

  .engagements-carousel .card-grid {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 20px !important;
    padding: 4px 4px 16px;
    -webkit-overflow-scrolling: touch;
  }

  .engagements-carousel .card-grid::-webkit-scrollbar {
    display: none;
  }

  .engagements-carousel .card-grid>.card {
    flex: 0 0 calc(50% - 10px);
    min-width: 0;
    scroll-snap-align: start;
  }
}

@media (max-width: 768px) {
  .engagements-carousel {
    padding: 20px 44px;
  }

  .engagements-carousel .card-grid {
    gap: 16px !important;
  }

  .engagements-carousel .card-grid>.card {
    flex: 0 0 calc(100% - 2px);
  }

  .engagements-carousel .nav-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: .85rem !important;
  }

  .engagements-carousel .nav-btn.prev {
    left: 2px !important;
  }

  .engagements-carousel .nav-btn.next {
    right: 2px !important;
  }
}

@media (max-width: 480px) {
  .engagements-carousel {
    padding: 16px 36px;
  }

  .engagements-carousel .card-grid>.card {
    flex: 0 0 100%;
  }
}

/* ============ 5. PAGE CONTACT — Formulaire ============ */
@media (max-width: 880px) {
  .contact-form {
    padding: 24px 20px;
  }

  .contact-form .row2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .contact-form .field input,
  .contact-form .field textarea {
    font-size: 16px;
    /* évite le zoom iOS */
    width: 100%;
  }

  .contact-form button {
    width: 100%;
    padding: 14px 20px;
  }
}

@media (max-width: 480px) {
  .contact-form h3 {
    font-size: 1.25rem;
  }

  .contact-form {
    padding: 20px 16px;
  }
}

/* ============ 6. AUDIT GLOBAL — sécurités responsive ============ */
@media (max-width: 1024px) {

  /* Empêche tout débordement horizontal de page */
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  img,
  video {
    max-width: 100%;
    height: auto;
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Typographies : éviter les titres écrasés */
  h1 {
    line-height: 1.15;
    word-wrap: break-word;
  }

  h2 {
    line-height: 1.2;
    word-wrap: break-word;
  }

  /* Boutons : ne jamais déborder */
  .btn {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Grilles courantes : 1 ou 2 colonnes selon le contenu */
  .values-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Modales/overlays : marges raisonnables */
  .lightbox-content,
  .modal-content {
    max-width: 92vw !important;
    max-height: 88vh !important;
  }
}

@media (max-width: 480px) {

  /* Section padding réduits */
  .section {
    padding-top: 48px;
    padding-bottom: 48px;
  }
}