/* Shared Leaflet UI: custom zoom/locate (no default white control bar) + draw toolbars */

/* Vertical stack: zoom (+/−/locate) then draw tools — anchored top-left of map host */
.agro-lf-tools-column {
    position: absolute;
    z-index: 1000;
    left: 12px;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    pointer-events: none;
}

.agro-lf-tools-column > * {
    pointer-events: auto;
}

/* Leaflet layer + “zoom checked” sit above; drop custom column below them */
.agro-lf-tools-below-layer-ctl .agro-lf-tools-column {
    top: 108px;
}

/* Zoom in, zoom out, locate — card stack */
.agro-lf-zoom-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 18px rgba(15, 26, 12, 0.12);
}

.agro-lf-zoom-stack.leaflet-bar {
    box-shadow: 0 4px 18px rgba(15, 26, 12, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.agro-lf-icon-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.agro-lf-icon-btn:hover {
    background: #f9fafb;
    border-color: #4a7c23;
    color: #4a7c23;
}

.agro-lf-icon-btn:focus-visible {
    outline: 2px solid #4a7c23;
    outline-offset: 2px;
}

.agro-lf-icon-btn--locate {
    font-size: 1.15rem;
}

/* Draw toolbar + HUD (MyFarms + optional reuse) */
.agro-lf-draw-toolbar {
    position: absolute;
    z-index: 1000;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 18px rgba(15, 26, 12, 0.12);
}

.agro-lf-tools-column > .agro-lf-draw-toolbar {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    z-index: auto;
}

@media (max-width: 575.98px) {
    .agro-lf-tools-column {
        left: 8px;
        top: 8px;
    }

    .agro-lf-tools-below-layer-ctl .agro-lf-tools-column {
        top: 96px;
    }
}

.agro-lf-draw-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.agro-lf-draw-btn:hover {
    background: #f9fafb;
    border-color: #4a7c23;
    color: #4a7c23;
}

.agro-lf-draw-btn.is-active {
    background: rgba(74, 124, 35, 0.12);
    border-color: #4a7c23;
    color: #3d6b1e;
}

.agro-lf-draw-btn:focus-visible {
    outline: 2px solid #4a7c23;
    outline-offset: 2px;
}

.agro-lf-draw-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.agro-lf-draw-icon--pin {
    color: #c62828;
}

.agro-lf-draw-btn.is-active .agro-lf-draw-icon--pin {
    color: #b71c1c;
}

.agro-lf-draw-hud {
    position: absolute;
    z-index: 1000;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    max-width: min(520px, calc(100% - 24px));
    padding: 12px 14px 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(74, 124, 35, 0.18);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(15, 26, 12, 0.14);
    backdrop-filter: blur(8px);
}

.agro-lf-draw-hud[hidden] {
    display: none !important;
}

.agro-lf-draw-hud-text {
    margin: 0 0 10px 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #1f2937;
    font-weight: 500;
    text-align: center;
}

.agro-lf-draw-hud-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.agro-lf-draw-hud-primary {
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    background: #4a7c23;
    color: #fff;
    cursor: pointer;
}

.agro-lf-draw-hud-primary:hover {
    background: #3d6b1e;
}

.agro-lf-draw-hud-secondary {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
}

.agro-lf-draw-hud-secondary:hover {
    border-color: #4a7c23;
    color: #3d6b1e;
}

.agro-lf-draw-hud-cancel {
    border: none;
    background: transparent;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    text-decoration: underline;
}

.leaflet-container.agro-lf-map--drawing-polygon,
.leaflet-container.agro-lf-map--drawing-marker {
    cursor: crosshair;
}
