/* Ligne de la ferme dans le bloc d'informations : le nom à gauche (il peut
   passer à la ligne), le bouton d'actions calé en haut à droite. */
.parcelle-popup .farm-row {
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.parcelle-popup .farm-row .farm {
    min-width: 0;
    padding-top: 8px;
}

/* Bouton « Naviguer » (mode ferme) et bouton « Actions » (staff, ActionMenu.js) */
.action-menu {
    position: relative;
    flex-shrink: 0;
}

.popup-action-button,
.action-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    min-height: 31px;
    padding: 0 12px;
    /* Bleu « lien » : une action, sans concurrencer l'accent rouge de la popup. */
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    background: #eff6ff;
    color: #1d4ed8;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease;
}

.popup-action-button:hover,
.action-menu-button:hover,
.action-menu-button[aria-expanded="true"] {
    background: #dbeafe;
}

/* Le transform de la popup MapLibre borne ce calque à la popup (cf. ActionMenu.js). */
.action-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
}

.action-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 21;
    min-width: 15rem;
    padding: 4px 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.action-menu-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 6px 12px;
    border: none;
    background: none;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    /* Même hauteur pour un <a> et un <button>, qui n'héritent pas pareil. */
    line-height: 1.3;
    color: #1f2937;
    text-decoration: none;
    cursor: pointer;
}

.action-menu-item:hover {
    background: #f3f4f6;
}

.action-menu-item[aria-disabled="true"] {
    opacity: 0.45;
    cursor: default;
}

.action-menu-item[aria-disabled="true"]:hover {
    background: none;
}

.action-menu-hint {
    font-size: 12px;
    color: #6b7280;
}

/* Feuille « Naviguer vers » (NavigationSheet.js), sur le modèle de .comment-modal */
.nav-sheet {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.nav-sheet.active {
    opacity: 1;
    visibility: visible;
}

.nav-sheet-content {
    width: 100%;
    /* 400 px au bureau, 75 % de l'écran sur téléphone : voir ViewPanel.css. */
    max-width: min(400px, 75vw);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.nav-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.nav-sheet-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

/* Même bouton que .comment-modal-close (popup.css). */
.nav-sheet-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
}

.nav-sheet-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.nav-sheet-body {
    padding: 16px;
}

.nav-sheet-sources {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.nav-sheet-source {
    flex: 1;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

/* Même bleu « lien » que le bouton d'actions : le rouge reste à l'en-tête. */
.nav-sheet-source.active {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.nav-sheet-destination {
    margin: 0;
    font-weight: 600;
    color: #1f2937;
    overflow-wrap: anywhere;
}

.nav-sheet-coords {
    margin: 2px 0 0;
    font-size: 12px;
    color: #6b7280;
}

.nav-sheet-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.nav-sheet-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 15px;
    text-decoration: none;
}

.nav-sheet-link:hover {
    background: #e5e7eb;
}

.nav-sheet-copy {
    min-height: 44px;
    padding: 0 12px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.nav-sheet-copy:hover {
    color: #111827;
}
