/* ═══════════════════════════════════════════════════
   TEMA CRISTAL — esferas de vidrio y arreglos finales
   ═══════════════════════════════════════════════════
   Se carga después de tema-gusto.css y tienda.css.

   La versión anterior pintaba toda la app (fondo de colores, banda aurora,
   degradados en botones) y no convenció: el color competía con lo que
   significa algo (menta = listo, rosa = falta). Ahora la app queda calmada
   —el fondo ligero de tema-gusto, botones en tinta— y el color vive en un
   solo objeto: la esfera de vidrio (ui/esferas.js), en la foto de perfil,
   en los clientes y, grande, en la bienvenida. Como en la web.
═══════════════════════════════════════════════════ */

:root {
  --grad-menta: linear-gradient(135deg, #DDF5E8, #BFE6D1);
  --grad-lavanda: linear-gradient(135deg, #EEEAFF, #D9D1FB);
  --grad-durazno: linear-gradient(135deg, #FFEEDD, #F9D6B8);
  --grad-cielo: linear-gradient(135deg, #E8EEFF, #D0DCFF);
  --grad-rosa: linear-gradient(135deg, #FDE7EF, #F6CADB);
}

/* ── 1. Esferas ───────────────────────────────────── */
/* Foto del vendedor: la esfera reemplaza la inicial */
.sb-avatar.con-esfera, body.premium-user .sb-avatar.con-esfera {
  width: 36px; height: 36px; border: 0 !important; animation: none !important;
  background-color: #141519 !important; background-size: cover !important; background-position: center !important;
  color: transparent !important; text-shadow: none !important;
  box-shadow: 0 4px 10px -3px rgba(20, 16, 30, .45) !important;
}
.sb-avatar.con-esfera img { display: none; }

/* Clientes en Vender: su esfera con las iniciales encima */
.tv-avatar[data-esfera] {
  width: 38px; height: 38px; background-color: #141519 !important; background-size: cover; background-position: center;
  color: #fff !important; text-shadow: 0 1px 4px rgba(0, 0, 0, .55); font-weight: 650;
  box-shadow: 0 4px 10px -4px rgba(20, 16, 30, .45);
}

/* Bienvenida: la esfera en movimiento reemplaza a la mascota */
html.con-esfera #speedy-wrap > svg { display: none; }
.esfera-viva { display: none; }
html.con-esfera .esfera-viva {
  display: block; width: 200px; height: 200px; margin: 0 auto 34px; border-radius: 50%;
  filter: drop-shadow(0 26px 22px rgba(20, 16, 30, .28));
}
@media (max-width: 768px) { html.con-esfera .esfera-viva { width: 160px; height: 160px; } }

/* Menú de la cuenta */
.sb-esfera-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 11px 14px; border: 0;
  border-bottom: 1px solid var(--linea, rgba(20, 21, 25, .07)); background: transparent;
  color: #141519; font: 500 13px var(--font, inherit); text-align: left; cursor: pointer;
}
.sb-esfera-btn:hover { background: #F2F3F6; }

/* Ventana para elegir la esfera */
.esf-ov {
  position: fixed; inset: 0; z-index: 9000; display: none; place-items: center; padding: 16px;
  background: rgba(20, 21, 25, .28); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.esf-ov.on { display: grid; }
.esf-caja {
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px 22px; border-radius: 28px;
  background: rgba(255, 255, 255, .9); border: 1px solid rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: inset 0 1px 0 #fff, 0 30px 80px -20px rgba(20, 16, 40, .35);
}
.esf-cab { display: flex; align-items: center; justify-content: space-between; }
.esf-cab h3 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.esf-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #F2F3F6; font-size: 22px; line-height: 1; cursor: pointer; }
.esf-ayuda { margin: 6px 0 16px; font-size: 13px; line-height: 19px; color: #50535E; }
.esf-grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.esf-op {
  display: grid; justify-items: center; gap: 8px; padding: 14px 8px 12px; border: 0; border-radius: 20px;
  background: #F6F7F9; font: 500 13px var(--font, inherit); color: #141519; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.esf-op:hover { background: #EEF0F4; }
.esf-op[aria-pressed="true"] { background: #fff; box-shadow: 0 0 0 2px #141519, 0 10px 24px -12px rgba(20, 16, 40, .35); }
.esf-bola {
  width: 84px; height: 84px; border-radius: 50%; background-color: #141519; background-size: cover; background-position: center;
  box-shadow: 0 12px 16px -10px rgba(20, 16, 30, .5);
}
.esf-pie { display: flex; gap: 10px; margin-top: 18px; }
.esf-subir, .esf-listo {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 999px;
  font: 500 14px var(--font, inherit); cursor: pointer;
}
.esf-subir { background: #F2F3F6; color: #141519; }
.esf-subir input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.esf-subir:focus-within { box-shadow: 0 0 0 2px #141519; }
.esf-listo { border: 0; background: #141519; color: #fff; }

/* ── 2. Restos del diseño anterior ────────────────── */
/* Categorías en el panel lateral: rótulo neutro, sin arcoíris */
.item .cpill, .item-meta .cpill {
  background: rgba(20, 21, 25, .05) !important; color: #50535E !important; border: 0 !important;
}
/* Calculadora de IVA: resultados en pastel con significado (cielo = base, durazno = impuesto) */
#quickIvaResults > div:nth-child(1) { background: var(--grad-cielo) !important; border: 1px solid rgba(255, 255, 255, .8) !important; }
#quickIvaResults > div:nth-child(2) { background: var(--grad-durazno) !important; border: 1px solid rgba(255, 255, 255, .8) !important; }
#quickIvaResults > div:nth-child(1) > div:first-child { color: #1B3A86 !important; }
#quickIvaResults > div:nth-child(2) > div:first-child { color: #6E4516 !important; }
#quickIvaInput:focus { border-color: #141519 !important; box-shadow: 0 0 0 1px #141519 !important; }
.iva-rate-badge { background: var(--grad-menta) !important; color: #1F5A3C !important; border: 0 !important; }
.qiva-disc-btn { background: var(--grad-rosa) !important; color: #6F2A47 !important; border: 1px solid rgba(255, 255, 255, .8) !important; }
.qiva-disc-pct, .qiva-disc-pct input, #qivaDiscPctLbl, .qiva-disc-btn span { color: #6F2A47 !important; }
.qiva-disc-pct { background: rgba(255, 255, 255, .7) !important; border-color: rgba(255, 255, 255, .8) !important; }
/* Enlaces de ayuda y rótulos que seguían en ámbar o azul */
button[onclick*="geminiTutorialModal"] { color: #6E4516 !important; }
.swap-hdr-ico { background: var(--grad-lavanda) !important; color: #3F3470 !important; }
th span[style*="#3b82f6"] { color: #50535E !important; }

/* La esfera de bienvenida se arrastra; con el dedo, el gesto vertical sigue desplazando */
html.con-esfera .esfera-viva { cursor: grab; touch-action: pan-y; }
html.con-esfera .esfera-viva.agarrada { cursor: grabbing; }
