/* =========================
   RESPONSIVE GLOBAL
========================= */

@media (max-width: 1200px) {
  .nav-list {
    gap: 18px;
  }

  .nav-list a,
  .nav-current {
    font-size: 0.92rem;
  }
}

/* =========================
   TABLETTE / PETIT DESKTOP
========================= */

@media (max-width: 992px) {
  .header-inner {
    gap: 14px;
  }

  .menu-toggle {
    display: inline-block;
    order: 2;
  }

  .header-social-link {
    order: 1;
    margin-left: auto;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(24, 49, 38, 0.1);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.12);
    transition: max-height 0.35s ease;
  }

  .main-nav.is-open {
    max-height: 440px;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 18px 16px 20px;
  }

  .nav-list li {
    width: 100%;
    border-bottom: 1px solid rgba(24, 49, 38, 0.08);
  }

  .nav-list li:last-child {
    border-bottom: none;
  }

  .nav-list a,
  .nav-current {
    display: block;
    width: 100%;
    padding: 14px 0;
  }

  .hero,
  .parcelle-hero {
    min-height: auto;
    padding: 58px 0;
  }

  .terrain-card {
    flex-basis: calc(50% - 15px);
    max-width: calc(50% - 15px);
  }

  .gallery-item {
    flex-basis: calc(50% - 10px);
  }

  #vista-map {
    height: 74vh;
    min-height: 480px;
  }

  .vista-map-reset-btn {
    top: 112px;
    right: 12px;
  }

  .vista-map-toolbar-toggle {
    top: 160px;
    right: 12px;
  }

  .vista-map-toolbar {
    top: 208px;
    right: 12px;
  }
}

/* =========================
   TABLETTE / MOBILE LARGE
========================= */

@media (max-width: 768px) {
  .section-light,
  .section-soft {
    padding: 52px 0;
  }

  .hero h1,
  .parcelle-hero h1 {
    font-size: clamp(2rem, 9vw, 3.1rem);
  }

  .hero-actions {
    align-items: flex-start;
  }

  .terrain-card {
    flex: 0 1 min(100%, 420px);
    max-width: min(100%, 420px);
  }

  .legal-cards article {
    flex-basis: 100%;
  }

  .legal-page {
    padding: 52px 0;
  }

  .legal-points-columns {
    columns: 1;
  }

  .parcelle-summary-card {
    flex-basis: 100%;
  }

  .gallery-item {
    flex: 0 1 min(100%, 420px);
  }

  .footer-inner,
  .footer-bottom-simple {
    justify-content: center;
    text-align: center;
  }

  .summary-type {
    width: 100%;
  }

  .summary-type-list {
    columns: 1;
  }

  .vista-map-page {
    padding: 8px 6px 14px;
  }

  #vista-map {
    height: 70vh;
    min-height: 420px;
    border-radius: 16px;
  }

  .vista-map-select {
    min-width: 220px;
    width: auto;
    max-width: 100%;
  }

  .vista-map-reset-btn {
    top: 108px;
    right: 10px;
    bottom: auto;
    left: auto;
    width: auto;
    min-width: 0;
    padding: 0 14px;
  }

  .vista-map-toolbar-toggle {
    top: 156px;
    right: 10px;
    left: auto;
  }

  .vista-map-toolbar {
    top: 204px;
    right: 10px;
    left: auto;
    width: auto;
    max-width: calc(100% - 20px);
  }

  .leaflet-top.leaflet-right {
    top: 10px;
    right: 10px;
  }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 576px) {
  .container {
    width: min(var(--container-width), calc(100% - 32px));
  }

  .brand-text {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .hero-highlights {
    align-items: flex-start;
  }

  .highlight-list {
    justify-content: flex-start;
  }

  .card-actions,
  .inline-actions,
  .contact-actions {
    align-items: stretch;
  }

  .card-actions .btn-link,
  .inline-actions .btn-link,
  .contact-actions .btn {
    width: 100%;
  }

  .legal-hero-badges,
  .legal-card-list,
  .legal-check-grid,
  .legal-related-links {
    flex-direction: column;
  }

.legal-related-links a {
  width: 100%;
}
.parcelle-hero-badges,
.legal-hero-badges {
  align-items: flex-start;
}

  .parcelle-lots-table th,
  .parcelle-lots-table td {
    padding: 10px;
    font-size: 0.88rem;
  }

  .gallery-lightbox-dialog {
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
  }

  .gallery-lightbox-close {
    top: 8px;
    right: 8px;
  }

  .gallery-lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
  }

  .gallery-lightbox-prev {
    left: 8px;
  }

  .gallery-lightbox-next {
    right: 8px;
  }

  .map-popup-gallery {
    grid-template-columns: 1fr;
    gap: 10px;
    justify-items: center;
  }

  .map-popup-gallery__item {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible !important;
  }

  .map-popup-gallery__item img {
    width: 148px;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
  }

  .map-popup-gallery__item:first-child img,
  .map-popup-gallery__item:last-child img {
    transform-origin: center center;
  }

  .map-popup-gallery__item:first-child:hover img,
  .map-popup-gallery__item:last-child:hover img {
    transform: scale(1.7);
    box-shadow: 0 16px 28px rgba(24, 39, 48, 0.28);
    z-index: 30;
  }
}