/* Remove o container padrão */
.leaflet-draw-toolbar.leaflet-bar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.leaflet-left { left: -2px; }
.leaflet-top { top: -2px; }

/* Botão base */
.leaflet-draw-toolbar a {
  /* border-radius: 10px !important; */
  width: 44px !important;
  height: 44px !important;
  background-image: none !important; /* remove sprite padrão */
  
}
.leaflet-draw-toolbar.leaflet-bar a:first-child {
  border-top-left-radius: 10px !important;
  border-top-right-radius: 10px !important;
}
.leaflet-draw-toolbar.leaflet-bar a:last-child {
  border-bottom-left-radius: 10px !important;
  border-bottom-right-radius: 10px !important;
}

.leaflet-draw-toolbar.leaflet-bar a {
  margin: 0 !important;                 /* remove gaps */
  border-radius: 0 !important;          /* middle items square */
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  background-image: none !important;
  display: block !important;

  /* remove Leaflet Bar default borders between items (we'll add our own divider) */
  border: 0 !important;
  box-shadow: none !important;

  /* for divider positioning */
  position: relative;
}










/* Ícone via mask (mantém) */
.leaflet-draw-toolbar a::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: 11px auto;

  /* o "fill" do ícone vem daqui */
  background-color: var(--leaflet-draw-icon-color, rgba(0,0,0,0.75));
  opacity: 0.85;

  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;

  -webkit-mask-image: none;
  mask-image: none;
  
}

/* Enabled/ativo (base) */
.leaflet-draw-toolbar a.leaflet-draw-toolbar-button-enabled {
  outline: 2px solid rgba(0,0,0,0.15);
}

/* Desabilitado */
.leaflet-draw-toolbar a.leaflet-disabled {
  opacity: 0.45;
  pointer-events: none;
}


/* LIGHT */
[data-mantine-color-scheme="light"] .leaflet-draw-toolbar a {
  background-color: rgb(255, 255, 255) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-mantine-color-scheme="light"] .leaflet-draw-toolbar a:hover {
  background-color: rgba(255, 255, 255, 0.85) !important;
}

/* cor do ícone no light */
[data-mantine-color-scheme="light"] .leaflet-draw-toolbar {
  --leaflet-draw-icon-color: rgba(0,0,0,0.75);
}

[data-mantine-color-scheme="light"] .leaflet-draw-toolbar a.leaflet-draw-toolbar-button-enabled {
  outline-color: rgba(0,0,0,0.15);
}

/* DARK */
[data-mantine-color-scheme="dark"] .leaflet-draw-toolbar a {
  /* fundo e borda coerentes com Mantine */
  background-color: var(--mantine-color-dark-7) !important;
  border: 1px solid var(--mantine-color-dark-5) !important;
}

/* hover no dark */
[data-mantine-color-scheme="dark"] .leaflet-draw-toolbar a:hover {
  background-color: var(--mantine-color-dark-6) !important;
}

/* ícone claro no dark */
[data-mantine-color-scheme="dark"] .leaflet-draw-toolbar {
  --leaflet-draw-icon-color: var(--mantine-color-text);
}

/* enabled/ativo no dark */
[data-mantine-color-scheme="dark"] .leaflet-draw-toolbar a.leaflet-draw-toolbar-button-enabled {
  outline-color: rgba(255,255,255,0.18);
}


/* DRAW */
.leaflet-draw-toolbar a.leaflet-draw-draw-rectangle::before {
  -webkit-mask-image: url("https://api.iconify.design/material-symbols/crop-square-outline.svg");
  mask-image: url("https://api.iconify.design/material-symbols/crop-square-outline.svg");
}

.leaflet-draw-toolbar a.leaflet-draw-draw-polygon::before {
  -webkit-mask-image: url("https://api.iconify.design/material-symbols/pentagon-outline.svg");
  mask-image: url("https://api.iconify.design/material-symbols/pentagon-outline.svg");
}

.leaflet-draw-toolbar a.leaflet-draw-draw-polyline::before {
  -webkit-mask-image: url("https://api.iconify.design/material-symbols/polyline.svg");
  mask-image: url("https://api.iconify.design/material-symbols/polyline.svg");
}

.leaflet-draw-toolbar a.leaflet-draw-draw-circle::before {
  -webkit-mask-image: url("https://api.iconify.design/material-symbols/circle-outline.svg");
  mask-image: url("https://api.iconify.design/material-symbols/circle-outline.svg");
}

.leaflet-draw-toolbar a.leaflet-draw-draw-marker::before {
  -webkit-mask-image: url("https://api.iconify.design/material-symbols/location-on-outline.svg");
  mask-image: url("https://api.iconify.design/material-symbols/location-on-outline.svg");
}

.leaflet-draw-toolbar a.leaflet-draw-draw-circlemarker::before {
  -webkit-mask-image: url("https://api.iconify.design/material-symbols/radio-button-unchecked.svg");
  mask-image: url("https://api.iconify.design/material-symbols/radio-button-unchecked.svg");
}

/* EDIT */
.leaflet-draw-toolbar a.leaflet-draw-edit-edit::before {
  -webkit-mask-image: url("https://api.iconify.design/material-symbols/edit-outline.svg");
  mask-image: url("https://api.iconify.design/material-symbols/edit-outline.svg");
}

.leaflet-draw-toolbar a.leaflet-draw-edit-remove::before {
  -webkit-mask-image: url("https://api.iconify.design/material-symbols/delete-outline.svg");
  mask-image: url("https://api.iconify.design/material-symbols/delete-outline.svg");
}












.leaflet-draw-toolbar.leaflet-bar a {
  box-sizing: border-box !important;
}

.leaflet-draw-toolbar.leaflet-bar a:not(:first-child) {
  margin-top: -2px !important;
}

/* Divider line between buttons (Mantine Divider vibe) */
.leaflet-draw-toolbar.leaflet-bar a:not(:last-child)::after{
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 2px;
  opacity: 0.6;
  background: rgba(0, 0, 0, 0.10);
}
[data-mantine-color-scheme="dark"] .leaflet-draw-toolbar.leaflet-bar a:not(:last-child)::after{
  background: rgba(255, 255, 255, 0.12);
}


.leaflet-draw-toolbar.leaflet-bar a {
  border: transparent 1px solid !important;
}

/* [data-mantine-color-scheme="dark"] 
.leaflet-draw-toolbar.leaflet-bar a:not(:last-child)::after {
  display: none !important;
} */

.leaflet-touch .leaflet-draw-actions {
    left: 43px;
}

.leaflet-draw-actions.leaflet-draw-actions-top {
    top: 6px !important;
}

.leaflet-draw-actions {
    border-radius: 4px !important;
    overflow: hidden;
}