/* SUMAR · ver sumar.js. Estructura de la frase, las píldoras, la lista y el total que rueda.
   Piel por variables: --sumar-lleno-fondo / --sumar-lleno-tinta (píldora elegida) · --sumar-lista-fondo /
   --sumar-lista-tinta (la lista) · --sumar-letra (familia de la lista) · --sumar-sombra */
.sumar__campo { position: relative; display: inline-block; white-space: nowrap; vertical-align: baseline; }
.sumar:not(.is-armado) .sumar__campo select { font: inherit; font-size: .55em; max-width: 12em; vertical-align: middle; }

.sumar__chip { display: inline-flex; align-items: center; gap: .32em; padding: .06em .5em .1em; border: .055em solid currentColor;
  border-radius: 999px; line-height: 1.12; color: inherit; cursor: pointer;
  transition: background-color .3s var(--curva), color .3s var(--curva), border-color .3s var(--curva), padding .3s var(--curva); }
.sumar__chip.is-vacio { border-style: dashed; }
.sumar__chip:hover { border-style: solid; }
.sumar__campo.is-lleno .sumar__chip { padding-right: 1.25em; border-color: transparent;
  background: var(--sumar-lleno-fondo, #fff); color: var(--sumar-lleno-tinta, #111); }
/* el «+» de tres barras */
.sumar__signo { flex: none; width: .5em; height: .5em;
  background:
    linear-gradient(currentColor 0 0) 33% 50% / 11% 100% no-repeat, linear-gradient(currentColor 0 0) 50% 50% / 11% 100% no-repeat,
    linear-gradient(currentColor 0 0) 67% 50% / 11% 100% no-repeat, linear-gradient(currentColor 0 0) 50% 33% / 100% 11% no-repeat,
    linear-gradient(currentColor 0 0) 50% 50% / 100% 11% no-repeat, linear-gradient(currentColor 0 0) 50% 67% / 100% 11% no-repeat; }
.sumar__quitar { position: absolute; right: .3em; top: 50%; width: .78em; height: .78em; translate: 0 -46%; border-radius: 50%;
  color: var(--sumar-lleno-tinta, #111); }
.sumar__quitar > span { position: absolute; inset: 22%;
  background: linear-gradient(45deg, transparent 43%, currentColor 43% 57%, transparent 57%),
              linear-gradient(-45deg, transparent 43%, currentColor 43% 57%, transparent 57%); }
.sumar__quitar:hover { background: rgb(0 0 0 / .1); }
.sumar__quitar[hidden] { display: none; }

.sumar__lista { position: absolute; z-index: 40; left: 0; top: calc(100% + .35em); translate: var(--corre, 0px) 0;
  width: max-content; min-width: 15rem; max-width: min(23rem, calc(100vw - 24px)); max-height: min(24rem, 62svh);
  overflow: auto; overscroll-behavior: contain; padding: .4rem; border-radius: 16px; outline: none;
  background: var(--sumar-lista-fondo, #fff); color: var(--sumar-lista-tinta, #111);
  box-shadow: var(--sumar-sombra, 0 24px 60px rgb(0 0 0 / .35)); font-family: var(--sumar-letra, inherit);
  font-size: 1rem; font-weight: 500; letter-spacing: 0; line-height: 1.3; white-space: normal; text-align: left; text-transform: none; }
.sumar__lista[hidden] { display: none; }
.mov .sumar__lista:not([hidden]) { animation: sumar-abre .28s var(--curva) both; }
@keyframes sumar-abre { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.sumar__opcion { display: flex; align-items: baseline; justify-content: space-between; gap: 1.2rem; padding: .62rem .8rem;
  border-radius: 10px; cursor: pointer; }
.sumar__opcion.is-activo { background: rgb(0 0 0 / .07); }
.sumar__opcion[aria-selected="true"] { font-weight: 700; }
.sumar__opcion[aria-selected="true"]::before { content: ""; flex: none; width: .45em; height: .45em; margin-right: -.6rem;
  align-self: center; border-radius: 50%; background: currentColor; order: -1; }
.sumar__opcion[aria-disabled="true"] { opacity: .36; cursor: default; }
.sumar__n { margin-left: auto; opacity: .55; font-variant-numeric: tabular-nums; }
.sumar__grupo { padding: .8rem .8rem .3rem; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .5; }
.sumar__fondo { display: none; }

@media (max-width: 640px) {
  .sumar__lista { position: fixed; inset: auto 0 0 0; top: auto; translate: none; width: auto; max-width: none; min-width: 0;
    max-height: 72svh; border-radius: 20px 20px 0 0; padding: .7rem .7rem calc(.9rem + env(safe-area-inset-bottom)); font-size: 1.05rem; }
  .sumar.is-eligiendo .sumar__fondo { display: block; position: fixed; inset: 0; z-index: 39; background: rgb(0 0 0 / .55); }
  @keyframes sumar-abre { from { transform: translateY(40px); opacity: 0; } }
}

/* el total que rueda */
.sumar__cifras { display: inline-flex; font-variant-numeric: tabular-nums; }
.sumar__cifra { display: inline-block; height: 1em; line-height: 1; overflow: hidden; }
.sumar__col { display: flex; flex-direction: column; transform: translateY(calc(-1em * var(--d, 0)));
  transition: transform .75s cubic-bezier(.2, .8, .2, 1); }
.sumar__cifra:nth-child(2) .sumar__col { transition-delay: .05s; } .sumar__cifra:nth-child(3) .sumar__col { transition-delay: .1s; }
.sumar__col > span { display: block; height: 1em; line-height: 1; text-align: center; }
