/* Lugares → columna «Sucursales» y su widget (js/admin/panels/places/branches.js) */

/* ── Columna en la tabla ─────────────────────────────────── */
/* Centrada en ambos: el encabezado y el círculo quedan en el mismo eje. */
.admin-table th.pb-col,
.admin-table td.pb-col {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.pb-count,
.pb-add {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  font-family: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s, color .15s;
}
.pb-count {
  border: none;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .4);
}
.pb-add {
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 17px;
}
.pb-count:hover,
.pb-add:hover { transform: scale(1.1); }
.pb-add:hover { border-color: #f97316; border-style: solid; color: #f97316; }
.pb-count:focus-visible,
.pb-add:focus-visible { outline: 2px solid #f97316; outline-offset: 2px; }

/* ── Widget ──────────────────────────────────────────────── */
.admin-modal-content:has(.pb-modal) { max-width: 680px; }

.pb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.pb-head-text { min-width: 0; }
.pb-kicker { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #f97316; }
.pb-title { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.25; word-break: break-word; }
.pb-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.pb-btn-add {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .35);
  transition: transform .15s, opacity .15s;
}
.pb-btn-add .material-icons-outlined { font-size: 18px; }
.pb-btn-add:hover:not(:disabled) { transform: translateY(-1px); }
.pb-btn-add:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* Mapa */
.pb-map-wrap { position: relative; margin-bottom: 12px; }
.pb-map {
  height: 280px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}
.pb-map-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.pb-map-hint[hidden] { display: none; }
.pb-map-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 16px;
  text-align: center;
}
.pb-modal .mapboxgl-popup-content { font-size: 12px; color: #111; padding: 6px 10px; }

/* Pines */
.pb-marker { cursor: pointer; }
.pb-marker-shape {
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #94a3b8;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  transition: width .15s, height .15s, background .15s;
}
.pb-marker.is-active { z-index: 2; }
.pb-marker.is-active .pb-marker-shape { background: #f97316; width: 28px; height: 28px; }
.pb-marker-closed { opacity: .5; }
.pb-marker-draft { cursor: grab; z-index: 3; }
.pb-marker-draft:active { cursor: grabbing; }
.pb-marker-draft .pb-marker-shape {
  width: 30px;
  height: 30px;
  background: #f97316;
  box-shadow: 0 0 0 6px rgba(249, 115, 22, .25), 0 3px 8px rgba(0, 0, 0, .35);
}

/* Aviso de lugar sin dueño */
.pb-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}
.pb-note .material-icons-outlined { font-size: 18px; color: var(--primary); }

/* Lista */
.pb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s, opacity .15s;
}
.pb-item:hover { border-color: #f97316; }
.pb-item:focus-visible { outline: 2px solid #f97316; outline-offset: 1px; }
.pb-item.is-active { border-color: #f97316; background: rgba(249, 115, 22, .08); }
.pb-item.is-locked { cursor: default; opacity: .55; }
.pb-item.is-locked:hover { border-color: var(--border); }
.pb-item-closed .pb-body,
.pb-item-closed .pb-pin { opacity: .6; }
.pb-pin { font-size: 20px; color: #f97316; flex: none; }
.pb-body { flex: 1; min-width: 0; }
.pb-label { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pb-addr { font-size: 12px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.pb-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.pb-tag-main { background: rgba(249, 115, 22, .15); color: #f97316; }
.pb-tag-closed { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.pb-tag-warn { background: rgba(234, 179, 8, .15); color: #a16207; }

.pb-item-actions { display: flex; gap: 6px; flex: none; }
.pb-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary, var(--text));
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.pb-act .material-icons-outlined { font-size: 16px; }
.pb-act:hover:not(:disabled) { border-color: #f97316; color: #f97316; }
.pb-act-warn:hover:not(:disabled) { border-color: #d97706; color: #d97706; }
.pb-act-danger:hover:not(:disabled) { border-color: #dc2626; color: #dc2626; background: rgba(220, 38, 38, .06); }
.pb-act:disabled { opacity: .4; cursor: not-allowed; }

/* Buscador de dirección sobre el mapa (autocompletado de admin-geocode.js) */
.pb-search {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 52px;              /* deja libres los botones de zoom */
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.pb-search[hidden] { display: none; }
.pb-search:focus-within { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, .2), 0 4px 14px rgba(0, 0, 0, .18); }
.pb-search-icon { font-size: 20px; color: var(--text-muted); flex: none; }
/* El autocompletado envuelve el input: el envoltorio no se posiciona para que
   las sugerencias tomen todo el ancho del buscador y no solo el del input. */
.pb-search .mb-suggest-wrap { position: static; flex: 1; min-width: 0; }
.pb-search .mb-suggest-popup { left: 0; right: 0; max-height: 220px; }
.pb-search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 11px 4px;
}
.pb-search-input::placeholder { color: var(--text-muted); }
.pb-search-clear {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.pb-search-clear .material-icons-outlined { font-size: 18px; }
.pb-search-clear:hover { background: var(--bg); color: var(--text); }
.pb-search:has(.pb-search-input:placeholder-shown) .pb-search-clear { display: none; }

/* Formulario agregar / editar (debajo del mapa) */
.pb-form {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid #f97316;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
}
.pb-form-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.pb-form-title .material-icons-outlined { font-size: 20px; color: #f97316; }
.pb-form .form-group { margin: 10px 0 0; }
.pb-opt { font-weight: 400; color: var(--text-muted); font-size: 11px; text-transform: none; }
.pb-form-status {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}
.pb-form-status .material-icons-outlined { font-size: 16px; }
.pb-form-status.is-ok { color: #16a34a; }
.pb-form-note { margin-top: 8px; font-size: 11px; color: var(--text-muted); line-height: 1.45; }
.pb-form-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pb-item.is-editing { opacity: 1; border-color: #f97316; border-style: dashed; }

.pb-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

/* Celular: acciones abajo del texto y formulario en una columna */
@media (max-width: 600px) {
  .pb-head { flex-direction: column; align-items: stretch; }
  .pb-btn-add { justify-content: center; }
  .pb-map { height: 220px; }
  .pb-item { flex-wrap: wrap; }
  .pb-item-actions { width: 100%; justify-content: flex-end; }
  .pb-search { right: 46px; }
}
