/* ============ LAYOUT GENERAL ============ */
.sn-wrap {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
}
@media (max-width:768px){
  .sn-wrap { grid-template-columns: 1fr; }
}

/* ============ PADS (Tengo / Quiero) ============ */
.sn-pad {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}
.sn-pad--active {
  outline: 2px solid #2e7d32;
  box-shadow: 0 0 0 3px rgba(46,125,50,.15);
}
.sn-head { font-weight: 600; margin-bottom: 6px; }

/* ============ INPUT + SUGERENCIAS ============ */
.sn-input { position: relative; }
.sn-input input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.sn-suggest {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  z-index: 1000;
  margin-top: 4px;
  list-style: none;
  padding: 6px 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  max-height: 240px;
  overflow: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
  box-sizing: border-box;
}
.sn-suggest li { padding: 6px 10px; cursor: pointer; }
.sn-suggest li:hover { background: #f5f5f5; }

/* ============ LISTA DE CHIPS ============ */
.sn-list {
  display: flex;
  flex-direction: column; /* ítems en columna */
  gap: 6px;
  margin-top: 8px;
}
.sn-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: #f9f9f9;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  user-select: none;
}
.sn-chip[draggable="true"] { opacity: .95; cursor: grab; }
.sn-chip[draggable="true"]:active { cursor: grabbing; }
.sn-dot, .sn-x {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  margin-left: 6px;
}
.sn-dot:hover, .sn-x:hover { color: #d33; }

/* Edición inline */
.sn-edit {
  border: none; background: transparent;
  font-size: 14px; min-width: 40px;
}
.sn-edit:focus {
  outline: none;
  background: #fff;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #ccc;
  padding: 0 2px;
}

/* ============ MENÚ SUPERIOR ============ */
.sn-menu,
.sn-actions {
  grid-column: 1 / -1 !important;
  width: 100%;
}
.sn-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
  overflow: visible;
}
.sn-filter-pill {
  font-weight: 600;
  color: #666;
  margin-right: auto;
}
.sn-cat { position: relative; display: inline-block; }
.sn-cat-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: .35rem .6rem;
  font-size: .92rem;
  line-height: 1;
  cursor: pointer;
}
.sn-cat-btn.active {
  border-color: #1a7f37;
  box-shadow: 0 0 0 2px rgba(26,127,55,.08) inset;
}
.sn-cat-btn:focus-visible {
  outline: 2px solid #1a7f37;
  outline-offset: 2px;
}

/* Dropdown */
.sn-dd {
  position: absolute;
  top: calc(100% + .4rem);
  left: 0;
  z-index: 9999;
  min-width: 220px;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: .5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  display: none;              /* cerrado por defecto */
}
.sn-dd.open { display: block; }
.sn-dd h5 { display: none; }
.sn-dd ul { list-style: none; margin: 0; padding: 0; }
.sn-dd li {
  padding: .25rem .35rem;
  border-radius: 8px;
  cursor: pointer;
}
.sn-dd li:hover { background: #f5f7f9; }
.sn-var {
  margin: .25rem 0 .1rem .25rem;
  font-size: .9em;
  opacity: .85;
}
.sn-var > div {
  padding: .15rem .35rem;
  border-radius: 6px;
}
.sn-var > div:hover { background: #eef2f5; }

/* ============ MISC ============ */
@media (prefers-reduced-motion: reduce){
  * { animation: none!important; transition: none!important; }
}
/* El chip abierto debe estar por encima de sus vecinos */
.sn-cat.open { z-index: 10000; }

/* Por si algún padre mete stacking contexts raros */
.sn-wrap, .sn-menu { position: relative; z-index: 1; }

/* El dropdown ya tiene z-index alto; mantenlo */
.sn-dd { z-index: 9999; }