/* -----------------------------------------------
   Styles spécifiques pour /address
----------------------------------------------- */

/* Form wrapper & suggestions */
.address-form-wrapper {
  position: relative;
  max-width: 520px;
}

.suggestions {
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  position: absolute;
  z-index: 10;
  width: 100%;
}

.suggestion-item {
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

.suggestion-item:hover {
  background: #f0f0f0;
}

/* Address Map */
#addressMap {
  height: 70vh;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #ddd;
}

/* Table official vs technique */
#addressSystemsTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

#addressSystemsTable th {
  background: #f5f5f5;
}

#addressSystemsTable tbody tr:hover {
  background-color: #f8f8f8;
}

/* Toggle technical rows button */
.btn-link {
  background: none;
  border: none;
  color: var(--phit-primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
}

#mapWrapper {
  position: relative;
  width: 100%;
  background: #fff;
  padding: 4px;
}

#aleaLegend {
  margin-top: 4px;
  font-size: 0.9rem;
}

#aleaLegend span {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
}

/* Ligne séparateur tableau technique */
.tech-toggle-row td {
  background: var(--color-background-secondary, #f5f5f5);
  border-top: 1px solid var(--color-border-tertiary, #ddd);
}

/* -----------------------------------------------
   Mobile : #addressSystemsTable en cartes empilées
   Libellés via data-label (posés en JS dans makeRow),
   i18n-ready : ne pas coder les libellés en dur ici.
   Desktop (>768px) inchangé.
----------------------------------------------- */
@media (max-width: 768px) {
  #addressSystemsTable thead {
    /* en-tête desktop masqué : les labels passent par data-label */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  #addressSystemsTable,
  #addressSystemsTable tbody,
  #addressSystemsTable tr,
  #addressSystemsTable td {
    display: block;
    width: 100%;
  }

  #addressSystemsTable tr {
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: #fff;
  }

  #addressSystemsTable td {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.4rem 0.25rem;
    text-align: left;
  }

  #addressSystemsTable td:last-child {
    border-bottom: none;
  }

  /* Libellé de colonne issu de data-label */
  #addressSystemsTable td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
  }

  /* Source officielle : gardée en bas de carte, en petit (point 3).
     Ciblage par classe .col-source (i18n-safe, indépendant du libellé). */
  #addressSystemsTable td.col-source {
    font-size: 0.8rem;
    color: var(--phit-muted, #6b7280);
  }

  /* Ligne toggle technique : reste pleine largeur, bouton centré */
  #addressSystemsTable .tech-toggle-row td::before {
    content: none;
  }
  #addressSystemsTable .tech-toggle-row td {
    text-align: center;
    border-bottom: none;
  }
}
